fix(targets): retain unsupported PE machine in diagnostics (#2448)
Assisted-by: OpenAI GPT-6 <noreply@openai.com> Co-authored-by: Aurantium-47 <280805072+Aurantium-47@users.noreply.github.com>
This commit is contained in:
co-authored by
Aurantium-47
parent
03ab521db3
commit
43738bec57
@@ -278,8 +278,12 @@ export const parsePeRecord = (
|
||||
record.toString("binary", 0, 4) !== "PE\u0000\u0000"
|
||||
)
|
||||
return err("invalid or truncated PE header");
|
||||
const machine = decodePeMachine(record.readUInt16LE(4));
|
||||
if (machine === undefined) return err("unsupported PE architecture");
|
||||
const machineType = record.readUInt16LE(4);
|
||||
const machine = decodePeMachine(machineType);
|
||||
if (machine === undefined)
|
||||
return err(
|
||||
`unsupported PE architecture (COFF machine 0x${machineType.toString(16).padStart(4, "0")})`,
|
||||
);
|
||||
const { architecture } = machine;
|
||||
const optionalHeaderSize = record.readUInt16LE(20);
|
||||
if (optionalHeaderSize > 4096 || record.length < 24 + optionalHeaderSize)
|
||||
|
||||
Reference in New Issue
Block a user