Last active
November 24, 2018 22:10
-
-
Save blacktop/0ca84b26c03ceaa5b7e5c395fc40bf81 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
from macho import MachO | |
m = MachO.from_file('kernelcache.release.iphone11.decompressed') | |
print('CPU: {}, Subtype: {}'.format(m.header.cputype.name.upper(), m.header.cpusubtype)) | |
print('Build Version: {}'.format(m.load_commands[22].body)) | |
print('Source Version: {}'.format(m.load_commands[23].body)) | |
for lc in m.load_commands: | |
if hasattr(lc.type, 'segment_64'): | |
if hasattr(lc.body, 'sections'): | |
for sec in lc.body.sections: | |
print('{}.{}'.format(sec.seg_name, sec.sect_name)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment