refactor(il2cpp): decode metadata tables through one shared binary reader (#12554)

This commit is contained in:
RRFZ
2026-11-19 17:44:20 -05:00
committed by GitHub
parent d51dd4a996
commit 5c3fe9caeb
5 changed files with 72 additions and 52 deletions
@@ -890,3 +890,24 @@ describe("IL2CPP global-metadata version 24", () => {
);
});
});
it("keeps unsigned legacy literal lengths distinct from signed counted offsets", () => {
const legacy = mutated(
(fixture, bytes) => {
bytes.writeUInt32LE(0xffffffff, fixture.section("stringLiterals").offset);
},
createIl2cppMetadataFixture({ version: 29 }),
);
expect(failure(legacy)).toMatchObject({
reason: "index-out-of-range",
message: expect.stringContaining("4294967295"),
});
const counted = mutated((fixture, bytes) => {
bytes.writeInt32LE(-1, fixture.section("stringLiterals").offset);
});
expect(failure(counted)).toMatchObject({
reason: "index-out-of-range",
message: expect.stringContaining("[-1,"),
});
});