About calculating call from different location and readmem in general
Posted: Mon Jan 10, 2022 9:52 pm
First question is, why I'm getting a "Invalid address for ReadMem" error in code like this:
Searched about this procedure and seen, that people are using method like this to store original values for disabling part and for them its working great. And simple reverting value to its original(when cheat is disabling - or when "readmem(desired,5) " is commented out) is working for me too, but writing desired bytes - is not. Where I'm stupid and why?
And second - Is there a way to calculate a desired call from different location?
Let's say, I have an assembler code looks like this:
I need to replace second call with the first one without allocating newmem and jumping to it and any other things, just by using readmem and some magic, so I dont need to change much code, when game is updated.
Idea is, that I save second call bytes throught readMem for later disabling procedure. Then I save first call bytes throught readMem, then I subtract two calls byte lenth difference(11 bytes) from recived bytes and then replace second call with calculated first call. And if cheat is disabled - second call is replaced with it's original.
Is it possible? Or is any other means possible? Like reading instruction opcodes, then replace second with the first? Tried to search anything about related and found nothing.
I know, that it's easier to save time and just create a newmem, but I want to learn better methods.
Code: Select all
[ENABLE]
aobscanmodule(INJECT,Exanima.exe,E8 9D B6 FB FF)
registersymbol(INJECT)
alloc(original,5)
alloc(desired,5)
registersymbol(original)
registersymbol(desired)
original:
readmem(INJECT+11,5)
desired:
readmem(INJECT,5)
INJECT+11:
readmem(desired,5) //error here
[DISABLE]
INJECT+11:
readmem(original,5) // is working fine
unregistersymbol(INJECT)
unregistersymbol(original)
unregistersymbol(desired)
And second - Is there a way to calculate a desired call from different location?
Let's say, I have an assembler code looks like this:
Code: Select all
004B1EFE - E8 9DB6FBFF - call 0046D5A0
004B1F03 - 8B 04 24
004B1F06 - 8B D0
004B1F08 - A1 F41E6300
004B1F0D - 8B 00
004B1F0F - E8 14B7FBFF - call 0046D628
Idea is, that I save second call bytes throught readMem for later disabling procedure. Then I save first call bytes throught readMem, then I subtract two calls byte lenth difference(11 bytes) from recived bytes and then replace second call with calculated first call. And if cheat is disabled - second call is replaced with it's original.
Is it possible? Or is any other means possible? Like reading instruction opcodes, then replace second with the first? Tried to search anything about related and found nothing.
I know, that it's easier to save time and just create a newmem, but I want to learn better methods.