View previous topic :: View next topic |
Author |
Message |
FragrantRegard How do I cheat?
Reputation: 0
Joined: 01 Jan 2016 Posts: 4 Location: Seattle
|
Posted: Fri Jan 01, 2016 11:20 pm Post subject: Trying to replace an inc with addition of 2 or more |
|
|
Within the memory, at one address I isolated a snippet of code like this:
Instead of just increasing eax by 1, I wanted to increase it by 2 or some other arbitrary value. I attempted to replace it with an auto-assembler script like this:
Code: | [ENABLE]
alloc(newmem, 2048)
label(returnhere)
label(originalcode)
label(exit)
0027041D:
jmp newmem
nop
returnhere:
newmem:
add [eax], 2
jmp returnhere
originalcode:
inc [eax]
exit:
jmp returnhere
[DISABLE]
0027041D:
inc [eax]
|
I assume since the inc and an add would be different numbers of bytes that this has caused my issue where the program instantly crashes.
Sorry if wrong subforum.
_________________
Working on spelunky hax |
|
Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Fri Jan 01, 2016 11:32 pm Post subject: |
|
|
You should use Cheat Engine's AOB Injection template instead of trying to write it manually.
In Auto assemble, Template > AOB Injection
You're likely crashing because your jump overwrote more than just "inc [eax]" and the game needed those instructions.
|
|
Back to top |
|
 |
FragrantRegard How do I cheat?
Reputation: 0
Joined: 01 Jan 2016 Posts: 4 Location: Seattle
|
Posted: Sat Jan 02, 2016 12:31 am Post subject: |
|
|
That did the trick, thank you. And with AOB Injection, that also means I shouldn't have issues with RAM addresses changing upon multiple restarts of the game?
_________________
Working on spelunky hax |
|
Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Sat Jan 02, 2016 12:35 am Post subject: |
|
|
Correct
|
|
Back to top |
|
 |
akumakuja28 Master Cheater
Reputation: 16
Joined: 28 Jun 2015 Posts: 432
|
Posted: Sat Jan 02, 2016 2:01 pm Post subject: |
|
|
FragrantRegard wrote: | That did the trick, thank you. And with AOB Injection, that also means I shouldn't have issues with RAM addresses changing upon multiple restarts of the game? |
Aob injection scans the games/programs operation codes. Cheat engine scans for this pre defined string of characters in the .exe file its self. Then creates a registered symbol to track that point and creates a jump to new allocated memory. In this new memory you can write in your own code.
Yes that .exe is loaded in your RAM that makes it random to your memory but its not random at all according to cheat engine.
AOB is basically there to deal with version variations of a program.
Its all code injection in the end.
RAM addresses changing upon restart is a "pointer" thing about dynamic memory.
_________________
|
|
Back to top |
|
 |
|