 |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
Redouane Master Cheater
Reputation: 3
Joined: 05 Sep 2013 Posts: 363 Location: Algeria
|
Posted: Tue Dec 23, 2014 8:17 am Post subject: Readmem with a symbol? |
|
|
Hi,while making an AOB script for a flash game (that works for different versions,uses aobscans and readmem),I got an error with readmem,I am able to reproduce it in this simple example:
Code: |
alloc(m,1024)
label(zone)
registersymbol(zone)
m+8:
zone:
db 04 ef 40 87 ad 0c
m:
readmem(zone,6) // Error
|
while this works just fine:
Code: |
alloc(m,1024)
label(zone)
registersymbol(zone)
m+8:
zone:
db 04 ef 40 87 ad 0c
m:
db 90 90 90 90 90 90 90 90 // Writing bytes normally
|
So,the address of readmem cannot be a userdefined symbol?Do I have to use {$lua} to return Code: | 'readmem('..getAddress'zone'..',6)' |
[Edit] The error only happends when the symbol isn't defined when the execute button is clicked,even if the 'registersymbol' statement is in the script.
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25788 Location: The netherlands
|
Posted: Tue Dec 23, 2014 8:51 am Post subject: |
|
|
readmem(zone,6) gets renamed into "db xx xx xx xx xx xx" where xx are the bytes it reads before the script gets executed
because zone does not exist at the time readmem is handled it fails (allocs are handled after everything else has been done, so readmem is handled before m is allocated)
Also, even if it did work, that readmem(zone,6) command would be equivalent to db 00 00 00 00 00 00 as the readmem instruction gets handled before the assembler code is written.
AOBscan's are handled before readmem, so if you give it the symbol of an AOBscan result, that will work
_________________
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 |
|
 |
Redouane Master Cheater
Reputation: 3
Joined: 05 Sep 2013 Posts: 363 Location: Algeria
|
Posted: Tue Dec 23, 2014 9:24 am Post subject: |
|
|
Dark Byte wrote: | readmem(zone,6) gets renamed into "db xx xx xx xx xx xx" where xx are the bytes it reads before the script gets executed
because zone does not exist at the time readmem is handled it fails (allocs are handled after everything else has been done, so readmem is handled before m is allocated)
Also, even if it did work, that readmem(zone,6) command would be equivalent to db 00 00 00 00 00 00 as the readmem instruction gets handled before the assembler code is written.
AOBscan's are handled before readmem, so if you give it the symbol of an AOBscan result, that will work |
Thanks,the symbol of 'readmem' in my script isn't really the result of an aobscan,it's a label that is at (aobscanresult + offset),here is a part of my code:
Code: |
label(m)
aobscan(c,xx xx xx xx...)
label(_g)
label(init)
registersymbol(_g)
registersymbol(init)
c + 23:
_g:
c + 3b:
init:
M + 42: // M is another AOBScan result
m:
readmem(_g,7)
readmem(init,7)
db 02 02 02 02
|
[EDIT] I solved the problem,not sure if there is a simplier way to do it,used {$lua} and a timer,from the onTimer,did an autoAssemble with the code that uses readmem.
|
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|