mirror of
https://github.com/morluto/rea.git
synced 2026-10-30 19:35:56 +00:00
fix(il2cpp): require FAT container identity
This commit is contained in:
1 parent
7cbf375d01
commit
dd2cbbf1a2
2 files changed
+36
-2
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import {
|
||||
classifyFatContainerEvidence,
|
||||
readFatContainerHeader,
|
||||
validateFatSlice,
|
||||
} from "../domain/apple/machoContainer.js";
|
||||
@@ -34,7 +35,16 @@ const selectImage = (
|
||||
architecture: string | undefined,
|
||||
): Buffer => {
|
||||
const fat = readFatContainerHeader(bytes, bytes.length);
|
||||
if (fat.state === "not-fat") {
|
||||
const identity =
|
||||
fat.state === "parsed"
|
||||
? classifyFatContainerEvidence(fat, bytes)
|
||||
: undefined;
|
||||
if (identity?.state === "malformed")
|
||||
throw new Il2cppBinaryFormatFailure("malformed-container", identity.reason);
|
||||
if (
|
||||
fat.state === "not-fat" ||
|
||||
(fat.state === "parsed" && identity?.state !== "mach-o")
|
||||
) {
|
||||
if (architecture !== undefined)
|
||||
throw new Il2cppBinaryFormatFailure(
|
||||
"slice-not-found",
|
||||
|
||||
Reference in new issue
Block a user