Created
December 5, 2017 11:29
-
-
Save fvrmatteo/1c3775f1ad3ac8d86f708d44509b3481 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import lief | |
if __name__ == "__main__": | |
library = lief.parse("libjiagu.so") | |
print "[+] ELF Header" | |
print library.header | |
print "[+] Initialization and Termination Routines" | |
INIT_ENTRIES = [ | |
lief.ELF.DYNAMIC_TAGS.INIT, lief.ELF.DYNAMIC_TAGS.INIT_ARRAY, lief.ELF.DYNAMIC_TAGS.INIT_ARRAYSZ, # .init_array | |
lief.ELF.DYNAMIC_TAGS.PREINIT_ARRAY, lief.ELF.DYNAMIC_TAGS.PREINIT_ARRAYSZ, # .preinit_array | |
lief.ELF.DYNAMIC_TAGS.FINI, lief.ELF.DYNAMIC_TAGS.FINI_ARRAY, lief.ELF.DYNAMIC_TAGS.FINI_ARRAYSZ # .fini_array | |
] | |
for entry in library.dynamic_entries: | |
if entry.tag in INIT_ENTRIES: | |
print entry |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment