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 


SOLVED: how to utilize a lua variable in a CE table?

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

Joined: 11 Jun 2008
Posts: 290

PostPosted: Thu Apr 02, 2015 12:05 pm    Post subject: SOLVED: how to utilize a lua variable in a CE table? Reply with quote

Hi!
I have this lua script:
Code:

debugProcess()  -- Attach Debugger to the process.
myaddress=getAddress("test.exe")+0x1384
debug_setBreakpoint(myaddress); -- Address where to set breakpoint
function debugger_onBreakpoint()
myvar=EAX
local OnGround_address=EIP
print (OnGround_address);
print (myvar)
debug_removeBreakpoint(myaddress);
return 0;
end

It does work, in fact the lua output let me show the decimal value of EIP in the moment of breakpoint appears,but what i need is that the value of myvar go and fill a CE table so structured:



ScreenHunter_01 Apr. 02 17.38.jpg
 Description:
May you gently help me?
 Filesize:  12.93 KB
 Viewed:  6975 Time(s)

ScreenHunter_01 Apr. 02 17.38.jpg




Last edited by danrevella on Fri Apr 03, 2015 5:49 am; edited 1 time in total
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Thu Apr 02, 2015 12:30 pm    Post subject: Reply with quote

registerSymbol("myvar",addressyouwish)

that will cause an address with myvar as it's address (or part of a calculation like myvar+10) to be updated (within 10 seconds) to the new address

_________________
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
danrevella
Master Cheater
Reputation: 2

Joined: 11 Jun 2008
Posts: 290

PostPosted: Thu Apr 02, 2015 3:17 pm    Post subject: Reply with quote

Please excuse, I was not so clear........ Sad
the lua script in my post (confirmed by the lua window output) give me that the lua variable myvar is setted at the value of the Eax register as it was at the moment of the breakpoint, f.e.
print (myvar) give me (in decimal) an out put of: 7b425ee6

so what i want is a CE table whose address is: 7b425ee6

I have setted a Ce script table with this AA code:
Code:

[ENABLE]
alloc(myvar,4)
registerSymbol(myvar)

[DISABLE]
dealloc(myvar)
unregisterSymbol(myvar)

but here in AA myvar ==000000
I need myvar==7b425ee6 or in other word:
myvar==EAX as my lua script has detected.

Please help me, I am on this trouble by at least 8 days.... Sad

I may not use: registerSymbol("myvar",addressyouwish)
coz I don't know what address put: address is calculated by my Lua script...... I need automatize this task....
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Thu Apr 02, 2015 4:29 pm    Post subject: Reply with quote

in debugger_onBreakpoint call registerSymbol and pass the value of the register to the symbol
_________________
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
danrevella
Master Cheater
Reputation: 2

Joined: 11 Jun 2008
Posts: 290

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

Many thanks!!!
In case someone may need, this is the code of my working table:
Code:

[ENABLE]
{$LUA}
unregisterSymbol("myvar")
debugProcess()  -- Attach Debugger to the process.
myaddress=getAddress("test.exe")+0x1384
debug_setBreakpoint(myaddress); -- Address where to set breakpoint
function debugger_onBreakpoint()
registerSymbol("myvar",EIP)
local OnGround_address=EAX
print (OnGround_address);
debug_removeBreakpoint(myaddress);
return 1;
end

[DISABLE]
{$LUA}
debug_removeBreakpoint(myaddress);
myvar=0
{$asm}
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