View previous topic :: View next topic |
Author |
Message |
Nessin Advanced Cheater
Reputation: 1
Joined: 29 Oct 2015 Posts: 69
|
Posted: Fri Apr 07, 2017 12:33 pm Post subject: Simple AoB script won't execute ("Offset too big") |
|
|
edit: Solution is at the bottom
Hello, it's been a while since I did anything with cheat engine, but I just can't figure out why the following (basically just the template) AoB script refuses to execute when I add
Code: | mov [_pointer1],rbx |
See line 13
Code: | [ENABLE]
aobscanmodule(INJECT,FlackDrop.exe,48 8B 83 E0 13 00 00) // should be unique
alloc(newmem,$1000,"FlackDrop.exe"+32CC3D9)
label(code)
label(return)
globalalloc(_pointer1,4)
newmem:
code:
mov [_pointer1],rbx { REMOVING THIS LINE WILL MAKE THE SCRIPT EXECUTE SUCCESSFULLY. What is wrong with it? }
mov rax,[rbx+000013E0]
jmp return
INJECT:
jmp code
nop
nop
return:
registersymbol(INJECT)
[DISABLE]
INJECT:
db 48 8B 83 E0 13 00 00
unregistersymbol(INJECT)
dealloc(newmem)
{
// ORIGINAL CODE - INJECTION POINT: "FlackDrop.exe"+32CC3D9
"FlackDrop.exe"+32CC3D4: 48 85 ED - test rbp,rbp
"FlackDrop.exe"+32CC3D7: 74 1C - je FlackDrop.exe+32CC3F5
// ---------- INJECTING HERE ----------
"FlackDrop.exe"+32CC3D9: 48 8B 83 E0 13 00 00 - mov rax,[rbx+000013E0]
// ---------- DONE INJECTING ----------
"FlackDrop.exe"+32CC3E0: 48 8D 8B E0 13 00 00 - lea rcx,[rbx+000013E0]
} |
Anyone know what's wrong with line 13? I thought it would just store the address rbx inside _pointer1. But the script refuses to execute when that line is there
EDIT: Found a solution ^^
Replace
Code: | mov [_pointer1],rbx |
with
Code: | push rax
mov rax,_pointer1
mov [rax],rbx
pop rax
|
(Explanation : http://forum.cheatengine.org/viewtopic.php?p=5623926#5623926 _________________
Last edited by Nessin on Fri Apr 07, 2017 1:12 pm; edited 6 times in total |
|
Back to top |
|
 |
M-Z Advanced Cheater
Reputation: 1
Joined: 08 Nov 2014 Posts: 77 Location: Poland
|
Posted: Fri Apr 07, 2017 12:38 pm Post subject: |
|
|
Perhaps it's because you alloc only 4 bytes for 64-bit value.
Although it seems too intelligent of the assembler to spot this... |
|
Back to top |
|
 |
Nessin Advanced Cheater
Reputation: 1
Joined: 29 Oct 2015 Posts: 69
|
Posted: Fri Apr 07, 2017 12:46 pm Post subject: |
|
|
Oh right rbx is 64 bits
Sadly it still won't execute when I change it to allocate 8 bytes for _pointer1
Code: | globalalloc(_pointer1,8) |
_________________
|
|
Back to top |
|
 |
M-Z Advanced Cheater
Reputation: 1
Joined: 08 Nov 2014 Posts: 77 Location: Poland
|
Posted: Fri Apr 07, 2017 12:51 pm Post subject: |
|
|
It refuses to execute or it refuses to "save" itself when pressing OK in AA window? |
|
Back to top |
|
 |
Nessin Advanced Cheater
Reputation: 1
Joined: 29 Oct 2015 Posts: 69
|
Posted: Fri Apr 07, 2017 12:54 pm Post subject: |
|
|
Refuses to execute- like checking the checkbox
After trying to manually run the script (by making a new assembly script and copying the old script inside and pressing the 'Execute' button instead of 'Save') I get the following error:
Offset too big
 _________________
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25791 Location: The netherlands
|
Posted: Fri Apr 07, 2017 1:03 pm Post subject: |
|
|
_pointer1 is allocated too far away
try
globalalloc(_pointer1,8,"FlackDrop.exe"+32CC3D9 )
or
alloc(_pointer1,8,"FlackDrop.exe"+32CC3D9)
registersymbol(_pointer)
or in the code and do something like
push rax
mov rax,_pointer1
mov [rax],rbx
pop rax _________________
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 |
|
 |
Nessin Advanced Cheater
Reputation: 1
Joined: 29 Oct 2015 Posts: 69
|
Posted: Fri Apr 07, 2017 1:07 pm Post subject: |
|
|
Dark Byte wrote: | _pointer1 is allocated too far away
try
globalalloc(_pointer1,8,"FlackDrop.exe"+32CC3D9 )
or
alloc(_pointer1,8,"FlackDrop.exe"+32CC3D9)
registersymbol(_pointer)
or in the code and do something like
push rax
mov rax,_pointer1
mov [rax],rbx
pop rax |
Thanks I just finished reading your other post here http://forum.cheatengine.org/viewtopic.php?p=5623926#5623926
That solved my problem  _________________
|
|
Back to top |
|
 |
|