mirror of
https://github.com/morluto/rea.git
synced 2026-11-16 11:43:20 +00:00
fix(il2cpp): reject module image references outside retained inventory (#8956)
This commit is contained in:
1 parent
4362a0848e
commit
da79ea0baa
3 files changed
+103
No files matched your search
@@ -482,6 +482,34 @@ const linkedReport = (): Il2cppMetadata => ({
|
||||
parameter_types: [{ type: 0, name: "int" }],
|
||||
});
|
||||
|
||||
it.each([-1, 1, 99])(
|
||||
"rejects imported code-generation module image reference %i",
|
||||
(image) => {
|
||||
const value = linkedReport();
|
||||
value.binary!.code_gen_modules[0]!.image = image;
|
||||
const parsed = il2cppMetadataParentSchema.safeParse(value);
|
||||
expect(parsed.success).toBe(false);
|
||||
if (!parsed.success)
|
||||
expect(parsed.error.issues).toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
path: ["binary", "code_gen_modules", 0, "image"],
|
||||
}),
|
||||
]),
|
||||
);
|
||||
for (const selection of [{}, { image_indices: [image] }]) {
|
||||
const view = projectIl2cppMetadataView(parent(value, false), {
|
||||
kind: "il2cpp-metadata",
|
||||
collection: "code_gen_modules",
|
||||
...selection,
|
||||
offset: 0,
|
||||
limit: 64,
|
||||
});
|
||||
expect(view.ok).toBe(false);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it("selects every folded method by numeric address with stable indices and both source identities", () => {
|
||||
const source = parent(freezeJsonSnapshot(linkedReport()), true);
|
||||
const view = projectIl2cppMetadataView(source, {
|
||||
|
||||
Reference in new issue
Block a user