Giter Site home page Giter Site logo

CLE doesn't have a r2 backend about cle HOT 20 CLOSED

angr avatar angr commented on September 1, 2024
CLE doesn't have a r2 backend

from cle.

Comments (20)

zardus avatar zardus commented on September 1, 2024 1

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.

from cle.

crowell avatar crowell commented on September 1, 2024 1

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.

from cle.

zardus avatar zardus commented on September 1, 2024

I think it'd be awesome, but unfortunately manpower is limited. We'd love a pull request on this :-)

from cle.

Manouchehri avatar Manouchehri commented on September 1, 2024

@crowell Ancient thread bump, still interested in this? Came to say the same thing.

from cle.

crowell avatar crowell commented on September 1, 2024

@Manouchehri i've almost finished an implementation. check back in a day or two.

from cle.

Manouchehri avatar Manouchehri commented on September 1, 2024

That sounds great, looking forward to trying it out! =D

from cle.

zardus avatar zardus commented on September 1, 2024

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...

from cle.

crowell avatar crowell commented on September 1, 2024

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
#1 (comment)

from cle.

rhelmot avatar rhelmot commented on September 1, 2024

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.

from cle.

zardus avatar zardus commented on September 1, 2024

(jinks @rhelmot!)

from cle.

crowell avatar crowell commented on September 1, 2024

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
#1 (comment)

from cle.

crowell avatar crowell commented on September 1, 2024
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?

from cle.

zardus avatar zardus commented on September 1, 2024

Looks great :-)

Was there a different set of bindings before? IIRC, we weren't using r2pipe, but somehow using radare directly?

from cle.

zardus avatar zardus commented on September 1, 2024

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

from cle.

zardus avatar zardus commented on September 1, 2024

And here's the change when rhelmot got fed up with SIGINT not working and tracked it down: angr/angr@612003c

from cle.

ltfish avatar ltfish commented on September 1, 2024

https://github.com/angr/angr/blob/f8b2e2af0bc7ce62e32a814abf4400d4c252003a/binary.py

That's ancient code...

from cle.

zardus avatar zardus commented on September 1, 2024

Yeah, it took me a while to even find it :-)

from cle.

trufae avatar trufae commented on September 1, 2024

any update on this?

from cle.

ltfish avatar ltfish commented on September 1, 2024

@trufae As far as I'm aware, the radare2 backend is not in our plan.

from cle.

github-actions avatar github-actions commented on September 1, 2024

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.

from cle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.