Skip to content

Commit

Permalink
Merge branch 'dev-objdump-output'. Close #203.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanperez-keera committed Dec 5, 2023
2 parents 4125707 + 439dc29 commit 03293b7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion analyzer/python/ikos/scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,14 @@ def extract_bitcode(exe_path, bc_path):
output = check_output(cmd)
section_content = b''

for line in itertools.islice(output.splitlines(), 4, None):
# The output of llvm-objdump is prefixed by three lines: an empty one, one
# that specifies the format, and one that describes what comes next (the
# contents of the section requested). After that, lines have an address,
# the hex representation (36 characters plus spaces), and the ASCII
# representation, with some spaces in between sections or columns. The
# following obtains only the hex code, ignoring the ASCII and the
# addresses.
for line in itertools.islice(output.splitlines(), 3, None):
n = line.find(b' ', 1)
line = line[n + 1:n + 36]
for item in line.split(b' '):
Expand Down

0 comments on commit 03293b7

Please sign in to comment.