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 


Hmm, I'm clueless on how to do this in Lua

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Stacktrace
Expert Cheater
Reputation: 1

Joined: 04 Jul 2015
Posts: 105

PostPosted: Wed Jul 06, 2016 3:07 am    Post subject: Hmm, I'm clueless on how to do this in Lua Reply with quote

I'm trying to write a debugger code that changes the register of two addresses. This game uses ASLR so I'm unable to use the address itself only. I need to use the module addresses (Game.exe+153FA but I'm not sure how to do this in Lua.

Could you by any chance write a script for me that does this? I've noticed that if I normally change the register of two addresses It'll only trigger for one and cause a crash so I need to lablel and registersymbol them or do something like this

Adr1 = 0xblabla; Reg1 = 5
Addr2 = 0xblabla; Reg2 = 9

Debugger code here that changes two registers of two module addresses
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Wed Jul 06, 2016 7:15 pm    Post subject: Reply with quote

Code:
debug_setBreakpoint(address1, 1, bptExecute, function()
  EAX = 5
end)

debug_setBreakpoint(address2, 1, bptExecute, function()
  EAX = 9
end)
Back to top
View user's profile Send private message
Stacktrace
Expert Cheater
Reputation: 1

Joined: 04 Jul 2015
Posts: 105

PostPosted: Fri Jul 08, 2016 1:23 am    Post subject: Reply with quote

Zanzer wrote:
Code:
debug_setBreakpoint(address1, 1, bptExecute, function()
  EAX = 5
end)

debug_setBreakpoint(address2, 1, bptExecute, function()
  EAX = 9
end)


Now that's a better looking register changing code than the ones I've dealt with.

Thanks, there's an issue though.

debug_setBreakpoint("Game.exe+3FB3DB", 1, bptExecute, function() --THIS LINE WORKED FINE BY THE WAY
EIP = "Game.exe+3FB3DE" --I can only set the registers to numbers, not the addresses itself.
end)

read the comments I added next to the lines.

because I need to have addresses into the EIP register to jump over some addresses.
Back to top
View user's profile Send private message
cooleko
Grandmaster Cheater
Reputation: 11

Joined: 04 May 2016
Posts: 717

PostPosted: Fri Jul 08, 2016 3:11 am    Post subject: Reply with quote

an address IS just a number...

tonumber("0x" .. EIPaddr)
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Fri Jul 08, 2016 6:13 am    Post subject: This post has 1 review(s) Reply with quote

Code:
EIP = getAddress("Game.exe+3FB3DE")
Back to top
View user's profile Send private message
Stacktrace
Expert Cheater
Reputation: 1

Joined: 04 Jul 2015
Posts: 105

PostPosted: Sat Jul 09, 2016 4:13 am    Post subject: Reply with quote

Zanzer wrote:
Code:
EIP = getAddress("Game.exe+3FB3DE")


You're a life saver, thank you so much. I'll try and give you you an reputation.
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 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