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 subprocess | |
import binascii | |
import tempfile | |
def dis(s): | |
if not isinstance(s, bytes): | |
s = binascii.unhexlify(s.replace(" ", "").strip()) | |
with tempfile.NamedTemporaryFile("wb") as f: | |
f.write(s) |
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
#!/usr/bin/env python3 | |
import sys | |
import subprocess | |
import tempfile | |
import struct | |
def get_modversions(module): | |
with tempfile.NamedTemporaryFile("rb") as tf: | |
subprocess.check_call(["objcopy", "-O", "binary", "--only-section=__versions", module, tf.name]) |
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 subprocess | |
import sys | |
from packaging.version import Version | |
def main(argv): | |
if len(argv) != 2: | |
print(f"usage: {argv[0]} <elf>") | |
sys.exit(1) |
OlderNewer