示例#1
0
文件: bae.py 项目: ohio813/pypeelf
def GetModuleBaseAddress(moduleName):
    (image_base, image_size) = 0, 0
    procs = running_tasks.get_processes_list()
    
    for p in procs:
        fn = p.get_filename()
        if fn:
            if fn == moduleName:
                try:
                    # There is a little bug when winappdbg looks for the module
                    # in a dict(). Even if the except is reached, the correct ImageBase
                    # is returned by the call to get_image_base().
                    image_base = p.get_image_base()
                    image_size = p.get_image_size()
                except KeyError, e:
                    print "Error in %s:%s" % (os.path.basename(fn), str(e))
                    continue