chis101 How do I cheat?
Reputation: 0
Joined: 02 Oct 2019 Posts: 5
|
Posted: Wed Oct 02, 2019 10:25 pm Post subject: [Bug] AA - jmp requires 'long' if two labels share address? |
|
|
I think I may have run into a bug in the AutoAssembler. Luckily I found a simple workaround that appears to work.
I'm using Cheat Engine 7.0.
If I do something like this:
Code: |
[enable]
aobScanModule( AOB_TestAddr, test.exe, 80 7c 24 20 00 74 1e )
label( patchRet )
alloc( newmem, 4096, "test.exe" )
AOB_TestAddr:
jmp newmem
patchRet:
newmem:
jmp patchRet
|
then, as expected, the bytes at AOB_TestAddr has a 5-byte 'jmp' instruction written to it.
However, if I have multiple labels for the same address and jump to the second label, bad things happen:
Code: |
[enable]
aobScanModule( AOB_TestAddr, test.exe, 80 7c 24 20 00 74 1e )
label( patchRet )
label( patchFuncA )
alloc( newmem, 4096, "test.exe" )
AOB_TestAddr:
jmp patchFuncA
patchRet:
newmem:
patchFuncA:
jmp patchRet
|
Here, I tried to allocate a block of memory, and then label my first function I was writing in this block.
Now, instead of just having a 5-byte jmp instruction (plus whatever nops to match instructions) written to AOB_TestAddr, the jmp instruction is written *and* an additional 9 bytes are written.
In my current test case:
Code: |
Expected: E9 25 13 50 FE 90 90 90
Actual: E9 25 13 50 FE 66 0F 1F 84 00 00 00 00 00 90 90 90
|
Simply adding 'long' to my jump instruction fixes it:
Code: |
[enable]
aobScanModule( AOB_TestAddr, test.exe, 80 7c 24 20 00 74 1e )
label( patchRet )
label( patchFuncA )
alloc( newmem, 4096, "test.exe" )
AOB_TestAddr:
jmp long patchFuncA
patchRet:
newmem:
patchFuncA:
jmp patchRet
|
Not sure what's going on, but it doesn't seem like expected behavior
(side note: 'Spawn Diagram' is awesome! Did that just show up in 7.0? Awesome work!)
|
|