Commit Graph

128 Commits

Author SHA1 Message Date
Katy Coe
95d88e60d7 AppModel: Build model by default in constructor 2020-08-15 02:34:19 +02:00
Katy Coe
f12d4bb98f Tests: Add AppModel Il2CppType* lookup tests 2020-08-14 03:12:02 +02:00
Katy Coe
9fd64fabf9 Tests: Update expected results 2020-08-13 09:14:53 +02:00
Katy Coe
a659c429b0 Tests: Add TestAppModelQueries 2020-08-13 08:01:03 +02:00
Katy Coe
d1aafee184 Tests: Update incorrect CppTypeDeclaration test and add alignment tests 2020-08-13 06:57:41 +02:00
Katy Coe
5abc20dc7a Tests: Updated expected results 2020-08-08 05:27:47 +02:00
Katy Coe
86dec121e5 Tests: Remove .py expected results; update .h expected results 2020-08-04 04:27:44 +02:00
Katy Coe
e4911c9d7d Tests: Add JSON expected results 2020-08-04 04:27:03 +02:00
Katy Coe
6823e37e83 Tests: Remove .py generation from TestRunner and update-expected-results 2020-08-04 04:25:55 +02:00
Katy Coe
5c2e06daee IDA: Refactor to use universal script and JSON metadata 2020-08-04 02:32:16 +02:00
Katy Coe
19a5b3735b Update TestRunner and update-expected-results.ps1 2020-08-02 22:19:31 +02:00
Katy Coe
5c97202d8e C++: Significant iteration of scaffolding output (see commit description)
Generate pre-compiled headers for IL2CPP types and functions
Resolved naming conflicts with functions and macros from windows.h
IL2CPP app functions and TypeInfos were incorrectly placed in global namespace instead of 'app'
Added /MP compiler option (multi-processor compilation)
Split source files into folders
Move GetBaseAddress() into helpers.cpp
Add NewConsole() to helpers.cpp
Move init_il2cpp() from IL2CPP declarations header to own source file
Refactor some header files for consistency and duplicate elimination
2020-08-01 05:23:44 +02:00
Katy Coe
7b9c28fdf3 IDA: Don't produce C type header file if it's already available 2020-07-28 19:23:53 +02:00
Katy Coe
8b2c254235 Tests: Update expected results 2020-07-25 17:24:39 +02:00
Katy Coe
dd5a4a29e7 Tests: Update expected results 2020-07-25 16:04:43 +02:00
Katy Coe
cdc02cb475 Tests: Update UnityVersions test 2020-07-25 15:30:57 +02:00
Katy Coe
d09d53cc67 Tests: Target MSVC for C++ projects 2020-07-24 17:24:37 +02:00
Katy Coe
deeb8daa97 Unity/C++: Significant re-factoring of Unity header management (see description)
Extract resource handling to UnityResource
Add API header resource helpers
Fix UnityVersion ToString() when Min == Max
Replace fixed list of Il2Cpp header reserved names with parsed names from actual selected headers (solves TypeInfo/MemberInfo problems in 5.3.0-5.3.4 (metadata v16-20))
Use CppDeclarationGenerator when initializing CppTypeCollection to ensure all Il2Cpp header symbols are reserved
Process API headers in CppTypeCollection.FromUnityHeaders
Move #define IS_32BIT handling to UnityHeaders
Update tests
2020-07-22 19:01:33 +02:00
Katy Coe
a4d3ae8dc9 Tests: Update expected results 2020-07-20 20:19:33 +02:00
Katy Coe
64fbee92b0 Tests: Fix copy il2cpp-types.h from wrong location in update-expected-results.ps1 2020-07-20 20:18:45 +02:00
Katy Coe
58309b9943 Tests: Provide more detailed mismatch reporting in TestRunner 2020-07-20 17:12:55 +02:00
Katy Coe
632d1d2d9b C++: Generate output in a folder 2020-07-18 19:18:08 +02:00
Katy Coe
43085eb6f2 Tests: Update expected results 2020-07-18 04:56:32 +02:00
Katy Coe
5e69095e89 Tests: Update expected results 2020-07-12 19:32:28 +02:00
Katy Coe
a9606f5c9e Tests: Make TestRunner show the line number of first mismatch 2020-07-12 19:32:03 +02:00
Katy Coe
d8d4f55d3a Tests: Update expected results 2020-07-09 03:49:45 +02:00
Katy Coe
873a6c98f6 AppModel: First iteration of ApplicationModel API
Integrate with C++ scaffolding
Add new tests
Rename Il2CppModel to TypeModel
Incomplete IDAPython integration
CLI and GUI support
Update README.md
2020-07-09 03:48:50 +02:00
Katy Coe
9fff9678aa Tests: Compare IDAPython and C++ scaffolding files as well as C# stubs in TestRunner 2020-07-06 20:23:43 +02:00
Katy Coe
a37bc05db1 Tests: Include IDAPython and C++ scaffolding in TestExpectedResults 2020-07-06 19:59:44 +02:00
Katy Coe
3db319711c C++: Many small quality-of-life code improvements 2020-07-05 04:02:43 +02:00
Katy Coe
a9d002fd78 C++. Compatibility fixes for release 2020.1 2020-07-04 02:30:50 +02:00
Katy Coe
4ca640d551 C++: CppTypes add enumerators & indexers, flattened fields, force sorting, update test 2020-07-04 02:30:50 +02:00
Katy Coe
8a85acb242 C++: Various tweaks
Indent output
Handle bool fields
Skip comments and methods
Check that every line that matters is parsed
Update test to check every Unity version
2020-07-04 02:30:50 +02:00
Katy Coe
630b0a771d C++: Implement bitfields 2020-07-04 02:30:49 +02:00
Katy Coe
ee2f851a1a C++: Finish initial draft of header parsing 2020-07-04 02:30:49 +02:00
Katy Coe
a48720796c Tests: Add test stub for CppTypes 2020-07-04 02:30:49 +02:00
Katy Coe
25d19457a9 Tests: Make TestRunner output C++ headers 2020-07-02 14:21:56 +02:00
Katy Coe
6c45e5867c Tests: Rename TestIDAOutput -> TestUnityVersion 2020-07-01 13:06:33 +02:00
Katy Coe
23db04c369 Minor re-organization 2020-06-30 00:13:18 +02:00
Robert Xiao
393d26b2a3 Move non-output to new CppUtils namespace
We prefer to have the Outputs directory contain just one file or
namespace per output module, so we'll move all C++-related stuff to a
new CppUtils namespace instead.
2020-06-29 22:10:45 +02:00
Robert Xiao
3ccbab2461 Add/modify copyright notices 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
Katy Coe
b87d82fd11 Tests: Fix missing tests regression 2020-06-27 11:43:21 +02:00
Katy Coe
955bc2a9ac Tests: Update expected results 2020-06-24 10:38:34 +02:00
Katy Coe
5b62a72897 Tests: Save generated C++ in TestCpp 2020-06-24 10:38:13 +02:00
Katy Coe
ec922ac9ec Tests: Add ARM64 binary generation 2020-06-24 09:17:18 +02:00
Robert Xiao
4207464208 Add events, fields and properties to concrete generics.
This basically finishes the concrete generics implementation. We can now
enumerate all members of a concrete generic type with full type
substitution implemented.

Also add a simple test to verify that we can obtain the correct type for
a field of a concrete generic type.
2020-06-20 10:17:48 +02:00
Robert Xiao
1a12567227 Fix method signature comparison.
Now that we generate methods in instantiated generic types, we were
getting test failures from methods that were being detected as new
methods. In actuality, they weren't new, but they differed only in
generic type parameters from some base type method, and
GetSignatureString ignores generic parameters completely.

This fix eliminates the hacky GetSignatureString and replaces it with
more-or-less proper signature comparison. This even manages to fix an
incorrect test case from Methods.cs (because GetSignatureString was
incorrectly incorporating the return type - when the return type should
not be examined for signature checking).
2020-06-20 10:17:48 +02:00
Robert Xiao
867f559f18 Support BaseType and ImplementedInterfaces on generic params
This has been a little TODO for a while, and happily it's easy enough to
implement with TypeRef arrays.

Also implement ImplementedInterfaces for generic type instances via
substitution.
2020-06-20 10:17:48 +02:00
Robert Xiao
1970879e52 Implement proper generic parameter substitution
With this patch, generic parameters in BaseType and method param/return
types are substituted correctly and deeply. Next up will be to apply the
same substitution rules to fields, properties, events, ...
2020-06-20 10:17:48 +02:00