idc.py: added SendDbgCommand()

This commit is contained in:
elias.bachaalany 2010-05-05 13:05:53 +00:00
parent f09375cf70
commit ff7ab3f1dc

View File

@ -6659,8 +6659,18 @@ def GetDebuggerEvent(wfne, timeout):
return idaapi.wait_for_next_event(wfne, timeout) return idaapi.wait_for_next_event(wfne, timeout)
def ResumeProcess(): return GetDebuggerEvent(WFNE_CONT|WFNE_NOWAIT, 0) def ResumeProcess():
return GetDebuggerEvent(WFNE_CONT|WFNE_NOWAIT, 0)
def SendDbgCommand(cmd):
"""Sends a command to the debugger module and returns the output string.
An exception will be raised if the debugger is not running or the current debugger does not export
the 'SendDbgCommand' IDC command.
"""
s = Eval('SendDbgCommand("%s");' % cmd)
if s.startswith("IDC_FAILURE"):
raise Exception, "Debugger command is available only when the debugger is active!"
return s
# wfne flag is combination of the following: # wfne flag is combination of the following:
WFNE_ANY = 0x0001 # return the first event (even if it doesn't suspend the process) WFNE_ANY = 0x0001 # return the first event (even if it doesn't suspend the process)