Have a functioning r2pipe script, but there's a need for hitting crtl-c to continue near the breakpoint(not a major issue,) however the script does not pause for input when the crackme asks for user input like it does in regular r2 command line. Whats the best way of sending input to the binary? This tree of inputs is required near the end of the executable. Can't manage it to prompt even for the first. No problems with script except for the input issue.
import r2pipe
r = r2pipe.open('crackme, flags=['-d'])
r.cmd('e dbg.profile=robot.rr2')
r.cmd('db 0x080486d8;')
print(r.cmd('dc'))
print(r.cmd('dc'))
sep=' '
value1=int(r.cmd('? [ebp+0xc];').split(sep, 1)[0])
value2=int(r.cmd('? [ebp+0x10];').split(sep, 1)[0])
hex_operator=r.cmd('dr eax')
operator=r.cmd('? '+(hex_operator))
if '+' in operator:
answer=value1+value2
elif '-' in operator:
answer=value1-value2
print(r.cmd('dc'))
Should prompt for input down here, but the execution just ends after the "what's the password" OR if I enter the r2 commands without r2pipe starting with: r2 -d crackme -c "e dbg.profile=robot.rr2" it does prompt me for input but rr2 still does not input whats in input.txt
in my .rr2:
#!/usr/bin/rarun2
have tried
input=input.txt
and
stdin=input.txt
input.txt is just a string
is it possible rarun's input or stdin directives are not compatible or something?