Skip to content

Introduce Struct type#1152

Merged
praydog merged 2 commits intopraydog:masterfrom
dtlnor:struct-type
Nov 17, 2024
Merged

Introduce Struct type#1152
praydog merged 2 commits intopraydog:masterfrom
dtlnor:struct-type

Conversation

@dtlnor
Copy link
Copy Markdown
Contributor

@dtlnor dtlnor commented Nov 16, 2024

Note that this is a breaking change.

  1. Add a new entry element_type_name to il2cpp_dump.json if it is an array-like object and TDB >= 69 (tested with MHWilds OBT only).
  2. Add the Struct data type to the rsz dump. Previously, if it was a Struct type, the dumper would unpack it and flatten it into multiple fields. However, for an array of Struct, the dumper would skip it. This change will unpack a single Struct type as before but will leave the Struct type untouched if it is an array of Struct, with hardcoded Size and Alignment set to 1, 1.
  3. The behavior of original_type has changed. For array objects, it points to their element type instead of their own type. For example, for an array of int, it was "original_type": "System.UInt32[]" before, but it is "original_type": "System.UInt32" after.

Make `original_type` point to its element type rather than its own type for array-like object
@dtlnor
Copy link
Copy Markdown
Contributor Author

dtlnor commented Nov 16, 2024

I think maybe I should tag @Synthlight and @czastack as this change could break the software that makes use of the rsz dump. I don't know if the change of original_type matters, as the 010 template RE_RSZ never used it until

this PR. If this causes trouble for you guys, adding a new entry like element_type also works (apart from the rsz dump becoming bloated).

@Synthlight
Copy link
Copy Markdown
Contributor

Running it with RE2 generation & tests (because it's like 5% the size of MHSW and therefore easier to test) and it doesn't seem to break anything for my editor, and the same number of files pass tests afterwards, so no issues there.

rszRE2.json changes there look a lot like this:
image

It does need some minor fixing for MHWS, but it didn't take too long, and actually passes more tests now (64213 -> 64303, count slightly doubled because of separate read/write tests).
(If I just blacklist the Struct type for now, everything generates fine.)

If anyone wants an example of the Struct type change for reMHWilds.json:
image

So, from an editor perspective, this appears to work better in the long run.

@praydog praydog merged commit d12ffb2 into praydog:master Nov 17, 2024
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.

3 participants