Created
January 3, 2018 15:08
-
-
Save itdaniher/6a28da2edb51587ca41102b8d2c9ecbb to your computer and use it in GitHub Desktop.
archid via elftools
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
try: | |
from elftools.elf.elffile import ELFFile | |
except: | |
ELFFile = None | |
if ELFFile is not None: | |
import sys | |
elf_file=open(sys.argv[1], 'rb') | |
machine = ELFFile(elf_file).get_machine_arch().lower() | |
print(machine) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment