refactor(pe): share optional-header structural facts

Decode optional-header declarations once and pass detached directory words, locations and SizeOfHeaders to native consumers. Preserve executable machine admission, raw GPU/resource machine reporting, RVA mapping and certificate file-offset semantics.

Validation: fresh build/catalog, full static checks, 466 core/provider fixture tests, 122 workflow tests and 14 selected file-backed PE admission tests passed. Public CLI and actual stdio MCP used authored artifacts; installed external providers were not qualified. Added 17 structural cases and two GPU machine-policy controls. Eager directory decoding costs remain unmeasured.
This commit is contained in:
morluto committed 2026-10-25 05:28:31 +08:00
1 parent 9548953b47
commit 599099f656
12 files changed
+394 -119

No files matched your search

+1 -1
View File
@@ -164,7 +164,7 @@ export const parsePeLoadConfig = async (
const dataDirectory = (index: number): DirectorySpan | null => {
const entry = image.pe_data_directories[index];
if (entry === undefined) return null;
const { virtual_address: rva, size } = entry;
const { address: rva, size } = entry;
if (rva === 0 && size === 0) return null;
if (rva === 0 || size === 0)
throw new BinaryFormatFailure(