Created
February 28, 2023 16:11
-
-
Save trufae/cce27bd20c8c7cc6f5d7be5a5f03a2bb to your computer and use it in GitHub Desktop.
r2poke/json test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Q: whats "fields", whats "boffsets", the offset inside looks wrong. not 0x100003a3c :? | |
Q: will be good to have field offsets starting from struct map address and struct mapping absolute address | |
```sh | |
$ r2 /bin/ls | |
[0x100003a3c]> . ./json.pk | |
[0x100003a3c]> ""poke type Test = struct { byte a; byte b; } | |
[0x100003a3c]> ""poke var root = Test@0x100003a3c#B | |
[0x100003a3c]> poke print json_format(root) | |
{"value": {"fields": [127, 35], "boffsets": [119264, 119272], "mapping": {"mapped": 1, "strict": 1, "IOS": 0, "offset": {34359857632, "type": {"code": "Offset", "info": {"magnitude": {"code": "Integral", "info": {"size": 64, "signed_p": false}}, "unit": 1}}}}}, "type": {"code": "Struct", "info": {"name": "Test", "fields": [{"name": "a", "type": {"code": "Integral", "info": {"size": 8, "signed_p": false}}}, {"name": "b", "type": {"code": "Integral", "info": {"size": 8, "signed_p": false}}}]}}} | |
[0x100003a3c]> _~{} | |
{ | |
"value": { | |
"fields": [ | |
127, | |
35 | |
], | |
"boffsets": [ | |
119264, | |
119272 | |
], | |
"mapping": { | |
"mapped": 1, | |
"strict": 1, | |
"IOS": 0, | |
"offset": { | |
34359857632, | |
"type": { | |
"code": "Offset", | |
"info": { | |
"magnitude": { | |
"code": "Integral", | |
"info": { | |
"size": 64, | |
"signed_p": false | |
} | |
}, | |
"unit": 1 | |
} | |
} | |
} | |
} | |
}, | |
"type": { | |
"code": "Struct", | |
"info": { | |
"name": "Test", | |
"fields": [ | |
{ | |
"name": "a", | |
"type": { | |
"code": "Integral", | |
"info": { | |
"size": 8, | |
"signed_p": false | |
} | |
} | |
}, | |
{ | |
"name": "b", | |
"type": { | |
"code": "Integral", | |
"info": { | |
"size": 8, | |
"signed_p": false | |
} | |
} | |
} | |
] | |
} | |
} | |
} | |
[0x100003a3c]> | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment