print "MAL ADDRESS: " + hex(l) #BUT ITS NOT NEEDED WITH SYMBOLS dbg.add_breakpoint("malloc@PLT", PERSISTENT, mal_break) print "RESUMING TASK" dbg.resume() while(1): continue if __name__ == "__main__": argv = sys.argv cmd = "./test_prog.app" dbg = MacDbg() pid = int(argv[1]) dbg.attach(pid, 1) if dbg.task == 0: print "Failed to attach Check PID" exit(0) dbg.load_symbols() pid = dbg.pid print "[+] Attached to task # %s\n" % str(dbg.task) debugger(dbg, pid, dbg.task, 1)
print dbg.hex_dump(x, 10) l = struct.unpack("<q", dbg.read_memory(x, 8))[0] print "MAL ADDRESS: " + hex(l) #BUT ITS NOT NEEDED WITH SYMBOLS dbg.add_breakpoint("malloc@PLT", PERSISTENT, mal_break) print "RESUMING TASK" dbg.resume() while (1): continue if __name__ == "__main__": argv = sys.argv cmd = "./test_prog.app" dbg = MacDbg() pid = int(argv[1]) dbg.attach(pid, 1) if dbg.task == 0: print "Failed to attach Check PID" exit(0) dbg.load_symbols() pid = dbg.pid print "[+] Attached to task # %s\n" % str(dbg.task) debugger(dbg, pid, dbg.task, 1)