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

Fixed old_offset not restored on pdj ##print #23619

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

suidpit
Copy link
Contributor

@suidpit suidpit commented Nov 8, 2024

  • [ X ] Mark this if you consider it ready to merge
  • [ X ] I've added tests (optional)
  • I wrote some lines in the book (optional)

Description

Currently, when using negative numbers in the pdj command, in r_core_print_disasm_json_ipi a new offset (computed going backward) is assigned to the core->offset variable. However, the old_offset is not restored before returning from the function, which has the undesired side-effect that the cursor goes back after the command (annoyingly breaking r2pipe automations).

PoC:
image

radare2 version:
5.9.6-158-gc72b9514ad

This pull request should fix this behaviour.

Same command, with the patch:
image

@trufae trufae merged commit 073660d into radareorg:master Nov 8, 2024
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants