View previous topic :: View next topic |
Author |
Message |
TPRammus Advanced Cheater Reputation: 0
Joined: 05 Jan 2016 Posts: 61 Location: Germany
|
Posted: Thu May 26, 2016 6:47 pm Post subject: How to change other values in scripts |
|
|
Hey!
I recently saw this post: forum.cheatengine.org/viewtopic.php?t=574172&sid=2df4f226c2de65f9afdb512168b948e0
And I am wondering how you can change the value of an address in a script.
I mean something like that: Every time when you shoot (when the 'decrease bullets' part is ran) your HP gets set to 100.
regards, TPRammus
|
|
Back to top |
|
|
ParkourPenguin I post too much Reputation: 140
Joined: 06 Jul 2014 Posts: 4299
|
Posted: Thu May 26, 2016 7:59 pm Post subject: |
|
|
- Find the address of your HP (static pointer or registered symbol).
- Find some instruction that's run when you shoot.
- Write the value 100 to the address of your HP in a code injection using that instruction.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
|
TPRammus Advanced Cheater Reputation: 0
Joined: 05 Jan 2016 Posts: 61 Location: Germany
|
Posted: Fri May 27, 2016 9:36 am Post subject: |
|
|
ParkourPenguin wrote: | - Find the address of your HP (static pointer or registered symbol).
- Find some instruction that's run when you shoot.
- Write the value 100 to the address of your HP in a code injection using that instruction.
|
Thank you for your answer but I dont know how the commands/instructions are. What if the addess of the health is 004F15AB and his pointers are C, 17 and 16?
And what do you mean with registered symbol?
regards, TPRammus
|
|
Back to top |
|
|
ParkourPenguin I post too much Reputation: 140
Joined: 06 Jul 2014 Posts: 4299
|
Posted: Fri May 27, 2016 9:53 am Post subject: |
|
|
You can copy the base address of the structure your HP is in to some memory region that's been registered as a symbol and get the address that way. For example, if the instruction mov eax,[esi+34] accesses the address of your HP, then you could do this:
Code: | aobscan(inject,8B 46 34...)
alloc(newmem,1024)
globalalloc(HPstruct,4)
label(return)
newmem:
mov [HPstruct],esi
mov eax,[esi+34]
// other original code
jmp return
inject:
jmp newmem
// nop as necessary
return: |
After the game runs that section of asm, the address [HPstruct]+34 will be the address of your HP, and you can write to it like this:
Code: | writeInteger("[HPstruct]+34", 100) |
Some things could go wrong with this method: that section of asm may not be run that often or it could also access other addresses. The first one is situational and can be solved by choosing a different injection point. The second has ways of solving it as well, but it's usually easier to choose a different injection point.
For pointers, assuming you intended to say the base address of a pointer to your health is at 004F15AB and the base address of the module it's in is at 00400000, then you can write to your health like this:
Code: | writeInteger("[[[game.exe+F15AB]+C]+17]+16", 100) |
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
|
|