コード例 #1
0
ファイル: peframe.py プロジェクト: PROJECT-ARES/peframe
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
コード例 #2
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
コード例 #3
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
コード例 #4
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)