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 


Doing an AOBScan inside debugger_onBreakpoint() freezes CE

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
inka7
How do I cheat?
Reputation: 0

Joined: 29 Jun 2015
Posts: 3

PostPosted: Mon Jun 29, 2015 4:51 am    Post subject: Doing an AOBScan inside debugger_onBreakpoint() freezes CE Reply with quote

I am having trouble with CE and target freezing/crashing when calling an AOBSCAN from within a breakpoint. The Breakpoint works fine for simple stuff like a messagebox but when i try to do an AOBscan from inside debugger_onBreakpoint() it freezes and i have to end process.

The AOBscan works fine when its not part of a breakpoint - for example when inside a hotkey, it works.

What is it i am doing wrong and how can i make AOBscan work when called from within a breakpoint?

thanks very much

Code:
 // *****
THIS WORKS, ON BREAKING, A MESSAGEBOX POPS UP
function debugger_onBreakpoint()
showMessage("changeMe")
         return 1 -- let CE know we handled breakpoint, no need to update debugger form
end
debugProcess()
debug_setBreakpoint(0x84902a6)


Code:
 // *****THIS DOES NOT WORK, ON BREAKING, TARGET + CE FREEZES
function debugger_onBreakpoint()
MyScan=AOBScan("30 2d 30 30")
         return 1
end
debugProcess()
debug_setBreakpoint(0x84902a6)
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Mon Jun 29, 2015 5:48 am    Post subject: Reply with quote

looks like a bug in freeing the scancontroller of the memscan class. (It's an fpc/lcl issue. The debuggerthread has done a synchronize which locks the sync queue, and destroying the scancontroller adds a item to the sync queue, but since it's in a different thread it'll wait till the lock is released, but the lock won't get released till the controller is destroyed... so yeah...)

instead of AOBScan you can use the MemScan class instead. Create it globaly and just don't free the memscan object inside the debugger_onBreakpoint() function

_________________
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
inka7
How do I cheat?
Reputation: 0

Joined: 29 Jun 2015
Posts: 3

PostPosted: Mon Jun 29, 2015 6:21 am    Post subject: Reply with quote

edit see new reply

Last edited by inka7 on Mon Jun 29, 2015 8:16 am; edited 1 time in total
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

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

PostPosted: Mon Jun 29, 2015 7:17 am    Post subject: Reply with quote

Code:
function DEC_HEX(IN)
    local B,K,OUT,I,D=16,"0123456789ABCDEF","",0
   if IN<1 then
      OUT=0
      return OUT
   end
    while IN>0 do
        I=I+1
        IN,D=math.floor(IN/B),math.mod(IN,B)+1
        OUT=string.sub(K,D,D)..OUT
    end
    return OUT
end

This piece of code is copy pasted over and over again.


Why not just this:
Code:
function dec2hex(n)
  return string.format('%X',n)
end



Or if we want more feedback:
Code:
function dec2hex(n)
  if n==nil               then return 'error - a nil value'
  elseif tonumber(n)==nil then return 'error - not a decimal number' end

  return string.format('%X',n)
end

_________________
Back to top
View user's profile Send private message MSN Messenger
inka7
How do I cheat?
Reputation: 0

Joined: 29 Jun 2015
Posts: 3

PostPosted: Mon Jun 29, 2015 8:51 am    Post subject: Reply with quote

i would like to thank admin.
code works with memscan created globally thanks very much
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Mon Jun 29, 2015 10:17 am    Post subject: Reply with quote

I trust you donated those $$$ to the site. 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