-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add iP command to dsc ##io #23090
Add iP command to dsc ##io #23090
Conversation
libr/io/p/io_dsc.c
Outdated
|
||
pj_end (pj); | ||
|
||
char * result = strdup (pj_string (pj)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use pj_drain(pj); so you can avoid the strdup and the pj_free
libr/io/p/io_dsc.c
Outdated
|
||
pj_o (pj); | ||
|
||
tmp = r_str_newf ("0x%"PFMT64x, trimmed->slice->start + off_local); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tmp = r_str_newf ("0x%"PFMT64x, trimmed->slice->start + off_local); | |
char *tmp = r_str_newf ("0x%"PFMT64x, trimmed->slice->start + off_local); |
libr/io/p/io_dsc.c
Outdated
|
||
ut64 raw_value = r_read_le64 (raw_value_buf); | ||
|
||
char * tmp; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
char * tmp; |
libr/io/p/io_dsc.c
Outdated
free (tmp); | ||
|
||
switch (trimmed_info->info->info->version) { | ||
case 1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bad indentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls fix the few comments
Description
Add the iP command to the dsc io plugin, to get info about a Pointer. That draws information from the underlying rebase infos which are embedded in the pointer itself (whose semantics potentially changes over different maps), which otherwise gets lost as part of rebasing / pointer cleanup.
This is especially useful for getting info about pointer authentication, like the diversity and the key to use if there's any need to ever re-sign a pointer from the dyld cache.
The usage is
:iP [size][@vaddr]
if no size is provided defaults to 8, runs at current seek (or virtual seek if provided). The output is JSON only.Example:
Experimental in the sense that it's quite naive and there's no guard against the user pointing it to an unaligned address for example, where the bits will be interpreted in the wrong way.