mirror of
https://github.com/morluto/rea.git
synced 2026-11-23 06:55:55 +00:00
refactor(artifacts): share cached prefix reader and ELF/MZ magic (#13663)
refactor(filesystem/artifacts): share createCachedPrefixReader and ELF/MZ magic helpers
This commit is contained in:
1 parent
b14693914c
commit
baed75fc2b
11 files changed
+76
-53
No files matched your search
@@ -5,7 +5,7 @@ import {
|
||||
declaredFileRange,
|
||||
} from "../../domain/binaryContainer.js";
|
||||
import { err, ok, type Result } from "../../domain/result.js";
|
||||
import { parseMzHeaderEvidence } from "../../domain/dosMz.js";
|
||||
import { hasDosMzMagic, parseMzHeaderEvidence } from "../../domain/dosMz.js";
|
||||
import {
|
||||
observePeCoffFrame,
|
||||
PE_COFF_FRAME_BYTES,
|
||||
@@ -730,7 +730,7 @@ const peClaims = async (
|
||||
): Promise<readonly SectionWindow[]> => {
|
||||
const { handle, fileSize, signal } = source;
|
||||
const dos = await tryRead(handle, 0, 64, fileSize, signal);
|
||||
if (dos === null || dos[0] !== 0x4d || dos[1] !== 0x5a) return [];
|
||||
if (dos === null || !hasDosMzMagic(dos)) return [];
|
||||
const probe = observePeCoffFrame(
|
||||
dos,
|
||||
fileSize,
|
||||
|
||||
Reference in new issue
Block a user