Example #1
0
def show_directory(filename):
	imports    = pecore.get_import(filename)
	exports    = pecore.get_export(filename)
	resources  = pecore.get_resource(filename)
	debugs     = pecore.get_debug(filename)
	tls        = pecore.get_tls(filename)
	relocation = pecore.get_basereloc(filename)

	dirlist   = []
	
	if imports:
		dirlist.append("Import")
	if exports:
		dirlist.append("Export")
	if resources:
		dirlist.append("Resource")
	if debugs:
		dirlist.append("Debug")
	if tls:
		dirlist.append("TLS")
	if relocation:
		dirlist.append("Relocation")

	directory = ", ".join(dirlist)
	return directory
Example #2
0
def show_import(pe):
	import_load = json.loads(pecore.get_import(pe))
	imported = import_load["Imported Functions"]
	
	if imported:
		nfunc = len(imported)

		dlllist = []
		for dll in imported:
			dlllist.append(dll[0])

		ndll = len(set(dlllist))
		
		print "Imported [" + str(ndll) + "] DLL and [" + str(nfunc) + "] Functions"
		print "-"*60
	
		for item in imported:
			print item[0].ljust(18), item[1], item[2]
Example #3
0
def show_import(pe):
    import_load = json.loads(pecore.get_import(pe))
    imported = import_load["Imported Functions"]

    if imported:
        nfunc = len(imported)

        dlllist = []
        for dll in imported:
            dlllist.append(dll[0])

        ndll = len(set(dlllist))

        print "Imported [" + str(ndll) + "] DLL and [" + str(
            nfunc) + "] Functions"
        print "-" * 60

        for item in imported:
            print item[0].ljust(18), item[1], item[2]
Example #4
0
def show_resource_dump(filename, directory):
	if directory == "import":
		imports = pecore.get_import(filename)
		if imports:
			print "\nDirectory dump for " + directory.upper() + " raw data"
			print "-"*60
			print imports
	if directory == "export":
		exports = pecore.get_export(filename)
		print "\nDirectory dump for " + directory.upper() + " raw data"
		print "-"*60
		print exports
	if directory == "resource":
		resources = pecore.get_resource(filename)
		if resources:
			print "\nDirectory dump for " + directory.upper() + " raw data"
			print "-"*60
			print resources
	if directory == "debug":
		debugs = pecore.get_debug(filename)
		if debugs:
			print "\nDirectory dump for " + directory.upper() + " raw data"
			print "-"*60
			print debugs
	if directory == "tls":
		tlss = pecore.get_tls(filename)
		if tlss:
			print "\nDirectory dump for " + directory.upper() + " raw data"
			print "-"*60
			print tlss
	if directory == "relocation":
		relocations = pecore.get_basereloc(filename)
		if relocations:
			print "\nDirectory dump for " + directory.upper() + " raw data"
			print "-"*60
			print relocations
Example #5
0
def show_resource_dump(filename, directory):
    if directory == "import":
        imports = pecore.get_import(filename)
        if imports:
            print "\nDirectory dump for " + directory.upper() + " raw data"
            print "-" * 60
            print imports
    if directory == "export":
        exports = pecore.get_export(filename)
        print "\nDirectory dump for " + directory.upper() + " raw data"
        print "-" * 60
        print exports
    if directory == "resource":
        resources = pecore.get_resource(filename)
        if resources:
            print "\nDirectory dump for " + directory.upper() + " raw data"
            print "-" * 60
            print resources
    if directory == "debug":
        debugs = pecore.get_debug(filename)
        if debugs:
            print "\nDirectory dump for " + directory.upper() + " raw data"
            print "-" * 60
            print debugs
    if directory == "tls":
        tlss = pecore.get_tls(filename)
        if tlss:
            print "\nDirectory dump for " + directory.upper() + " raw data"
            print "-" * 60
            print tlss
    if directory == "relocation":
        relocations = pecore.get_basereloc(filename)
        if relocations:
            print "\nDirectory dump for " + directory.upper() + " raw data"
            print "-" * 60
            print relocations
Example #6
0
def show_directory(filename):
    imports = pecore.get_import(filename)
    exports = pecore.get_export(filename)
    resources = pecore.get_resource(filename)
    debugs = pecore.get_debug(filename)
    tls = pecore.get_tls(filename)
    relocation = pecore.get_basereloc(filename)

    dirlist = []

    if imports:
        dirlist.append("Import")
    if exports:
        dirlist.append("Export")
    if resources:
        dirlist.append("Resource")
    if debugs:
        dirlist.append("Debug")
    if tls:
        dirlist.append("TLS")
    if relocation:
        dirlist.append("Relocation")

    print "Directory".ljust(18), ", ".join(dirlist)