mirror of
https://github.com/morluto/rea.git
synced 2026-10-26 17:35:11 +00:00
Retain bounded FAT and offset-tagged PE observations through archive hashing, classification, and content nodes. Preserve PyInstaller member paths according to the observed carrier dialect and share APK v1 signing-name semantics. Read SQLite's implicit sqlite_schema table without inventing a stored schema declaration. Distinguish unsupported ELF numbering and decoded-name admission from malformed data and fixed scan allowances. Preserve Sigrok basenames and classify matching explicit input-format refusals at their owning boundary. Validation: 554 distinct tests passed, 3 skipped across serial focused runs; build, typecheck/lint, docs, formatting, and discovery (2141 files) passed. Sigrok command-boundary simulators do not establish real-tool decoding. Small repeated public PyInstaller CLI runs had equivalent inventory facts; warm median elapsed 0.5431s before / 0.5426s after, with no speed claim. Fixes #6733 Fixes #6741 Fixes #6722 Fixes #6732 Fixes #6736 Fixes #6734 Fixes #6764 Fixes #6766 Refs #6739
19 lines
620 B
TypeScript
19 lines
620 B
TypeScript
import { createAsarHeaderSignatureProbe } from "../../src/artifacts/AsarHeader.js";
|
|
import { classifyArtifactContent } from "../../src/artifacts/inventory/ArtifactGraphConstruction.js";
|
|
|
|
/** Observe a supplied byte prefix before assigning an inventory path role. */
|
|
export const classifyArtifactBytesAtPath = (
|
|
path: string,
|
|
bytes: Buffer,
|
|
fileSize = bytes.length,
|
|
) => {
|
|
const probe = createAsarHeaderSignatureProbe();
|
|
probe.write(bytes);
|
|
const { kind, format } = classifyArtifactContent(
|
|
path,
|
|
{ prefix: bytes, asarHeader: probe.finish(fileSize) },
|
|
fileSize,
|
|
);
|
|
return { kind, format };
|
|
};
|