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 


Debugger thread doesn't run

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

Joined: 04 Jul 2015
Posts: 105

PostPosted: Sat Oct 24, 2015 8:52 am    Post subject: Debugger thread doesn't run Reply with quote

Hi, I'm not fluent in Lua at all, so I've been sitting for around 6 hours trying to fix my code.

What it's supposed to do?

Once I start my game, I'll freeze the process while it's loading in, then I'll execute the code, two addresses should have their registers changed from DBVM, this is all working fine, it changes the registers and all that but... Once I unpause the game, the breakpoints doesn't run, the breakpoint stays while the registers are changed so I have to press F9(run the thread) once I've runned the thread, the registers have been changed completely fine, it's all working. I just don't want to have to run the thread everytime, I just want it to stay as a breakpoint as a register changing code. But it just breakpoints it too WHILE the registers are changed, hard to explain. I hope you understand though! Note: If you're not familiar with debuggers and stuff in Cheat Engine, you can't just make a basic code to change the register of two addresses, that will crash the game, the breakpoints needs to have it's different function for each thread, not sure if that's how you explain it but yeah, like that. So I do know this code works perfectly fine as I've used it a lot now, just really strange how it doesn't run the breakpoints. If you have time please edit the code into it doing what I wanted it to do, I'd appreciate it a lot! You have no idea how stressful those 6 hours have been while I've been trying to fix it. A lot of anger here and there, many errors.

Code:

test1 = 0xCENCORED1; register1 = 0x00000000;
test2 = 0xCENCORED2; register2 = 0x00000000;

debug_setBreakpoint(test1)

debug_setBreakpoint(test2)

function debugger_onBreakpoint()
if EIP == test1 then
ECX=register1;
else if EIP == test2 then
EIP=register2;
end
debug_continueFromBreakpoint(co_run)
return 1
end
end

Thanks!
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Sat Oct 24, 2015 8:58 am    Post subject: Reply with quote

The correct statement is elseif, with no spaces.
That is why you were required to add that extra end statement.
So in your code, you are not executing debug_continueFromBreakpoint(co_run), nor return 1 when EIP == test1.
Remove the space between else if and remove the extra end, and it should be working correctly.

By the way, are you sure you require a debug?
You don't appear to be doing anything fancy that two regular injections couldn't handle.
Back to top
View user's profile Send private message
Stacktrace
Expert Cheater
Reputation: 1

Joined: 04 Jul 2015
Posts: 105

PostPosted: Sat Oct 24, 2015 9:01 am    Post subject: Reply with quote

Zanzer wrote:
The correct statement is elseif, with no spaces.
That is why you were required to add that extra end statement.
So in your code, you are not executing debug_continueFromBreakpoint(co_run), nor return 1 when EIP == test1.
Remove the space between else if and remove the extra end, and it should be working correctly.

By the way, are you sure you require a debug?
You don't appear to be doing anything fancy that two regular injections couldn't handle.


Thank you! Works fine now.
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