Esempio n. 1
0
def base_addr(dbg, name):

    if dbg.base_address == 0x100000000:
        print dbg.color_red("BASE ADDRESS == LOAD ADDRESS :( -- PID - " + str(dbg.pid)), dbg.color_green(" -  NAME " + name)

    dbg.detach()

if __name__ == "__main__":

    tmp = MacDbg()

    process = Popen(["ps", "aux"], stdout=PIPE)
    (output, err) = process.communicate()
    pids = output.split("\n")
    for i in pids:
        x = i.split()
        
        try:
            pid = x[1]
            name = x[10]
            name = name[name.find("/")+1:]
            tmp.attach(int(pid), 1)
        except:
            continue
        
        if tmp.task == 0:
            tmp.color_red("BAD PID CONTINUING")
            continue
        base_addr(tmp, name)

Esempio n. 2
0
    if len(search_results) > 0:
        for i in search_results:
            print dbg.color_green(hex(i)) + " --> " + dbg.color_pink(dbg.read_memory(i, 40))
        dbg.detach()
        return 1
    else:
        dbg.detach()
        return 0

if __name__ == "__main__":

    print "Usage ./search_multiple.py [search]"
    search = sys.argv[1]
    tmp = MacDbg()

    pids = file("pid").readlines()
    debuggers = []
    print tmp.color_red("Searching for string: " + search)
    count = 0
    for i in pids:
        print tmp.color_green("ATTACHING TO: " + str(int(i)))
        tmp.attach(int(i), 1)
        if tmp.task == 0:
            raw_input("????")
            tmp.color_red("BAD PID EXITING")
        x = search_mem(tmp, search)
        if x == 1:
            print tmp.color_pink("FOUND PROG PID = " + str(i))