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

Use blocksize to determine size for rz_cmd_disassembly_n_bytes_handler() #4714

Merged
merged 3 commits into from
Nov 12, 2024

Conversation

winterheart
Copy link
Contributor

Your checklist for this pull request

  • I've read the guidelines for contributing to this repository
  • I made sure to follow the project's coding style
  • I've documented or updated the documentation of every function and struct this PR changes. If not so I've explained why.
  • I've added tests that prove my fix is effective or that my feature works (if possible)
  • I've updated the rizin book with the relevant information (if needed)

Detailed description

Commands like pD are accepts optional argument, but rz_cmd_disassembly_n_bytes_handler() requires it. Add current core->blocksize as failback to help calculating correct size.

Test plan

Current dev threats no args pD as error, but rizin book and pD? states that should be correct command:

[0x00001100]> bf sym.main
[0x00001100]> pD @ sym.main
ERROR: Invalid number of arguments

After applied changes pD should correctly dump file without optional argument:

[0x00001100]> bf sym.main
[0x00001100]> pD @ sym.main
            ;-- main:
            0x000011e9      endbr64
            0x000011ed      push  rbp
            0x000011ee      mov   rbp, rsp
            0x000011f1      sub   rsp, 0x40
            0x000011f5      mov   dword [rbp - 0x34], edi
            0x000011f8      mov   qword [rbp - 0x40], rsi
...

Closing issues

...

Commands like pD are accepts optional argument, but
rz_cmd_disassembly_n_bytes_handler() requires it. Add current core->blocksize
as failback to help calculating correct size.
librz/core/cmd/cmd_print.c Outdated Show resolved Hide resolved
librz/core/cmd/cmd_print.c Outdated Show resolved Hide resolved
@wargio wargio merged commit d2bd940 into rizinorg:dev Nov 12, 2024
45 checks passed
@winterheart winterheart deleted the optional-pD branch November 12, 2024 10:11
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 this pull request may close these issues.

3 participants