mirror of
https://github.com/morluto/rea.git
synced 2026-12-04 05:51:06 +00:00
refactor(il2cpp): pair member table widths with their sections (#16432)
This commit is contained in:
1 parent
1586825b62
commit
4f4ff767e8
1 file changed
+7
-14
@@ -38,24 +38,17 @@ export const readIl2cppMemberTables = ({
|
||||
parameters: 8 + typeIndexWidth,
|
||||
stringLiterals: indexing === "counted" ? 4 : 8,
|
||||
};
|
||||
const literalRecords = checkedSectionCount(
|
||||
section("stringLiterals"),
|
||||
recordBytes.stringLiterals,
|
||||
);
|
||||
const recordCount = (name: keyof typeof recordBytes) =>
|
||||
checkedSectionCount(section(name), recordBytes[name]);
|
||||
const literalRecords = recordCount("stringLiterals");
|
||||
return {
|
||||
recordBytes,
|
||||
literalRecords,
|
||||
counts: {
|
||||
fields: checkedSectionCount(section("fields"), recordBytes.fields),
|
||||
properties: checkedSectionCount(
|
||||
section("properties"),
|
||||
recordBytes.properties,
|
||||
),
|
||||
events: checkedSectionCount(section("events"), recordBytes.events),
|
||||
parameters: checkedSectionCount(
|
||||
section("parameters"),
|
||||
recordBytes.parameters,
|
||||
),
|
||||
fields: recordCount("fields"),
|
||||
properties: recordCount("properties"),
|
||||
events: recordCount("events"),
|
||||
parameters: recordCount("parameters"),
|
||||
string_literals:
|
||||
indexing === "counted"
|
||||
? Math.max(literalRecords - 1, 0)
|
||||
|
||||
Reference in new issue
Block a user