Commit Graph

566 Commits

Author SHA1 Message Date
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
ce4d2792b8 Update README.md 2020-06-18 17:12:12 +02:00
Katy Coe
f79d4b7aad Update README.md 2020-06-18 16:52:01 +02:00
Katy Coe
d38620a7d7 GUI: Add support for opening APK and IPA package files 2020-06-18 16:45:32 +02:00
Katy Coe
5bcce0ca0a CLI: Allow -i to accept APK or IPA package files 2020-06-18 16:44:31 +02:00
Katy Coe
5baf8cdc2d IL2CPP: Add APK and IPA package extraction API
Add LoadFromStream, LoadFromPackage, GetStreamsFromPackage
2020-06-18 16:43:48 +02:00
Katy Coe
08937ead3a MachO: Throw an exception if file is encrypted with FairPlay DRM 2020-06-18 16:41:57 +02:00
Katy Coe
d668cd3685 Update .gitignore 2020-06-18 16:40:43 +02:00
Robert Xiao
5d57b76735 Move index decoding to MetadataUsage
This reduces code duplication between metadata usage index decoding and
vtable method index decoding.
2020-06-17 08:18:15 +02:00
Robert Xiao
d426dad820 Add support for parsing and interpreting VTables
This prepares for a future PR where we add types to the IDA script
output.
2020-06-17 08:18:15 +02:00
Robert Xiao
5224429b0a Fix {{ typo in CSharpCodeStubs 2020-06-17 08:18:15 +02:00
Robert Xiao
c9d65e5f2d Get 2019.3.7f1+ working by adding new '24.3' version
In 2019.3.7f1, the following fields were added to
Il2CppCodeRegistration:

     uint32_t interopDataCount;
     Il2CppInteropData* interopData;
+    uint32_t windowsRuntimeFactoryCount;
+    Il2CppWindowsRuntimeFactoryTableEntry* windowsRuntimeFactoryTable;
     uint32_t codeGenModulesCount;
     const Il2CppCodeGenModule** codeGenModules;

These two fields overlap the old codeGenModules fields, causing failures.
The current fix is simply to bump the version to 24.3 if these fields are
detected in order to get the correct codeGenModules pointer. Long term, a
better detection mechanism (probably based on examining the name string
pointer in codeGenModules[0]) will be necessary. However, this is pending
more samples of 2019.3.7+ for testing.
2020-06-16 23:30:53 +02:00
Robert Xiao
4f074837b7 Fix fieldOffsetsArePointers logic on 64-bit builds
The logic for fieldOffsetsArePointers was always reading 32-bit units
even on 64-bits. When fieldOffsetsArePointers is true, fieldOffsets is
declared as int32_t**, so each element *must* be a pointer and therefore
word-sized (64 bits on 64-bit machines). So it doesn't make sense to
only read 32-bit words for this test.

This fixes metadata extraction for 64-bit builds from Il2Cpp versions
5.3.7f1, 5.3.8f2, 5.4.1f1, 5.4.2f2, 5.4.3f1, 5.4.4f1, 5.4.5f1 and
5.4.6f3. Notably, 5.4.0f3 is an unusual outlier which uses int32_t * for
fieldOffsets.
2020-06-16 23:30:53 +02:00
Robert Xiao
02fab932ae referencedAssemblies was added in v5.3.3 (metadata 20)
According to the headers I have available, Unity v5.3.2f1 (metadata 19)
lacks the referencedAssemblies{Offset,Count} fields in
Il2CppGlobalMetadataHeader. These appear to have been added some time
between that version and 5.3.3f1 (metadata 20).

Changing these fields makes the Inspector work properly on the output from
Il2Cpp from Unity v5.3.2f1.
2020-06-16 23:30:53 +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
Robert Xiao
5b78fc3f3c Fix pointer extraction for MSVC in metadata <21.
This change causes the Inspector to properly parse DLLs generated with
Il2Cpp versions 5.3.0f4 through 5.3.4f1 (excluding 5.3.2f1, which is a
separate problem).
2020-06-16 23:30:53 +02:00
Katy Coe
b9dffd3500 Allow divergent metadata/binary versions
Il2CppInspector reports the highest version of the two
2020-06-16 23:27:51 +02:00
Katy Coe
0f2fff6e70 Tidy up error handling slightly 2020-06-16 23:08:15 +02:00
Katy Coe
d16db6f1f5 X64: Fix R8 unused compile warning 2020-06-16 23:07:42 +02:00
Katy Coe
89b3c2b3aa ELF: Detect a specific type of packing that isn't handled 2020-06-16 23:07:01 +02:00
Katy Coe
0b9b5022ab CLI: Fix regression causing Windows path search to fail 2020-06-16 23:06:08 +02:00
Katy Coe
370eebfffc ELF: Slightly more careful XOR decryption (#27) 2020-06-16 21:53:57 +02:00
Katy Coe
5e435465f1 ELF: Don't crash on duplicate section names (#26) 2020-06-16 15:35:17 +02:00
Callie LeFave
dee6c45056 Fix CSharp output paths on POSIX filesystems 2020-06-16 12:25:10 +02:00
Katy Coe
3e1228495f Tests: Update expected results 2020-02-28 11:29:35 +01:00
Katy Coe
40ab603c56 C#: Don't output field offsets for open generic types 2020-02-28 11:01:38 +01:00
Katy Coe
c0e90f2e9c IL2CPP: Fix field offsets for value types (#25) 2020-02-28 11:01:26 +01:00
Katy Coe
a5a5d66182 Update README.md 2020-02-26 15:38:51 +01:00
Katy Coe
c540318363 Update version to 2.1 2020-02-26 15:38:45 +01:00
Katy Coe
b961db78f2 SELF: Initial support for PRX/SPRX files (issue #21) 2020-02-26 02:59:02 +01:00
Katy Coe
e4034e6a39 SELF: More boilerplate code 2020-02-25 16:15:37 +01:00
Katy Coe
b509b4d227 SELF: Boilerplate code 2020-02-25 16:15:17 +01:00
Katy Coe
250c3a2fc9 Loader: Unwrap FileFormatReader.Load exceptions 2020-02-24 13:37:06 +01:00
Katy Coe
58771cf308 Tests: Update test results 2020-02-24 12:32:23 +01:00
Katy Coe
027dde8358 C#: Replace "in, out" with "[In, Out]" (CS8328) 2020-02-24 12:28:38 +01:00
Katy Coe
168c955558 C#: Set static and instance constructor defaults correctly (CS0120) 2020-02-24 12:24:04 +01:00
Katy Coe
6046f2493d C#: Reduce scope redundancies in type declarations 2020-02-24 12:05:33 +01:00
Katy Coe
39bd356d85 GUI: Add .bin .prx .sprx to binary dialog filter 2020-02-24 10:11:48 +01:00
Katy Coe
39d1a95b37 GUI: Fix window height for 120% text size 2020-02-24 10:10:03 +01:00
Katy Coe
fc72003f9a Update README.md 2020-02-24 10:08:19 +01:00
Katy Coe
a4f5b5ac5c GUI: Add "Not a decompiler" dialog on startup 2020-02-24 10:06:18 +01:00
Katy Coe
3f72ff38c2 ARM: Allow R0-R2 in any order and any indirection (Unity 2019.3-compat) 2020-02-23 22:37:28 +01:00
Katy Coe
8bdea7780b X64: Handle mov before push in prologue (issue #23) 2020-02-23 20:49:34 +01:00
Katy Coe
55148e0271 Output: Add Mocrosoft.Reflection and Internal.Runtime to default exclusions 2020-02-15 06:38:03 +01:00
Katy Coe
538810f441 X64: Generalize Il2CppCodegenRegistration scan (part of #21) 2020-02-15 06:30:12 +01:00
Katy Coe
0a99f549ff X64: Generalize Codegen initializer search (part of #21) 2020-02-15 05:19:54 +01:00
Katy Coe
6ec5c06fbc X64: Handle DT_INIT-style initializer (part of #21) 2020-02-15 03:55:03 +01:00
Katy Coe
ee93343ff8 ELF: Fix DT_INIT from GetFunctionTable() wasn't mapped to file offset 2020-02-14 15:11:29 +01:00
Katy Coe
164535ad6a Merge branch 'master' of https://github.com/djkaty/Il2CppInspector 2020-02-13 18:49:45 +01:00