radare2 icon indicating copy to clipboard operation
radare2 copied to clipboard

r2pipe not working when `>` is used

Open trufae opened this issue 3 years ago • 1 comments

. foo.py > /dev/null

trufae avatar Sep 14 '22 15:09 trufae

r2pipe starts working only when > is used. https://gist.github.com/mmkhitaryan/2237fc60dfae5ae36d93171706385c81 you need to create a file README in cwd. The script steps through /bin/ls and checks if there is README filename in the heap which the stack is currently pointing to. If you run the script like this:

r2 /bin/ls
[0x00006ab0]> . ./demo123.py

It will be stuck in a loop forever, because for some reason poiner_from_stack does not change. But if you run the same script with > it ends without forever loop.

r2 /bin/ls
[0x00006ab0]> . ./demo123.py > log
INFO: File dbg:///usr/bin/ls reopened in read-write mode
[x] Analyze all flags starting with sym. and entry0 (aa)
[x] Analyze all functions arguments/locals
[x] Analyze function calls (aac)
[x] Analyze len bytes of instructions for references (aar)
[x] Finding and parsing C++ vtables (avrr)
[x] Skipping type matching analysis in debugger mode (aaft)
[x] Propagate noreturn information (aanr)
[x] Use -AA or aaaa to perform additional experimental analysis.
INFO: Continue until 0x55a966f15830 using 1 bpsize
hit breakpoint at: 0x55a966f15830
[0x7ff46b108798]>

mmkhitaryan avatar Sep 15 '22 09:09 mmkhitaryan

This is fixed now

trufae avatar Feb 12 '24 19:02 trufae