def malloc_after(a, b, c): x = lldb.SBCommandReturnObject() x.Clear() rax, rsp = map(functools.partial(get_register, a), ("rax", "rsp")) j.malloc_info(lldb.debugger, rax, x, globals()) clean = x.GetOutput() and x.GetOutput().split('(',2)[1].split(')',2)[0].translate(None,' ') info = "Malloc:[%x] -- %s - %s - %x" % (int(rax,16), clean, quant(clean), read_rsp(a, rsp)) with file(log, "a") as x: print >>x, info cont(a)
def malloc_after(a, b, c): x = lldb.SBCommandReturnObject() x.Clear() rax, rsp = map(functools.partial(get_register, a), ("rax", "rsp")) j.malloc_info(lldb.debugger, rax, x, globals()) clean = x.GetOutput() and x.GetOutput().split('(', 2)[1].split( ')', 2)[0].translate(None, ' ') info = "Malloc:[%x] -- %s - %s - %x" % (int( rax, 16), clean, quant(clean), read_rsp(a, rsp)) with file(log, "a") as x: print >> x, info cont(a)
def free(a, b, c): x = lldb.SBCommandReturnObject() x.Clear() rdi = get_register(a, "rdi") rsp = get_register(a, "rsp") j.malloc_info(lldb.debugger, rdi, x, globals()) out = int(rdi, 16) clean = x.GetOutput() and x.GetOutput().split('(',2)[1].split(')',2)[0].translate(None,' ') qu = quant(clean) info = "Free:::[%x] -- %s - %s - %x" % (out, clean, qu, read_rsp(a,rsp)) with file(log, "a") as x: print >>x, info cont(a)
def free(a, b, c): x = lldb.SBCommandReturnObject() x.Clear() rdi = get_register(a, "rdi") rsp = get_register(a, "rsp") j.malloc_info(lldb.debugger, rdi, x, globals()) out = int(rdi, 16) clean = x.GetOutput() and x.GetOutput().split('(', 2)[1].split( ')', 2)[0].translate(None, ' ') qu = quant(clean) info = "Free:::[%x] -- %s - %s - %x" % (out, clean, qu, read_rsp(a, rsp)) with file(log, "a") as x: print >> x, info cont(a)