radare2 icon indicating copy to clipboard operation
radare2 copied to clipboard

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

Open aviciano opened this issue 8 months ago • 3 comments

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 ]}]}]

aviciano avatar Feb 20 '25 12:02 aviciano