Skip to content
This repository has been archived by the owner on May 18, 2022. It is now read-only.

Commit

Permalink
suite: add comments for fuzz.py
Browse files Browse the repository at this point in the history
  • Loading branch information
aquynh committed Mar 4, 2014
1 parent 07ceab8 commit 3a61483
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions suite/fuzz.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
def to_hex(s):
return " ".join("0x" + "{0:x}".format(ord(c)).zfill(2) for c in s) # <-- Python 3 is OK


# read @size bytes from @f & return data.
# return None when there is not enough data
def get_code(f, size):
code = f.read(size)
if len(code) != size: # reached end-of-file?
Expand Down Expand Up @@ -93,6 +96,7 @@ def cs_lite(md, code):
while (True):
code = get_code(cfile, i * 4)
if code is None:
# EOF? break
break
#print to_hex(code)
cs(md, code)
Expand All @@ -103,6 +107,7 @@ def cs_lite(md, code):
while (True):
code = get_code(cfile, i * 4)
if code is None:
# EOF? break
break
#print to_hex(code)
cs_lite(md, code)
Expand Down

0 comments on commit 3a61483

Please sign in to comment.