Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

r_debug_execute incorrectly advances seek #19966

Closed
Lazula opened this issue Apr 17, 2022 · 0 comments · Fixed by #19980
Closed

r_debug_execute incorrectly advances seek #19966

Lazula opened this issue Apr 17, 2022 · 0 comments · Fixed by #19980
Labels
Milestone

Comments

@Lazula
Copy link
Collaborator

Lazula commented Apr 17, 2022

Environment

$ date && r2 -v && uname -ms
Sun 17 Apr 2022 03:13:43 PM CDT
radare2 5.6.7 30157 @ linux-x86-64 git.5.6.6
commit: 7435f879820c47a9dfe144c16a345bbff5d18cd6 build: 2022-04-17__15:10:06
Linux x86_64

Description

r_debug_execute() does not properly reset seek after hitting the breakpoint in the overwritten code at the program counter. The program counter still rests at the original PC, but seek is left at the breakpoint.

Actual behavior

$ r2 -N -Q -c 's; dx 90909090 2>/dev/null; s; doc' -d test/bins/elf/ls-focal
0x7fa48ad6e100
0x7fa48ad6e105

Expected behavior

$ r2 -N -Q -c 's; dx 90909090 2>/dev/null; s; doc' -d test/bins/elf/ls-focal
0x7fa48ad6e100
0x7fa48ad6e100
@Lazula Lazula added the RDebug label Apr 17, 2022
@trufae trufae added this to the 5.7.0 milestone Apr 18, 2022
trufae pushed a commit that referenced this issue Apr 21, 2022
* Add return value output arg to r_debug_execute()
* Always restore the full 4k at the stack
* Fix maybe-uninitialized warning
* Use raw RCore->offset instead of RCore.seek()
* Move seek handling into cmd_debug()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants