Skip to content

Instantly share code, notes, and snippets.

@geekscrapy
Created August 22, 2018 21:52
Show Gist options
  • Save geekscrapy/427aae1fea7e63658a9ee2ee2189cd7e to your computer and use it in GitHub Desktop.
Save geekscrapy/427aae1fea7e63658a9ee2ee2189cd7e to your computer and use it in GitHub Desktop.
Retrieve language properties from a PE
import lief, os, sys
path = sys.argv[1]
fnames = os.listdir(path)
for f in fnames:
print('****** : {}{}'.format(path, f))
exebin = lief.parse(filepath=path+f)
if exebin.has_resources:
res = exebin.resources
res_manager = exebin.resources_manager
print(res_manager.langs_available, res_manager.sublangs_available)
if res_manager.has_manifest:
print(res_manager.manifest)
if res_manager.has_version:
v = res_manager.version
print(v)
if res_manager.has_icons:
for icon in res_manager.icons:
print((icon.lang), icon.sublang)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment