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

Invalid JSON values in pfj (show data using named format in JSON) #23986

Open
aviciano opened this issue Feb 20, 2025 · 2 comments
Open

Invalid JSON values in pfj (show data using named format in JSON) #23986

aviciano opened this issue Feb 20, 2025 · 2 comments

Comments

@aviciano
Copy link
Contributor

Environment

Thu Feb 20 13:22:51 CET 2025
radare2 5.9.9 38771 @ linux-x86-32
birth: git.5.9.8-386-g98490509b3 2025-02-20__13:19:59
commit: 98490509b386e4c14e8e11a786c4b72a919eaca9
options: gpl -O? cs:5 cl:2 make
Linux x86_64

Description

Nested array values formatted as 0x... which is an invalid JSON value

Test

r2 --
[0x00000000]> "td struct bar { uint32_t baz[1];}"
[0x00000000]> pf.foobarbaz ? (bar)foo
[0x00000000]> pfj foobarbaz

got

[{"name":"foo","type":"bar","offset":0,"value":[{"name":"baz","type":"d","offset":0,"value":[ 0xffffffff ]}]}]

expected

[{"name":"foo","type":"bar","offset":0,"value":[{"name":"baz","type":"d","offset":0,"value":[ 4294967295 ]}]}]
@trufae
Copy link
Collaborator

trufae commented Feb 20, 2025

pf is awful thats why i created pf2. But its far from complete, fixing such bugs in the current code is not worth imho. Wanna help on finishing pf2?

@aviciano
Copy link
Contributor Author

Currently I have limited time, but I can try to help. Some guidance will be appreciated.

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

No branches or pull requests

2 participants