#!/usr/bin/env python """ Dump function names from the loaded PE Rhys Kidd (c) 2007 """ import immlib DESC = """List the functions of a chosen module""" def main(args): imm = immlib.Debugger() targetmod = imm.getDebuggedName() table=imm.createTable('%s Function Table'%(targetmod),['Address','Name']) func_list = imm.getAllFunctions(imm.getModule(targetmod).getBase()) for f in func_list: function=imm.getFunction(f) imm.Log(function.getName(), address = function.getStart()) table.add(function.getStart(),['0x%08x'%(function.getStart()), function.getName()]) return "%i functions found." % len(func_list)