View previous topic :: View next topic |
Author |
Message |
Jaara How do I cheat? Reputation: 0
Joined: 22 Oct 2017 Posts: 3
|
Posted: Thu Nov 09, 2017 12:33 pm Post subject: Stack corruption question |
|
|
Can the stack be corrupted if I use the add and sub commands?
In disgaea2 the influence value is moved from the stack into edx (mov edx, [esp+28]
I want to modify it by doing this:
Add esp, 28
Pop edx
Mov edx, 64
Sub esp, 28
Will this corrupt the stack?
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25296 Location: The netherlands
|
Posted: Thu Nov 09, 2017 12:54 pm Post subject: |
|
|
yes, after that esp will be at -4 as pop edx will decrease esp with 4 (unless you have a push somewhere earlier)
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
Jaara How do I cheat? Reputation: 0
Joined: 22 Oct 2017 Posts: 3
|
Posted: Thu Nov 09, 2017 4:01 pm Post subject: |
|
|
Whoops. Forgot to write Push edx before I subtracted the offset.
In this game, the change in influence is permanent(ish). However, I found that I wasn't changing how the program saw it. The program was calculating the change somewhere in the code and added this to the stack. Then it was used elsewhere to modify the influence for the senators themselves. Changing the cheat table value didn't do that (since the program just popped the influence from the stack somewhere else in code). I figured that if I modify the stack, then the program will always pull the value I put on the stack (rather than just modifying the temporary value in edx).
Thank you. I just wasn't sure if adding an offset to esp would fill the old values with garbage or not (which is why I subtracted the same offset after I pushed the new value in).
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25296 Location: The netherlands
|
Posted: Thu Nov 09, 2017 4:47 pm Post subject: |
|
|
also, don't increase ESP.
While I don't think windows uses usermode interrupts, you never know. (they can randomly modify the bytes before ESP)
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
|