Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Can't use LUA and Pointers in ASM scripts

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
Darcon2k
Cheater
Reputation: 0

Joined: 13 Feb 2015
Posts: 48

PostPosted: Fri Apr 03, 2015 1:00 am    Post subject: Can't use LUA and Pointers in ASM scripts Reply with quote

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
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25806
Location: The netherlands

PostPosted: Fri Apr 03, 2015 3:53 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Darcon2k
Cheater
Reputation: 0

Joined: 13 Feb 2015
Posts: 48

PostPosted: Fri Apr 03, 2015 8:07 am    Post subject: Reply with quote

Do you have any examples?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25806
Location: The netherlands

PostPosted: Fri Apr 03, 2015 8:33 am    Post subject: Reply with quote

[[[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
View user's profile Send private message MSN Messenger
mgr.inz.Player
I post too much
Reputation: 222

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Fri Apr 03, 2015 9:03 am    Post subject: Reply with quote

@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
View user's profile Send private message MSN Messenger
mgr.inz.Player
I post too much
Reputation: 222

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Fri Apr 10, 2015 1:05 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites