XEXLoaderWV icon indicating copy to clipboard operation
XEXLoaderWV copied to clipboard

The loadpdb functionality is somewhat broken

Open guccigang420 opened this issue 3 years ago • 6 comments

The load pdb functionality does not load datatypes or the function names properly for the .xex executable.

guccigang420 avatar Oct 21 '22 15:10 guccigang420

thats your word against mine, please dont provide any files or details

zeroKilo avatar Oct 21 '22 15:10 zeroKilo

Apologies for not uploading any images. In the example below you could see that the parameter is undefined, and the names of the functions contain ??@UAAXZ etc image

This is the example of a struct from the same pdb file loaded in IDA. image

Here also data structure/type info should be present. Also the names of "PTR_Function_.... should be available. image

guccigang420 avatar Oct 21 '22 15:10 guccigang420

ok I will take a look, this can take a while, pls be patient or find me on discord if you wanna chat in the meantime. greetz

zeroKilo avatar Oct 21 '22 16:10 zeroKilo

Could you post your discord id here?

guccigang420 avatar Oct 21 '22 16:10 guccigang420

its under every recent yt vid of mine... wv#9312

zeroKilo avatar Oct 21 '22 16:10 zeroKilo

about demangling, I found this, maybe it solves the mangled name problem already:

https://github.com/NationalSecurityAgency/ghidra/issues/1103

PDB support for types is coming, but dont expect too much, documentation for both PDBs and Ghidra are very hard to come by

zeroKilo avatar Nov 05 '22 19:11 zeroKilo

Understandable. Hopefully you manage to make it with the types. It's pretty tricky because you have to represent CPP classes as C-Structs with v-tables

guccigang420 avatar Nov 07 '22 17:11 guccigang420

result: https://github.com/zeroKilo/XEXLoaderWV/commit/754cca3daf48c5bdc61cfff88734d660561b10a0

well I dont have more time to spend on this, that commit and current release are as good as it gets:

  • there is now an option to load a pdb in general, it will open a dialog where you can choose between ghidras builtin parser and m$'s DIA parser (essentially using pdb.exe to produce a xml and parse that)
  • theres also an option to use my experimental loader (ignoring the choice in the dialog), which is not complete, but im happy to take in outside help :)

essentially my code can read pretty much every typerecord from the pdb, but the code to apply/import it into ghidra is as best a hack of mine, it needs serious improvement, starting here: https://github.com/zeroKilo/XEXLoaderWV/blob/master/XEXLoaderWV/src/main/java/xexloaderwv/TPIStream.java#L141

greetz

zeroKilo avatar Nov 07 '22 18:11 zeroKilo

https://github.com/NationalSecurityAgency/ghidra/pull/1433 maybe?

mirh avatar Jan 22 '23 01:01 mirh