Closed sidra-asa closed 1 year ago
Yes thats how r2pipe works. You may not run commands that print null bytes. And i think pr is the only one that does this. You can encode any raw data as base64 or hexa easily. Or even escape that null byte. But internally in r2pipe this is not handled
Thank you for the kind reply and the detailed explanation. These are helpful. I'm going to close this issue and try to use some other commands that encodes raw data as base64 or hex string.
Environment
Description
Take a Python script r2_wrapper.py, which analyzes the APK(SHA1: 42b25b60aa7d6d9f0b388c10a45e8a8f8c1fc718), as an example. I print the raw bytes with the
pr
command, then try to disassemble the function and print some other bytes. But the pr command output is incomplete, and the follow-up command outputs are wrong.The following are the expected results of
r2_wrapper.py
.From my understanding, the root cause is the function _cmd_process which is defined in
open_sync.py
. If the command result contains more than one\x00
hexadecimal character, the function will return the substring before the first\x00
character and hold the remaining substring inself.pending
until the next invoke. In this case, the next command will output the wrong result that is the remaining substring fromself.pending
.Please let me know if anything is unclear.