DeepZero
DeepZero copied to clipboard
Decompilation output repeats the same routine for every IOCTL code
What happens
For each IOCTL code it finds, the decompilation stage stores the entire dispatch routine again in ghidra_result.json. Every code in a driver is handled by that one routine, and it is already recorded once alongside them, so each copy after the first is the same text repeated.
Measured on a real driver pack of 1,388 decompiled drivers:
total ghidra_result.json |
734.5 MB |
| the same routine repeated | ~706 MB |
| largest single driver | 52.5 MB (252 codes, one 195 KB routine) |
| drivers where every entry was identical | 401 |
Removing the repetition brought the same results down to 28.5 MB with nothing lost.
Why it matters
- Disk grows with codes-per-driver rather than with actual analysis, and scales with the corpus. A pack ten times larger would spend gigabytes on repeated text.
- The assessment stage reads artifacts from the sample directory to build its prompt, so it parsed and held a 52 MB document per driver.
- Anything that walks results - reporting, or a user reading the file - pays for it too.
Suggested fix (acceptance criteria)
- [ ] Each IOCTL entry records its code and decoded fields; the routine is stored once.
- [ ] Prompt building skips an artifact larger than the context budget instead of parsing it, and says so, matching how oversized source files are already truncated.
- [ ] Note the expected size of decompilation output in the processor documentation so a regression is noticeable.