- Notifications
You must be signed in to change notification settings - Fork 90
Debug Section
Karsten Hahn edited this page Feb 11, 2023 · 6 revisions
Print debug section information:
File file = new File("sample.exe"); String report = ReportCreator.newInstance(file).debugReport(); System.out.println(report); Read codeview info:
CodeviewInfo codeView = data.loadCodeViewInfo().get(); byte[] guid = codeView.guid(); String path = codeView.filePath(); long age = codeView.age(); Read only debug path:
String debugPath = data.loadPDBPath(); Get specific debug directory values of a specific type (here Codeview):
PEData data = PELoader.loadPE(file); SectionLoader loader = new SectionLoader(data); DebugSection debugSection = loader.loadDebugSection(); Stream<DebugDirectoryEntry> debugStream = debugSection.getEntries().stream(); DebugDirectoryEntry codeViewEntry = debugStream.filter(d -> d.getDebugType() == DebugType.CODEVIEW).findFirst().get(); Long address = codeViewEntry.get(DebugDirectoryKey.ADDR_OF_RAW_DATA); Long size = codeViewEntry.get(DebugDirectoryKey.SIZE_OF_DATA); String type = codeViewEntry.getTypeDescription(); Date stamp = codeViewEntry.getTimeDateStamp();