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 


about Check on breakpoints

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
etioplmld
Advanced Cheater
Reputation: 0

Joined: 09 Feb 2021
Posts: 74

PostPosted: Fri Sep 30, 2022 7:13 am    Post subject: about Check on breakpoints Reply with quote

In a known address,this code can print("hello hacking").
Code:

local fl = getMainForm().Foundlist3
debugProcess()  -- Attach Debugger to the process.

function debugger_onBreakpoint()
    debug_continueFromBreakpoint(co_run)
 print("hello hacking")
end

debug_setBreakpoint(fl.Items[0].Caption, 1,bptAccess)


but In this code, the same address is set as selection,the Filter not work?
What's wrong with this code?


Is this wrong?

Code:

function debugger_onBreakpoint()
    debug_continueFromBreakpoint(co_run)
    ckAccess=true
end

---
 elseif (ckAccess == true and maincount>0 ) then



Code:

f = createForm(true)
f.Position=poDesktopCenter
f.Width=500
f.Height=220
f.Caption = 'Process count'


local lb = createLabel(f)
lb.Left=44
lb.Top=30
lb.caption='total number:'..0
lb.Color = 16777215
local font=lb.Font
font.Size = 22
font.Color = 0xff0000

local lb2 = createLabel(f)
lb2.Left=44
lb2.Top=80
lb2.caption='Finish:'..0
lb2.Color = 16777215
local font=lb2.Font
font.Size = 22
font.Color = 0xff0000

local lb3 = createLabel(f)
lb3.Left=44
lb3.Top=120
lb3.caption='address:'..0
lb3.Color = 16777215
local font=lb3.Font
font.Size = 22
font.Color = 0xff0000





local fl = getMainForm().Foundlist3
lb.caption='total number:'..fl.Items.Count

debugProcess()
cdjs = createTimer()


local maincount = fl.Items.Count - 1

function debugger_onBreakpoint()
    debug_continueFromBreakpoint(co_run)
    ckAccess=true
end


local jsct = 3
local i = 0
local ckAccess = false

function countdown()
  lb3.caption=fl.Items[i].Caption

debug_setBreakpoint(fl.Items[i].Caption, 1,bptAccess)

  if ((not ckAccess) and (jsct > 0 and maincount>0 )) then
  lb3.caption = fl.Items[i].Caption..'__'..jsct
  jsct = jsct - 1


  elseif (ckAccess == true and maincount>0 ) then  --here is Filter
    debug_removeBreakpoint(fl.Items[i].Caption)

    i = i + 1
    lb3.caption = fl.Items[i].Caption..'__'..jsct

debug_setBreakpoint(fl.Items[i].Caption, 1,bptAccess)

    jsct = 3
    maincount = maincount - 1

    lb2.caption='Finish:'..i

elseif (jsct == 0 and maincount>0) then
    fl.Items[i].Selected = true                --main work
    debug_removeBreakpoint(fl.Items[i].Caption)

    i = i + 1
    lb3.caption = fl.Items[i].Caption..'__'..jsct
debug_setBreakpoint(fl.Items[i].Caption, 1,bptAccess)
    jsct = 3
    maincount = maincount - 1

    lb2.caption='Finish:'..i

  else
   lb3.caption='end'
   cdjs.destroy()
  end
end
cdjs.interval = 1000
cdjs.OnTimer = countdown

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: Fri Sep 30, 2022 7:43 am    Post subject: Reply with quote

Instead of debug_continueFromBreakpoint in onBreakpoint handlers make it return a value that's not 0.
e.g:
Code:

function debugger_onBreakpoint()
    ckAccess=true
    return 1
end



besides that check your script logic. Add a few prints here and there

_________________
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
etioplmld
Advanced Cheater
Reputation: 0

Joined: 09 Feb 2021
Posts: 74

PostPosted: Sun Oct 16, 2022 3:08 am    Post subject: Reply with quote

Two answers seem to have done it. They said they had succeeded。


https://forum.cheatengine.org/viewtopic.php?t=582154&sid=7b680dccab2c324a00c87f6df3e17398

https://forum.cheatengine.org/viewtopic.php?t=570439&sid=90abfa23bb4d8673daf9c9aff8b065e8
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