Esempio n. 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
Esempio n. 2
0
def show_export(pe):
    export_load = json.loads(pecore.get_export(pe))
    exported = export_load["Exported Functions"]

    if exported:
        nfunc = len(exported)

        print "Exported [" + str(nfunc) + "] Functions"
        print "-" * 60

        for item in exported:
            print item[0].ljust(18), item[1]
Esempio n. 3
0
def show_export(pe):
	export_load = json.loads(pecore.get_export(pe))
	exported = export_load["Exported Functions"]
	
	if exported:
		nfunc = len(exported)

		print "Exported [" + str(nfunc) + "] Functions"
		print "-"*60
	
		for item in exported:
			print item[0].ljust(18), item[1]
Esempio n. 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
Esempio n. 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
Esempio n. 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)