Commit Graph

133 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
72e8bb352c Satan is happy with our progress 2020-07-05 13:24:54 +02:00
Katy Coe
3db319711c C++: Many small quality-of-life code improvements 2020-07-05 04:02:43 +02:00
Katy Coe
2412da4f8b C++: Add boilerplate for CppApplicationModel 2020-07-04 23:41:30 +02:00
Katy Coe
6c6f72618a C++: Split CppType, CppField, CppTypes into separate files 2020-07-04 17:10:09 +02:00
Katy Coe
e3043f63c4 C++: Implement "o" string format for offsets and sizes 2020-07-04 16:52:19 +02:00
Katy Coe
dd47ed7203 C++: Properly implement function pointers + tidying up / minor fixes 2020-07-04 16:14:36 +02:00
Katy Coe
91b93f3263 C++: Implement enums 2020-07-04 13:03:23 +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
46f2b9eb53 C++: Fix FromUnityVersion not forwarding wordSize 2020-07-04 02:30:50 +02:00
Katy Coe
9e72412230 C++: Handle function pointers 2020-07-04 02:30:50 +02:00
Katy Coe
9ee8065d57 C++: Fix assembly resource location bug 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
8f56aea002 C++: Handle #ifdef IS_XXBIT, allow word size argument 2020-07-04 02:30:49 +02:00
Katy Coe
14b7d09e9d C++: Handle comma-separated fields 2020-07-04 02:30:49 +02:00
Katy Coe
b38a348709 C++: Handle enum prefix in field 2020-07-04 02:30:49 +02:00
Katy Coe
727cabe0db C++: Parse __attribute((aligned(X))) 2020-07-04 02:30:49 +02:00
Katy Coe
f6e4c6eb09 C++: Parse array fields 2020-07-04 02:30:49 +02:00
Katy Coe
630b0a771d C++: Implement bitfields 2020-07-04 02:30:49 +02:00
Katy Coe
29c9514fdf C++: Handle unsigned/volatile, improve output, typedefs, regexes 2020-07-04 02:30:49 +02:00
Katy Coe
65b9bb2349 C++: Improve handling of multiple pointer indirection and typedefs 2020-07-04 02:30:49 +02:00
Katy Coe
5259374f83 C++: Improve handling of pointers 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
d8aaba375e C++: Parse typedef struct definitions and nested types as fields 2020-07-04 02:30:49 +02:00
Katy Coe
f407cb94df C++: Add parse loop, implement typedef alias parsing 2020-07-04 02:30:49 +02:00
Katy Coe
bee75fc6b1 C++: Add boilerplate for type parsing 2020-07-04 02:30:49 +02:00
Katy Coe
93fed266ea PE: Add ability to fetch exports with GetExports() 2020-07-03 19:50:46 +02:00
Katy Coe
117a440b58 Outputs: Fix C++ output crash for il2cpp versions <19 2020-07-02 20:08:53 +02:00
Katy Coe
7f4c4cb14d Update version to 2020.1 2020-07-02 16:49:32 +02:00
Katy Coe
24e4c65c4c Outputs: Add MSVC/GCC option to CppScaffolding and CLI 2020-07-02 15:18:15 +02:00
Katy Coe
0731b380fd C++: Separate compiler option from CppDeclarationGenerator 2020-07-02 15:17:12 +02:00
Katy Coe
c59245ec56 Outputs: Add C++ output module 2020-07-02 14:21:40 +02:00
Katy Coe
249873ab02 C++: Add some MSVC symbols to reserved names 2020-07-02 14:21:21 +02:00
Katy Coe
23db04c369 Minor re-organization 2020-06-30 00:13:18 +02:00
Katy Coe
18b94e08f3 Add CppDeclarationGenerator.Reset() 2020-06-30 00:06:07 +02:00
Katy Coe
a5d15f3daa Fix enum renaming on 2nd use in C++ declarations 2020-06-30 00:05:27 +02:00
Katy Coe
a3a0c17ee1 Dramatically improve startup speed when not using APK/IPA 2020-06-30 00:03:37 +02:00
Robert Xiao
9e455fdabe Renaming for clarity.
Renamed the class CppDeclarations => CppDeclarationGenerator to better reflect
its function and emphasize its statefulness.

Renamed Visit{Type,Method} => Include{Type,Method} to clarify that these methods
include the type or method into the generator state.

Renamed GenerateVisitedTypes => GenerateRemainingTypeDeclarations to clarify
that it outputs *remaining* declarations, i.e. declarations that haven't been
generated yet.
2020-06-29 22:10:45 +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
de6d9e2230 Move duplicated sanitizeIdentifier to Extensions
Also ensure that the identifier always starts with an underscore or
letter, which fixes issues with obfuscated identifiers.
2020-06-29 22:10:45 +02:00
Robert Xiao
95ee085374 Comments and minor refactoring into lambdas 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
b7c93ffcc7 Type string literals as System.String 2020-06-29 22:10:45 +02:00
Robert Xiao
67acd18c03 Finish types implementation: vtables and classes.
Also fix a few minor bugs involving arrays and enums. Both should not
have __Class structures generated.
2020-06-29 22:10:45 +02:00
Robert Xiao
930202dfdd Handle idc.SetType return value correctly.
Apparently, idc.SetType returns True if the type is set for the first
time, False if the type is updated, and None if the type couldn't be set
(rather differently from what the documentation says).
2020-06-29 22:10:45 +02:00
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
4ba48b9c75 Add generics support to TypeInfo.GetVTable
This patch fixes TypeInfo.GetVTable so that it specializes the vtable
for generic type instances. Also fix a minor bug in PropertyInfo that
would pass null pointers to GetMethodByDefinition.
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