zeroKilo / XEXLoaderWV

Ghidra Loader Module for X360 XEX Files
113 stars 13 forks source link

Error importing XEX with PDB #10

Closed r3sus closed 3 years ago

r3sus commented 3 years ago

Hello I'm importing XEX with PDB per 2nd video tutorial. Process timeline: importing xex importing symbols ... 100% error.

XEX standalone is successfully imported. (however, I didn't looked in code browser) JDK 12.0.2 is freshly installed, also tried OpenJDK - same. (env. variables are set correctly, reboot) Earlier, by accident, imported XEX + PDB with JDK 11, and got the same error, iirc.

PDB's size is about 2.5 times more than XEX's.

Removed encryption with xextool (GUI) - same error. XEX is not compressed, according to the tool.

Import options are default, toggling "Read .pdata" makes no sense.

Thanks.

Log ``` java.io.IOException: Attempt to read beyond end of byte data java.io.IOException: java.io.IOException: Attempt to read beyond end of byte data at xexloaderwv.XEXLoaderWVLoader.load(XEXLoaderWVLoader.java:57) at ghidra.app.util.opinion.AbstractLibrarySupportLoader.doLoad(AbstractLibrarySupportLoader.java:347) at ghidra.app.util.opinion.AbstractLibrarySupportLoader.loadProgram(AbstractLibrarySupportLoader.java:83) at ghidra.app.util.opinion.AbstractProgramLoader.load(AbstractProgramLoader.java:112) at ghidra.plugin.importer.ImporterUtilities.importSingleFile(ImporterUtilities.java:400) at ghidra.plugin.importer.ImporterDialog.lambda$okCallback$7(ImporterDialog.java:349) at ghidra.util.task.TaskLauncher$1.run(TaskLauncher.java:90) at ghidra.util.task.Task.monitoredRun(Task.java:124) at ghidra.util.task.TaskRunner.lambda$startTaskThread$1(TaskRunner.java:94) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:835) Caused by: java.io.IOException: Attempt to read beyond end of byte data at ghidra.app.util.bin.ByteArrayProvider.readBytes(ByteArrayProvider.java:111) at ghidra.app.util.bin.BinaryReader.readShort(BinaryReader.java:611) at xexloaderwv.PDBFile$SymbolRecord.(PDBFile.java:36) at xexloaderwv.PDBFile.ReadSymbolData(PDBFile.java:107) at xexloaderwv.PDBFile.(PDBFile.java:73) at xexloaderwv.XEXLoaderWVLoader.load(XEXLoaderWVLoader.java:52) ... 11 more --------------------------------------------------- Ghidra Version: 9.2 (PUBLIC) Java Home: C:\Program Files\Java\jdk-12.0.2 JVM Version: Oracle Corporation 12.0.2 OS: Windows 10 10.0 amd64 Workstation: PC ```
zeroKilo commented 3 years ago

well are you sure, the pdb belongs to the xex? it seems it has problems parsing your pdb, can you provide it?

r3sus commented 3 years ago

Yes and Yes

zeroKilo commented 3 years ago

your link sends me to coinbase registering page, I guess you should recheck that

r3sus commented 3 years ago

Sorry, please, try again

zeroKilo commented 3 years ago

got it, but just the xex + pdb would have been enough... I dont have much time today, will look as soon as I have time.

greetz

r3sus commented 3 years ago

Okay, thanks same XEX+PDB works in IDA

zeroKilo commented 3 years ago

hey there, now I did found time and looked into this, I dont know whats wrong with the symbol tables but a simple try catch solved the problem. remember to uncheck "process .pdata" or you have all symbols double (unnamed and named)

ds

seems to work fine now, let me know if you have any better suggestions.

greetz

PS: making a new release too

r3sus commented 3 years ago

Hello Thanks, got successful import with this fix. Would that give a use, if plugin output unprocessed imports? There were errors when processing with IDA too. I think idaxex skips some items too? Interesting to compare results with idaxex. only symbol table, I think? Thanks

zeroKilo commented 3 years ago

if you wanna explore the inner details of a pdb maybe try my other tool https://github.com/zeroKilo/PDBDumpWV you could easily add some output for any information you like. can this ticket be closed?

greetz