Page 1 of 1

debug_setBreakpoint with custom named function

Posted: Fri Apr 17, 2020 3:47 pm
by oLaudix
I know you can do breakpoints with lua like this:

Code: Select all

debug_setBreakpoint(0x1412463C3)
but then i have to do

Code: Select all

function debugger_onBreakpoint()
and this only works with 1 active script. I know there is a way to do functions with custom names but i forgot how to do it. Also for some reason this doesnt work:

Code: Select all

debug_setBreakpoint(0x1412463C3, 1, bptExecute, function()
  print(RSI)
  if (RBX ~= 0) then
     return 1
  end
  print(RSI)
  debug_continueFromBreakpoint(co_run)
  return 0
end)

Re: debug_setBreakpoint with custom named function

Posted: Fri Apr 17, 2020 9:18 pm
by TheyCallMeTim13
Check (R)(E)IP (instruction point) for the address of the breakpoint.

Code: Select all

function debugger_onBreakpoint()
  if RIP == 0x1412463C3 then
    -- Do stuff here
  end
  -- end breakpoint code here
end