diff options
| author | KyleMiles <krm504@nyu.edu> | 2022-01-27 22:43:28 -0500 |
|---|---|---|
| committer | KyleMiles <krm504@nyu.edu> | 2022-01-28 00:24:06 -0500 |
| commit | 6812c973c9fa9b4ad642ab81856c05f87bd6fcc4 (patch) | |
| tree | dace4156d03148bcaf02df138ab4e0d93e61bc6f /python/examples/cli_lift.py | |
| parent | 519c9db22367f2659d1a54599fab47e6313be06e (diff) | |
Format All Files
Diffstat (limited to 'python/examples/cli_lift.py')
| -rwxr-xr-x | python/examples/cli_lift.py | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/python/examples/cli_lift.py b/python/examples/cli_lift.py index b335a5e4..946f8c3a 100755 --- a/python/examples/cli_lift.py +++ b/python/examples/cli_lift.py @@ -34,16 +34,18 @@ from binaryninja import lowlevelil RED = '\x1B[31m' NORMAL = '\x1B[0m' + def traverse_IL(il, indent): if isinstance(il, lowlevelil.LowLevelILInstruction): print('\t'*indent + il.operation.name) for o in il.operands: - traverse_IL(o, indent+1) + traverse_IL(o, indent + 1) else: print('\t'*indent + str(il)) + if __name__ == '__main__': if not sys.argv[2:]: @@ -63,7 +65,7 @@ if __name__ == '__main__': bytesList = sys.argv[2:] # parse byte arguments - data = b''.join(list(map(lambda x: int(x,16).to_bytes(1,'big'), bytesList))) + data = b''.join(list(map(lambda x: int(x, 16).to_bytes(1, 'big'), bytesList))) plat = binaryninja.Platform[platName] bv = binaryview.BinaryView.new(data) @@ -71,13 +73,13 @@ if __name__ == '__main__': bv.add_function(0, plat=plat) -# print('print all the functions, their basic blocks, and their mc instructions') -# for func in bv.functions: -# print(repr(func)) -# for block in func: -# print("\t{0}".format(block)) -# for insn in block: -# print("\t\t{0}".format(insn)) + # print('print all the functions, their basic blocks, and their mc instructions') + # for func in bv.functions: + # print(repr(func)) + # for block in func: + # print("\t{0}".format(block)) + # for insn in block: + # print("\t\t{0}".format(insn)) print(RED) for func in bv.functions: @@ -87,4 +89,3 @@ if __name__ == '__main__': for insn in block: traverse_IL(insn, 0) print(NORMAL) - |
