Skip to content

Commit

Permalink
Remove broad excepts in gadget analyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
twizmwazin committed Aug 21, 2024
1 parent 09b23a0 commit 1ddd8ab
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions angrop/gadget_finder/gadget_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,6 @@ def analyze_gadget(self, addr):
except (claripy.ClaripyFrontendError, angr.engines.vex.claripy.ccall.CCallMultivaluedException) as e:
l.warning("... claripy error: %s", e)
return None
except Exception as e:# pylint:disable=broad-except
l.exception(e)
return None

l.debug("... Appending gadget!")
return gadget
Expand Down Expand Up @@ -222,12 +219,11 @@ def _reach_unconstrained_or_syscall(self, addr):

if self.is_in_kernel(final_state):
state = final_state.copy()
try:
succ = self.project.factory.successors(state)
state = succ.flat_successors[0]
state2 = rop_utils.step_to_unconstrained_successor(self.project, state=state)
except Exception: # pylint: disable=broad-exception-caught
succ = self.project.factory.successors(state)
if len(succ.flat_successors) == 0:
return init_state, final_state
state = succ.flat_successors[0]
state2 = rop_utils.step_to_unconstrained_successor(self.project, state=state)
return init_state, state2
return init_state, final_state

Expand Down

0 comments on commit 1ddd8ab

Please sign in to comment.