| View previous topic :: View next topic |
| Author |
Message |
Darcon2k Cheater
Reputation: 0
Joined: 13 Feb 2015 Posts: 48
|
Posted: Fri Apr 03, 2015 1:00 am Post subject: Can't use LUA and Pointers in ASM scripts |
|
|
Hello. I'm trying to add lua and pointers
[XXXXX+XX]+X]+X: to ASM script, but I just can't. CE keep giving me invalid specifier error and I don't have any types. I've checked it 1000 times.
It works for other game, but not for this one. It can be because game is 64 bit? Maybe there is some other options to switch to make it work?
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25806 Location: The netherlands
|
Posted: Fri Apr 03, 2015 3:53 am Post subject: |
|
|
the [] notation currently doesn't work on 64 but. for now you have to use the manual method of reading the base, add offset0, read that address, add offset 1, read that address, add offset2
_________________
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 |
|
 |
Darcon2k Cheater
Reputation: 0
Joined: 13 Feb 2015 Posts: 48
|
Posted: Fri Apr 03, 2015 8:07 am Post subject: |
|
|
| Do you have any examples?
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25806 Location: The netherlands
|
Posted: Fri Apr 03, 2015 8:33 am Post subject: |
|
|
[[[bla.exe+123]+10]+20]+40 =
| Code: |
a=readPointer("bla.exe+123")+0x10
a=readPointer(a)+0x20
a=readPointer(a)+0x40
|
to use it in an AA script:
e.g:
| Code: |
[[[bla.exe+123]+10]+20]+40:
nop
nop
nop
|
you'd do:
| Code: |
{$lua}
local a
a=readPointer("bla.exe+123")+0x10
a=readPointer(a)+0x20
a=readPointer(a)+0x40
return string.format("%x:",a)
{$asm}
nop
nop
nop
|
_________________
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 |
|
 |
mgr.inz.Player I post too much
Reputation: 222
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Fri Apr 03, 2015 9:03 am Post subject: |
|
|
@DB, according to this post (and whole thread):
http://forum.cheatengine.org/viewtopic.php?p=5581139#5581139
Some games can use values bigger than 7FFFFFFF.
And current CE has a bug (already fixed in SVN)
Those: readPointer (for 32bit targets) and readInteger, are broken in CheatEngine version 6.4 and lower.
Above solution should work for 64bit targets. For 32bit targets, it's not reliable.
@Darcon2k
So, don't use this trick for 32bit targets.
_________________
|
|
| Back to top |
|
 |
mgr.inz.Player I post too much
Reputation: 222
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Fri Apr 10, 2015 1:05 pm Post subject: |
|
|
| Darcon2k wrote: | Hello. I'm trying to add lua and pointers
[XXXXX+XX]+X]+X: to ASM script, but I just can't. CE keep giving me invalid specifier error and I don't have any types. I've checked it 1000 times.
It works for other game, but not for this one. It can be because game is 64 bit? Maybe there is some other options to switch to make it work? |
similar thread: http://forum.cheatengine.org/viewtopic.php?t=580782
Could someone test this fix. It fixes the [] notation on 64bit CE attached to 64bit game or other 64bit target.
| Code: | fix64bitPointerString = [[
// only for 64bit CE6.4 from 26 VI 2014
define(address1,cheatengine-x86_64.exe+957AC)
define(bytes1,89 45 C0 EB 2B)
define(address2,cheatengine-x86_64.exe+95944)
define(bytes2,8B 45 C0 48 89 45 A8)
alloc(newmem,64,cheatengine-x86_64.exe)
label(part2)
label(return2)
assert(address1,bytes1)
assert(address2,bytes2)
newmem:
mov [rbp-40],rax
jmp cheatengine-x86_64.exe+957DC
part2:
mov rax,[rbp-40]
mov [rbp-58],rax
jmp return2
address1:
jmp newmem
address2:
jmp part2
nop
nop
return2:
]]
autoAssemble(fix64bitPointerString ,true) |
_________________
|
|
| Back to top |
|
 |
|