Commit Graph

102 Commits

Author SHA1 Message Date
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
Robert Xiao
ec6018d012 Add non-generic methods to TestGenerics
In order to select the correct generic type, model.GetGenericMethod is
changed to use Name (which includes generic parameters) instead of
BaseName. The tests for GenericMethodDefinitionInGenericClass* are also
changed to reflect the fact that the chosen methods are fully concrete.

TestGenerics now passes in its entirety.
2020-06-20 10:17:48 +02:00
Robert Xiao
3cd5af09fc Have TestRunner output IDA scripts too
This is done as a sanity check to make sure we aren't breaking IDA output.
2020-06-20 10:17:48 +02:00
Robert Xiao
dfabe9235d Use CollectionAssert for better test feedback.
For minor problems with the test output (e.g. one-line changes),
CollectionAssert.AreEqual will show the exact line which is changed, for
much better test feedback.
2020-06-20 10:17:48 +02:00
Robert Xiao
d2b5f9d48b Enable test parallelization for a nice speedup 2020-06-20 10:17:48 +02:00
Katy Coe
e2f42bd137 Tests: Update expected results 2020-06-19 14:57:37 +02:00
Robert Xiao
1c1f542107 Tests: Add new test assemblies for C# features (#36)
* Add new test assemblies for C# features

Three of these test assemblies go over several important features of C#,
organized by C# language version. PartialGenericTypes stresses closed
and partially closed generics. Finally, VTablesAndLayout tests the
layout of classes when translated to C++, and also contains code which
calls vtable and interface functions to test reverse engineering.

* Tests: Update .csproj

* Tests: Update .csproj

Co-authored-by: Katy Coe <djkaty@users.noreply.github.com>
2020-06-19 14:52:09 +02:00
Katy Coe
3e1228495f Tests: Update expected results 2020-02-28 11:29:35 +01:00
Katy Coe
58771cf308 Tests: Update test results 2020-02-24 12:32:23 +01:00
Katy Coe
34cb2bc029 PS: More robust pathing in generate-binaries (Unity 2019.3-compat) 2020-02-13 06:09:52 +01:00
Katy Coe
e6c8be5e2b Move default excluded namespaces to Constants 2020-02-09 11:05:22 +01:00
Katy Coe
59568aba57 Tests: Update expected results 2020-02-06 02:51:54 +01:00
Katy Coe
e971cb8502 Refactor solution layout 2020-02-06 02:51:42 +01:00
Katy Coe
c43f92b1e2 Tests: Add generic method MethodSpec tests to TestGenerics 2020-02-02 22:41:18 +01:00
Katy Coe
60202e72a5 Tests: Update expected results (improved method end address detection) 2020-02-02 09:42:55 +01:00
Katy Coe
759a77031e Model: Substitute concrete parameter types into generic methods from MethodSpecs 2020-02-02 04:45:43 +01:00
Katy Coe
cfb384e22a Tests: Add generic method unit tests 2020-02-02 01:07:19 +01:00
Katy Coe
6f830fd909 Tests: Update TestNames for new internal generic method signatures 2020-02-02 01:06:14 +01:00
Katy Coe
f04604edc7 Tests: Include array of derived closed generic type in GenericTypes 2020-01-30 08:00:58 +01:00
Katy Coe
871c368e49 Model: Implement GenericParameterPosition for TypeRefs 2020-01-29 08:46:46 +01:00
Katy Coe
4c29821ee0 Add UnityEditor and JetBrains.Annotations to default ignored namespaces 2020-01-21 02:42:21 +01:00
Katy Coe
054b3641ca Output: Exclude AOT namespace by default 2020-01-18 21:32:20 +01:00
Katy Coe
64b263bafb IL2CPP: Merge attribute and method pointers, improve attribute function end addresses 2020-01-18 20:28:53 +01:00
Katy Coe
0b868aae36 IL2CPP: Fix field offsets for certain 64-bit binaries (#10) 2020-01-06 08:54:52 +01:00
Katy Coe
f10d52bdd2 PS: Replace all non-word characters in test function names 2019-12-12 09:05:13 +01:00
Katy Coe
88be17003e Output: Don't include nested generic type parameters in generic type usages (CS0305) 2019-12-11 12:34:36 +01:00
Katy Coe
b8df3d7100 Output: Handle explicit interface implementation of indexers correctly 2019-12-11 10:27:52 +01:00