|
|
|
|
@ -102,11 +102,25 @@ def register_module(module):
|
|
|
|
|
server.register_function(wrap(function), name)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def decompile(addr):
|
|
|
|
|
"""
|
|
|
|
|
Function that overwrites `idaapi.decompile` for xmlrpc so that instead
|
|
|
|
|
of throwing an exception on `idaapi.DecompilationFailure` it just returns `None`.
|
|
|
|
|
(so that we don't have to parse xmlrpc Fault's exception string on pwndbg side
|
|
|
|
|
as it differs between IDA versions).
|
|
|
|
|
"""
|
|
|
|
|
try:
|
|
|
|
|
return idaapi.decompile(addr)
|
|
|
|
|
except idaapi.DecompilationFailure:
|
|
|
|
|
return None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
server = SimpleXMLRPCServer((host, port), logRequests=True, allow_none=True)
|
|
|
|
|
register_module(idc)
|
|
|
|
|
register_module(idautils)
|
|
|
|
|
register_module(idaapi)
|
|
|
|
|
server.register_function(lambda a: eval(a, globals(), locals()), 'eval')
|
|
|
|
|
server.register_function(decompile) # overwrites idaapi/ida_hexrays.decompie
|
|
|
|
|
server.register_introspection_functions()
|
|
|
|
|
|
|
|
|
|
print('IDA Pro xmlrpc hosted on http://%s:%s' % (host, port))
|
|
|
|
|
|