예제 #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
예제 #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]
예제 #3
0
파일: stdoutput.py 프로젝트: 4g3n7/peframe
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]
예제 #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
예제 #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
예제 #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)