Files
linux-kernel-module-cheat/disas
Ciro Santilli 六四事件 法轮功 49117d3c1c disas works with the linux kernel, it's beautiful
2020-06-25 07:00:06 +00:00

39 lines
956 B
Python
Executable File

#!/usr/bin/env python3
import os
import lkmc.import_path
import common
from shell_helpers import LF
class Main(common.LkmcCliFunction):
def __init__(self):
super().__init__(
defaults = {
'show_time': False,
},
description='''\
Disassemble one function of the given executable.
https://cirosantilli.com/linux-kernel-module-cheat#run-toolchain
''',
)
self.add_argument('function', default='main', help='Which function to disassemble.')
def timed_main(self):
lkmc.import_path.import_path_main('run-toolchain')(
tool='gdb',
extra_args=[
'-nh',
'-batch',
'-ex',
'disas/rs {}'.format(self.env['function']),
self.env['image_elf'],
],
quiet=True,
**self.get_common_args()
)
if __name__ == '__main__':
Main().cli()