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 


Reading the address of a userdefined symbol

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Redouane
Master Cheater
Reputation: 3

Joined: 05 Sep 2013
Posts: 363
Location: Algeria

PostPosted: Sat Nov 30, 2013 8:38 am    Post subject: Reading the address of a userdefined symbol Reply with quote

Hi,I've made a cheat table for a game,but I'm having troubles with some code.
The code at the address "Venice Deluxe_2.exe"+1ABBC accesses a powerup boolean (stored in [eax+154]),0 means false and 1 means true,this code activates the powerup,when activated,It writes 1 to that address,but in the disable section,the lua script doesn't work(I'm using a lua script because after activating the cheat,you can't disable it before finishing the round):
Code:
[enable]
alloc(newmem,2048)
alloc(storage,8)
label(store)
registersymbol(store)
label(returnhere)
storage:
store:
newmem:
mov [eax+154],1
push esi
lea esi,[eax+154]
mov [store],esi
pop esi
cmp dword ptr [eax+00000154],00
jmp returnhere
"Venice Deluxe_2.exe"+1ABBC:
jmp newmem
db 90 90
returnhere:
[disable]
luacall(a=readAddress(store) ; b=readInteger(a) ; writeInteger(b,0))
dealloc(newmem)
dealloc(storage)
"Venice Deluxe_2.exe"+1ABBC:
cmp dword ptr [eax+00000154],00
unregistersymbol(store)

So what should i use instead of readAddress() to read the address of a userdefined symbol?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Sat Nov 30, 2013 8:57 am    Post subject: Reply with quote

symbolnames are strings, and you should use getAddress (or directly use readInteger)
so:
getAddress("store")

or
readInteger("store")

e.g:
luacall(writeInteger(readInteger("store"),0))

_________________
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
Redouane
Master Cheater
Reputation: 3

Joined: 05 Sep 2013
Posts: 363
Location: Algeria

PostPosted: Sun Dec 01, 2013 5:39 am    Post subject: Reply with quote

Dark Byte wrote:
symbolnames are strings, and you should use getAddress (or directly use readInteger)
so:
getAddress("store")

or
readInteger("store")

e.g:
luacall(writeInteger(readInteger("store"),0))


Many thanks Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting 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