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

Pdb parsing fixes + typos #7997

Merged
merged 1 commit into from Jul 24, 2017
Merged

Pdb parsing fixes + typos #7997

merged 1 commit into from Jul 24, 2017

Conversation

xarkes
Copy link
Contributor

@xarkes xarkes commented Jul 24, 2017

This should fix #6434
Here is (part of) the output now:

$ rabin2 -P ~/win/wdm_harvested.pdb | head                                                                                                                                                                         <pdbb>
Warning: stream_size (3) is 0
Warning: no stream pages. Skipping.
There is no global symbols in current PDB.
LIST_ENTRY64: size 0x10
  0x0: Flink type:(member) unsigned long long
  0x8: Blink type:(member) unsigned long long
LIST_ENTRY32: size 0x8
  0x0: Flink type:(member) unsigned long
  0x4: Blink type:(member) unsigned long
_LIST_ENTRY: size 0x10
  0x0: Flink type:(member) pointer to struct _LIST_ENTRY
  0x8: Blink type:(member) pointer to struct _LIST_ENTRY
_SINGLE_LIST_ENTRY: size 0x8

return 0;
}
if (num_streams<0 || tmp_data_max_size <= 0) {
R_FREE(data);
eprintf ("too much amount of streams\n"
"curremt pdb file is not correct\n");
eprintf ("Too many streams: "
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this fits in 1 line :P

@@ -136,21 +136,21 @@ static int init_pdb7_root_stream(R_PDB *pdb, int *root_page_list, int pages_amou
data_end = data + tmp_data_max_size;
if (tmp_data_max_size> data_size) {
R_FREE(data);
eprintf ("invalid max tmp data size\n");
eprintf ("Invalid max tmp data size.\n");
return 0;
}
if (num_streams<0 || tmp_data_max_size <= 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing spaces around <, maybe throw an r2-indent here?

@@ -176,37 +176,41 @@ static int init_pdb7_root_stream(R_PDB *pdb, int *root_page_list, int pages_amou
if ((pos + num_pages) > tmp_data_max_size) {
R_FREE(data);
R_FREE(sizes);
eprintf("warning: looks like there is not correct values "
"of stream size in pdb file\n");
eprintf ("Warning: looks like there is no correct values "
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one line

memset(tmp, 0, num_pages * 4);
ut32 size = num_pages * 4;
tmp = (char *) malloc (size);
memset(tmp, 0, size);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check for null ptr and use calloc to avoid the memset

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also missing space before (

@xarkes
Copy link
Contributor Author

xarkes commented Jul 24, 2017

lgtm

@radare
Copy link
Collaborator

radare commented Jul 24, 2017

screen shot 2017-07-24 at 15 32 54

@xarkes
Copy link
Contributor Author

xarkes commented Jul 24, 2017

Yes ?

@radare
Copy link
Collaborator

radare commented Jul 24, 2017

fix the conflict

@xarkes
Copy link
Contributor Author

xarkes commented Jul 24, 2017

ah yy ofc

@radare radare merged commit f1a1eef into radareorg:master Jul 24, 2017
@xarkes xarkes deleted the pdbb branch January 2, 2018 08:08
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

Successfully merging this pull request may close these issues.

rabin2 not working/crashing on PDB
2 participants