Commit Graph

6 Commits

Author SHA1 Message Date
Robert Xiao
75744a31dc First whack at type structs for IDA.
This commit only includes instance field structs, not class
structs/vtables/static fields.
2020-06-29 22:10:45 +02:00
Robert Xiao
caa7eaf870 Improve MetadataUsages and add types for globals
- Add string contents to names of StringLiteral objects to improve
decompilation output
- Add string constants for metadata version < 19 via an enum (if you can
identify and type il2cpp_codegen_string_literal_from_index correctly,
all enums resolve nicely to their string contents)
- Add types to metadata usages and globals
- Send method definitions & method references through writeMethods
for consistency
2020-06-29 22:10:45 +02:00
Robert Xiao
359b99fded Automatically infer function ends in IDA.
The problem with using an end param in IDA is that IDA will quite
stupidly treat the function end as gospel even if it makes no sense
(e.g. a single "function" spanning many MB because there are no symbols
in between). Leaving out end, on the other hand, tells IDA there's a
function at a given starting address but lets IDA figure out the end by
itself, which it usually does correctly.
2020-06-29 22:10:45 +02:00
Robert Xiao
34f0d4ceef Add header files for every known Unity version.
We want to get types into the IDA output, and to do that we need
accurate types for the Il2Cpp structures. Unfortunately, some crucial
types like Il2CppClass change between versions without any corresponding
metadata changes, meaning that we have to manually identify the version
outside of the Inspector somehow (e.g. by looking at the version number
embedded in Unity asset files). This patch adds header files for *every*
known Unity version from 5.3.0 to 2019.3.8, merging them into version
ranges where header files don't change.

It also adds front-end support for supplying the version number in both
the CLI and GUI. The GUI is given the ability to guess the version
number approximately to reduce the number of choices presented to the
user.
2020-06-29 22:10:45 +02:00
Robert Xiao
7fce43aba0 Fix IDA writeUsages for metadata <19
This fixes a NullReferenceException that was being thrown for IDA script
generation for metadata 16 files (e.g. as generated by Il2Cpp v5.3.0f4).
2020-06-16 23:30:53 +02:00
Katy Coe
e971cb8502 Refactor solution layout 2020-02-06 02:51:42 +01:00