-
-
Notifications
You must be signed in to change notification settings - Fork 363
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
[WIP] Rewrite PDB parser #1498
[WIP] Rewrite PDB parser #1498
Conversation
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.
I thought the API for rz_buf_
access has been changed by @08a to separate the return value from the error.
In fact, I can see there is |
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.
Also seems too many tests marked as BROKEN
. Why?
ut32 blocks = count_blocks(stream_size, pdb->super_block->block_size); | ||
total_blocks += blocks; | ||
} | ||
// NumStreams StreamsSizes StreamsBlockMap |
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.
What does this comment mean?
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.
Indicate the meaning of each sizeof(ut32)
|
||
/** | ||
* \brief Parse pdb from the buffer |
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.
pdb
-> PDB
return lf_enum ? lf_enum->substructs : NULL; | ||
} | ||
default: | ||
return NULL; | ||
} | ||
} | ||
|
||
static char *get_type_name(void *type) { | ||
/** | ||
* \brief Get the name of the givin type |
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.
Get the name of the type
return lf_union->name.name; | ||
} | ||
default: | ||
return NULL; | ||
} | ||
} | ||
|
||
static ut64 get_type_val(void *type) { | ||
/** | ||
* \brief Get the numric inside the givin type |
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.
Get the numeric value inside the type
* \param mode Output Mode | ||
* \return bool | ||
*/ | ||
RZ_API bool rz_core_pdb_info(RzCore *core, const char *file, RzOutputMode mode) { |
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.
Rename it into rz_core_pdb_info_print()
They are flags(were added by |
i think this is fine, as long as the C apis does the same (actually much better if is via C) |
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.
Also seems too many tests marked as
BROKEN
. Why?They are flags(were added by
rz_cons_printf("f xx=0x1234")
, I removed it.) or classes(We don't support yet)i think this is fine, as long as the C apis does the same
If they don't show up with fi @ 0xXXXXX
it means the C API does not do the same, thus I think it is not fine to completely remove them. The purpose of loading PDB is to get more information about the binary, and for example knowing where the main
function is is a valuable info that we lose if we don't put a flag in the right address.
@@ -24,6 +24,7 @@ | |||
#include <rz_type.h> | |||
#include <rz_arch.h> | |||
#include <rz_cmd.h> | |||
#include "../bin/pdb/pdb.h" |
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.
Why this??? I think it should not be done.
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.
We have RZ_API void rz_parse_pdb_types(const RzTypeDB *typedb, const RzPdb *pdb);
in this module.
@@ -12,25 +12,6 @@ extern "C" { | |||
|
|||
struct RZ_PDB7_ROOT_STREAM; | |||
|
|||
typedef struct rz_pdb_t { |
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.
is this file even necessary now? it seems there's not much inside..
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.
Ah, I forgot this file..
I agree that we should keep this |
Move to #1517 |
Your checklist for this pull request
Detailed description
Undone:
1: Fix bugs in symbols parsing(done)
2: update test and unit test(cmd test done)
3: switch to new
rz_buf_xxx
API(done)4: update doxygen comments(done)
5: use bit mask when parsing bitfields(done)
Test plan
...
Closing issues
...