Skip to content

Commit

Permalink
fixed issue #22
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Jan 29, 2022
1 parent b7ccad9 commit a541336
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions zeratool/formatExploiter.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ def exploitFormat(binary_name, properties):
log.info("[+] Found stack location at {}".format(stack_position))
break

if stack_position == -1:
log.info("Could not find stack position")
return None

if len(properties["win_functions"]) > 0:
for func in properties["win_functions"]:
address = properties["win_functions"][func]["fcn_addr"]
Expand Down
4 changes: 2 additions & 2 deletions zeratool/overflowDetector.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def run(self):

p = angr.Project(binary_name, load_options={"auto_load_libs": False})
# Hook rands
p.hook_symbol("rand", hookFour)
p.hook_symbol("srand", hookFour)
p.hook_symbol("rand", hookFour())
p.hook_symbol("srand", hookFour())
# p.hook_symbol('fgets',angr.SIM_PROCEDURES['libc']['gets']())

# Setup state based on input type
Expand Down
2 changes: 1 addition & 1 deletion zeratool/radare_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def getRegValues(filename, endAddr=None):
# drj command is broken in r2 right now
# so use drrj
regs = json.loads(r2.cmd("drrj"))
regs = dict([(x["reg"], int(x["value"], 16)) for x in regs])
regs = dict([(x["reg"], int(x["value"], 16)) for x in regs if x["reg"] != "rflags"])
r2.quit()
return regs

Expand Down

0 comments on commit a541336

Please sign in to comment.