Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Max Ammo/Health = Current Ammo/Health (AA Script)

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Taka IV
Newbie cheater
Reputation: 0

Joined: 26 Feb 2012
Posts: 24

PostPosted: Wed Aug 19, 2015 7:46 am    Post subject: Max Ammo/Health = Current Ammo/Health (AA Script) Reply with quote

First of all, I'm not sure whether this is the correct section to be asking this question but anyways,

I've just started playing with Cheat Engine again recently and I saw on some sites I've visited (Can't remember where and which site) that you can make a script for instance, an Infinite Health or Infinite Ammo by setting the current health as the maximum health vice versa and the same on ammo. I've tried it and failed to understand because I don't know much coding and the code I've assembled seems to be wrong. I was able to find the address of the maximum ammo though. Just my coding is too bad. Anybody knows anything about this or have a tutorial that may help me? Thanks in advance.

_________________
Understand what you can't.

That's how it usually works.
Back to top
View user's profile Send private message
Rydian
Grandmaster Cheater Supreme
Reputation: 29

Joined: 17 Sep 2012
Posts: 1358

PostPosted: Wed Aug 19, 2015 9:35 am    Post subject: Reply with quote

Show us both current and maximum ammo, and also right-click them and "find what accesses this address" and wait for some things to show up in the windows there and screenshot those for us.
_________________
Back to top
View user's profile Send private message
Taka IV
Newbie cheater
Reputation: 0

Joined: 26 Feb 2012
Posts: 24

PostPosted: Fri Aug 21, 2015 3:39 am    Post subject: Reply with quote

Is this correct?
_________________
Understand what you can't.

That's how it usually works.
Back to top
View user's profile Send private message
Rydian
Grandmaster Cheater Supreme
Reputation: 29

Joined: 17 Sep 2012
Posts: 1358

PostPosted: Fri Aug 21, 2015 7:50 am    Post subject: Reply with quote

Alright, so both current and max are in the same structure? That makes it easy, you just need to do some code injection and change the +0C to +10 when it goes to read.

See if there's a line of code that shows up as reading (accesses) the current ammo value when you fire, 'cause you can do an injection on that and change it so it reads the max ammo instead of current or something.

(I ask to be certain 'cause that mov looks a little strange to me, using ebp like that.)

_________________
Back to top
View user's profile Send private message
Noobrzor
Advanced Cheater
Reputation: 0

Joined: 19 May 2014
Posts: 74

PostPosted: Fri Aug 21, 2015 7:53 am    Post subject: Reply with quote

I'm not sure if I'm understanding correctly.

You want the game to permanently give you unlimited ammo, by 'freezing' your Current Ammo/Whatever into available Max Ammo/Whatever?

I use Code Injection for that. Do the entire Cheat Engine Tutorial (comes with every CE installation, it's in the main folder) to get a grasp on it.

Usually, if there's a single variable that corresponds to a singular ammo, you do it like this.

1. Find address for the ammo.
2. RightClick -> Find out what accesses this adress (what writes works too, usually)
3. A debugger window opens. Now go shoot a bullet, and then return to CE.
4. Browse the opcodes that have shown in the debugger. These are 'instructions that change the amount of ammo'. Some are easy to cheat through, others require creativity and clever thinking.
For example, if you'll open the instruction, and you'll see something like that
"sub [eax+04],01"
And the address that sits at eax (+04, which is an offset) coincidentally is the address, then you know that this instruction subtracts one from value ([]brackets) sitting at address eax+04. Simply by switching that to nop (no operation) you have unlimited ammo.

Learn aforementioned Code Injection from CETutorial to learn how to create AAScripts and change opcodes (sub,add,mov,nop etc.)

If you'd want to have the injected code always refresh your Current Ammo to what is Maximum Ammo allowed, you might see something like:
"mov [eax],ebx", where eax is the address of the ammo, [eax] is the value of that adress, and ebx is the maximum ammo.
Back to top
View user's profile Send private message
Daijobu
Master Cheater
Reputation: 13

Joined: 05 Feb 2013
Posts: 301
Location: the Netherlands

PostPosted: Fri Aug 21, 2015 8:07 am    Post subject: Reply with quote

See comments. Please look at it and read the comments in order to understand it.
Memory View > CTRL+A > Copy below and paste! > File: Assign to current cheat table

Code:
[ENABLE]
alloc(newmem,$1000)
label(exit)

newmem: //This is allocated memory
mov ebp,[edi+10] //Modified - 3 bytes. If +C holds current ammo and +10 holds max ammo, then move max ammo into the ebp register.
mov ecx,edi //Original - 2 bytes
jmp exit

rerev2.exe+4D0B90:
jmp newmem //This writes 5 bytes worth at the original location and tells it to jump to the allocated memory.
exit:

[DISABLE]
rerev2.exe+4D0B90:
db 8B 6F 0C 8B CF //These are the original bytes from your screenshot, see comment below.
//Original, same as designate byte (db) above.
//mov ebp,[edi+0C]
//mov ecx,edi
dealloc(newmem)


I feel like I forgot something. Can't think of it. Bleh.

_________________
Scripts/tables from scratch. Relation to other scripts is coincidental. Use of posted code is credited properly.
Euro Truck Simulator 2 Backwards Compatible Cheat
American Truck Simulator Backwards Compatible Cheat
Back to top
View user's profile Send private message
Taka IV
Newbie cheater
Reputation: 0

Joined: 26 Feb 2012
Posts: 24

PostPosted: Sun Aug 23, 2015 10:35 am    Post subject: Reply with quote

First of all, sorry for the late reply but anyways,

Quote:
Alright, so both current and max are in the same structure? That makes it easy, you just need to do some code injection and change the +0C to +10 when it goes to read.

See if there's a line of code that shows up as reading (accesses) the current ammo value when you fire, 'cause you can do an injection on that and change it so it reads the max ammo instead of current or something.

(I ask to be certain 'cause that mov looks a little strange to me, using ebp like that.)


Yeah, I tried but not good at AA script yet. Tried it but failed. I don't know how to write the script but I've mostly understand what to do. Only the commands.


Quote:
I'm not sure if I'm understanding correctly.

You want the game to permanently give you unlimited ammo, by 'freezing' your Current Ammo/Whatever into available Max Ammo/Whatever?

I use Code Injection for that. Do the entire Cheat Engine Tutorial (comes with every CE installation, it's in the main folder) to get a grasp on it.

Usually, if there's a single variable that corresponds to a singular ammo, you do it like this.

1. Find address for the ammo.
2. RightClick -> Find out what accesses this adress (what writes works too, usually)
3. A debugger window opens. Now go shoot a bullet, and then return to CE.
4. Browse the opcodes that have shown in the debugger. These are 'instructions that change the amount of ammo'. Some are easy to cheat through, others require creativity and clever thinking.
For example, if you'll open the instruction, and you'll see something like that
"sub [eax+04],01"
And the address that sits at eax (+04, which is an offset) coincidentally is the address, then you know that this instruction subtracts one from value ([]brackets) sitting at address eax+04. Simply by switching that to nop (no operation) you have unlimited ammo.

Learn aforementioned Code Injection from CETutorial to learn how to create AAScripts and change opcodes (sub,add,mov,nop etc.)

If you'd want to have the injected code always refresh your Current Ammo to what is Maximum Ammo allowed, you might see something like:
"mov [eax],ebx", where eax is the address of the ammo, [eax] is the value of that adress, and ebx is the maximum ammo.


Yeah, I already finished it and do it several times when I'm bored. About the last part of what you said:
Quote:
If you'd want to have the injected code always refresh your Current Ammo to what is Maximum Ammo allowed, you might see something like:
"mov [eax],ebx", where eax is the address of the ammo, [eax] is the value of that adress, and ebx is the maximum ammo.


This is exactly what I want. Thanks, but can you please tell me more how to do this. Still bad at AA scripts.


Quote:
See comments. Please look at it and read the comments in order to understand it.
Memory View > CTRL+A > Copy below and paste! > File: Assign to current cheat table

Code:
[ENABLE]
alloc(newmem,$1000)
label(exit)

newmem: //This is allocated memory
mov ebp,[edi+10] //Modified - 3 bytes. If +C holds current ammo and +10 holds max ammo, then move max ammo into the ebp register.
mov ecx,edi //Original - 2 bytes
jmp exit

rerev2.exe+4D0B90:
jmp newmem //This writes 5 bytes worth at the original location and tells it to jump to the allocated memory.
exit:

[DISABLE]
rerev2.exe+4D0B90:
db 8B 6F 0C 8B CF //These are the original bytes from your screenshot, see comment below.
//Original, same as designate byte (db) above.
//mov ebp,[edi+0C]
//mov ecx,edi
dealloc(newmem)



I feel like I forgot something. Can't think of it. Bleh.


Wow, thanks. Will try this later cause too busy this week.

_________________
Understand what you can't.

That's how it usually works.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites