x64dbgpy icon indicating copy to clipboard operation
x64dbgpy copied to clipboard

pluginsdk.debug.StepOver(), pluginsdk.debug.Run() seem not to work in Open GUI or Open Async script

Open robertsi opened this issue 3 years ago • 3 comments

This works until I call pluginsdk.debug.StepOver() or pluginsdk.debug.Run in bp_callback. Everything just hangs or is not responding anymore. If I run these two commands from x64dbg GUI everything works as expected. Tried to execute as GUI and async script, seems there is no difference, am I missing something here?

`import threading bpAddress = 0x00007FF6EFB1F4D0

def bp_callback(): print("tid={num:d} 0x{num:X}".format(num=threading.currentThread().ident)) global bpAddress pluginsdk.bridgemain.GuiLogClear() print("rcx={num:d} 0x{num:X}".format(num=Register.RCX)) print("rdx={num:d} 0x{num:X}".format(num=Register.RDX))

#Breakpoint.remove(bpAddress)
#pluginsdk.debug.Run()
#pluginsdk.debug.Wait()
#pluginsdk.debug.Stop()
#pluginsdk.debug.StepIn()
#pluginsdk.debug.StepOut()
#pluginsdk.debug.StepOver()

Breakpoint.add(bpAddress, bp_callback)`

robertsi avatar Mar 21 '21 16:03 robertsi

Was suspecting that its thread related coz its not on the same thread, I have a workaround atm by calling pluginsdk.x64dbg.DbgCmdExec("run")

robertsi avatar Mar 21 '21 20:03 robertsi

Thank you so much! I ran into the same problem, but it seems that I can only run the pluginsdk.x64dbg.DbgCmdExecDirect('run') command to solve the current dilemma.

manfeel avatar Aug 19 '21 14:08 manfeel

Only visible simple solution this. Dont use any callbacks on breakpoints, but save info about address with breakpoints into python dictionary. Something like callbacks emulation.

For continue execution run: pluginsdk.debug.Run() After debugger stop on breakpoint, check ip and saved info for address and run own code related to it. For continue execution run again pluginsdk.debug.Run()

4144 avatar Aug 19 '21 15:08 4144