Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify Exception #14

Merged
merged 2 commits into from
Jun 8, 2017
Merged

Clarify Exception #14

merged 2 commits into from
Jun 8, 2017

Conversation

Manouchehri
Copy link
Contributor

Fixes a confusing situation where running find_gadgets() will say you forgot to run find_gadgets().

In [1]: rop = proj.analyses.ROP(only_check_near_rets=False, fast_mode=False, max_block_size=0x10000)
INFO    | 2017-05-02 00:41:57,037 | angrop.rop | There are 0 addresses withing 65536 bytes of a ret

In [2]: rop.find_gadgets(show_progress=False)
---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
/mipswork/goon.py in <module>()
----> 1 rop.find_gadgets(show_progress=False)

/home/angr/angr-dev/angrop/angrop/rop.pyc in find_gadgets(self, processes, show_progress)
    144                 self._duplicates.append(dups)
    145         self.gadgets = sorted(self.gadgets, key=lambda x: x.addr)
--> 146         self._reload_chain_funcs()
    147
    148     def find_gadgets_single_threaded(self):

/home/angr/angr-dev/angrop/angrop/rop.pyc in _reload_chain_funcs(self)
    235
    236     def _reload_chain_funcs(self):
--> 237         for f_name, f in inspect.getmembers(self.chain_builder, predicate=inspect.ismethod):
    238             if f_name.startswith("_"):
    239                 continue

/home/angr/angr-dev/angrop/angrop/rop.pyc in chain_builder(self)
    250             return self._chain_builder
    251         else:
--> 252             raise Exception("No gadgets, call find_gadgets() or load_gadgets() first")
    253
    254     def _block_has_ip_relative(self, addr, bl):

Exception: No gadgets, call find_gadgets() or load_gadgets() first

@salls salls merged commit a2505c5 into angr:master Jun 8, 2017
@salls
Copy link
Member

salls commented Jun 8, 2017

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants