mirror of
https://github.com/morluto/rea.git
synced 2026-11-07 15:26:25 +00:00
fix(il2cpp): preserve recognized truncated metadata prefixes
This commit is contained in:
1 parent
eb7acc70bf
commit
b3aadaf474
10 files changed
+273
-25
No files matched your search
@@ -3,7 +3,7 @@ import { createHash } from "node:crypto";
|
||||
import { setImmediate } from "node:timers/promises";
|
||||
import type { DesktopFile, DesktopFact } from "../domain/desktopApplication.js";
|
||||
import { jsonValueByteLength } from "../domain/jsonValueByteLength.js";
|
||||
import { IL2CPP_METADATA_MAGIC } from "../domain/il2cpp/il2cppMetadata.js";
|
||||
import { observeIl2cppMetadataHeaderPrefix } from "../domain/il2cpp/il2cppMetadataHeaderPrefix.js";
|
||||
import { parsePeRecord, peRvaToFileOffset } from "../domain/binaryTarget.js";
|
||||
import { readManagedMetadataLayout } from "../dotnet/ManagedMetadataLayout.js";
|
||||
import { readAssemblyReferenceName } from "../dotnet/ManagedMetadataInventoryRows.js";
|
||||
@@ -98,13 +98,14 @@ export const inspectDesktopFile = async (
|
||||
row.facts.push(observation);
|
||||
};
|
||||
const prefix = await read(0, Math.min(size, 64));
|
||||
if (prefix.length >= 8 && prefix.readUInt32LE(0) === IL2CPP_METADATA_MAGIC)
|
||||
const metadataPrefix = observeIl2cppMetadataHeaderPrefix(prefix);
|
||||
if (metadataPrefix.kind === "il2cpp")
|
||||
fact({
|
||||
kind: "il2cpp-metadata-header",
|
||||
offset: 0,
|
||||
value: {
|
||||
magic: "0xfab11baf",
|
||||
raw_version: prefix.readUInt32LE(4),
|
||||
raw_version: metadataPrefix.rawVersion,
|
||||
},
|
||||
});
|
||||
if (prefix.length >= 20 && prefix.toString("latin1", 0, 4) === "GDPC")
|
||||
|
||||
Reference in new issue
Block a user