radareorg / radare2

UNIX-like reverse engineering framework and command-line toolset
https://www.radare.org/
GNU Lesser General Public License v3.0
20.35k stars 2.97k forks source link

Profile overwrites ood argument #8639

Open chrysh opened 6 years ago

chrysh commented 6 years ago
% cat profile.rr2
#!/usr/bin/rarun2
arg1=BBBB
 % cat test.c
#include <stdio.h>
#include <string.h>

int main(int argc, char *argv[])
{
    printf(argv[1]);
}
% r2 -R ../return2libc/profile.rr2 -d test -c "ood AAAA; "
....
File dbg:///.../test  AAAA reopened in read-write mode
= attach 6918 6918
Assuming filepath /home/chrysh/code/ctf/tools/radare/learning/debugging/test
Continue until 0x562aee78564a using 1 bpsize
BBBBPTRACE_EVENT_EXIT pid=6918, status=0x0

Expected behavior: Prints AAAA. Seen behavior: Prints BBBB.

BBBB is printed (passed in as arg1 in profile) instead of AAAA, which I thought was the argument to the reopened binary (see: File dbg:///.../test AAAA reopened in read-write mode)?

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. Considering a lot has changed since its creation, we kindly ask you to check again if the issue you reported is still relevant in the current version of radare2. If it is, update this issue with a comment, otherwise it will be automatically closed if no further activity occurs. Thank you for your contributions.