cle
cle copied to clipboard
CLE doesn't have a r2 backend
cle should have a backend similar to idalink but using radare2, as all of the information provided from ida is available through radare2.
I think it'd be awesome, but unfortunately manpower is limited. We'd love a pull request on this :-)
@crowell Ancient thread bump, still interested in this? Came to say the same thing.
@Manouchehri i've almost finished an implementation. check back in a day or two.
That sounds great, looking forward to trying it out! =D
Hey @crowell, could you make sure that the r2 integration doesn't mask SIGINT? In the early days of angr, we used both r2 and IDA to load binaries, and the SIGINT trap really screwed us up...
Does angr send sigint to people?
I can see about not catching the signal On May 18, 2016 4:48 PM, "Yan" [email protected] wrote:
Hey @crowell https://github.com/crowell, could you make sure that the r2 integration doesn't mask SIGINT? In the early days of angr, we used both r2 and IDA to load binaries, and the SIGINT trap really screwed us up...
— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/angr/cle/issues/1#issuecomment-220153089
No, python uses sigint to interrupt operations. The expectation is that whenever ^C happens, a KeyboardInterrupt exception is raised in the python interpreter, propagating all the way up to the user.
It's very disorienting when you press ^C in a python process and nothing happens.
angr tends to be used from within iPython, and the ability to Ctrl-C analyses is pretty critical. If r2 grabs the interrupt and squashes it, the KeyboardInterrupt won't be thrown in Python and we can't interrupt anything.
(jinks @rhelmot!)
It probably makes sense to disable the catching of sigint from all r2pipe usage tbh as well On May 18, 2016 4:59 PM, "Yan" [email protected] wrote:
angr tends to be used from within iPython, and the ability to Ctrl-C analyses is pretty critical. If r2 grabs the interrupt and squashes it, the KeyboardInterrupt won't be thrown in Python and we can't interrupt anything.
— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/angr/cle/issues/1#issuecomment-220156060
In [2]: import r2pipe
In [3]: s = r2pipe.open('/bin/ls')
In [4]: s.cmd('aaa')
^C---------------------------------------------------------------------------
KeyboardInterrupt Traceback (most recent call last)
<ipython-input-4-05dfe4795bad> in <module>()
----> 1 s.cmd('aaa')
/home/jeff/cle/lib/python2.7/site-packages/r2pipe/__init__.pyc in cmd(self, cmd)
213 Returns an string with the results of the command
214 """
--> 215 return self._cmd(cmd)
216
217 def cmdj(self, cmd):
/home/jeff/cle/lib/python2.7/site-packages/r2pipe/__init__.pyc in _cmd_process(self, cmd)
147 out = b''
148 while True:
--> 149 foo = self.process.stdout.read(1)
150 if foo == b'\x00':
151 break
KeyboardInterrupt:
Interrupted
KeyboardInterrupt
In [5]:
anal doesn't capture signint any more it seems.
looks good to you?
Looks great :-)
Was there a different set of bindings before? IIRC, we weren't using r2pipe, but somehow using radare directly?
Blast from the past, for educational purposes. This is how we were using r2 before, when binary loading was still in angr proper just about two years ago: https://github.com/angr/angr/blob/f8b2e2af0bc7ce62e32a814abf4400d4c252003a/binary.py
And here's the change when rhelmot got fed up with SIGINT not working and tracked it down: https://github.com/angr/angr/commit/612003ce4375f3c22ca5981663ba0f1998009d88
yeah, that's the native radare2 binding, you probably dont ever want to use those ;) r2pipe is much simpler (it just talks to an instance of radare2 over a pipe via json).
r2pipe has the benefit of actually building.
https://github.com/angr/angr/blob/f8b2e2af0bc7ce62e32a814abf4400d4c252003a/binary.py
That's ancient code...
Yeah, it took me a while to even find it :-)
any update on this?
@trufae As far as I'm aware, the radare2 backend is not in our plan.
This issue has been marked as stale because it has no recent activity. Please comment or add the pinned tag to prevent this issue from being closed.