Skip to content

Fix RSZ deserializer offset for shifted REType layouts#1780

Merged
praydog merged 1 commit into
praydog:masterfrom
dzxrly:master
Jun 22, 2026
Merged

Fix RSZ deserializer offset for shifted REType layouts#1780
praydog merged 1 commit into
praydog:masterfrom
dzxrly:master

Conversation

@dzxrly

@dzxrly dzxrly commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Since the REF merge in v2, there seems to have been an issue with the handling of RETypeCLR, which prevents the v2 REF from correctly exporting RSZ structures from MHWS. I tested 01388 and 01375, and both have this issue. Version 01366, the last version before the v2 merge, can still export il2cpp_dump.json from MHWS correctly.

I think the problem is that RETypeCLR does not correctly read the runtime-dispatch layouts. For PRAGMATA or MHST3, the RETypeCLR structure is as follows:

// PRAGMATA
class RETypeCLR : public REType
{
public:
	class ArrayDeserializeSequence deserializeThing; //0x0060
	class REType *nativeType; //0x0070
	char *name2; //0x0078
}; //Size: 0x0080
static_assert(sizeof(RETypeCLR) == 0x80);

// MHST3
class RETypeCLR : public REType
{
public:
	class ArrayDeserializeSequence deserializeThing; //0x0060
	class REType *nativeType; //0x0070
	char *name2; //0x0078
}; //Size: 0x0080
static_assert(sizeof(RETypeCLR) == 0x80);

However, MHWS has an additional 0x0008 offset, and its layout is as follows:

// MHWS
class RETypeCLR : public REType
{
public:
	class ArrayDeserializeSequence deserializeThing; //0x0068
	class REType *nativeType; //0x0078
	char *name2; //0x0080
}; //Size: 0x0088
static_assert(sizeof(RETypeCLR) == 0x88);

Although REType can already automatically read the layout for different games through runtime-dispatch layouts, RETypeCLR does not perform this kind of handling. Instead, it uses the default REType, which causes MHWS to use the default 0x0060 offset instead of the correct 0x0068 offset. As a result, the RSZ properties are missing entirely from the exported il2cpp_dump.json, which then prevents the RSZ template from being generated correctly.

In this PR, I made a simple change so that RETypeCLR can also read each game's own layout instead of loading the default layout. I tested this in MHWS, MHST3, and PRAGMATA. After this change, all of these games can correctly export the corresponding il2cpp_dump.json.

@praydog

praydog commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Thanks!

@praydog praydog merged commit 1c3d5b1 into praydog:master Jun 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants