Commit Graph

109 Commits

Author SHA1 Message Date
LukeFZ
6ddbf7ecae add initial support for required forward references in il2cpp types, also fix issues with type names clashing with il2cpp api types 2025-07-25 21:20:04 +02:00
LukeFZ
ffb1996252 smaller tweaks, hack around loops in cpp type layouting 2025-02-08 17:40:15 +01:00
Luke
b05c03964a Struct reading and disassembly script overhaul, various misc. loading fixes, bump to .NET 9 (#13)
* Bump projects to .net 9 and update nugets

* add VersionedSerialization + source generator

* migrate versioning to StructVersion class, add handling/detection for 29.2/31.2

* add new struct definitions

* rename serialization methods and add BinaryObjectStreamReader for interop

* Rework metadata struct loading to use new struct versioning

* move 29/31.1/.2 to use tags (-2022,-2023) instead of minor versions

* fix metadata usage validity checks

* rework code registration offsetting a bit and add second 29/31.1 condition

* tweak .1 condition (again)

* 29/31.2 was a psyop

* also remove 29.2 from the readme

* remove loading of packed dlls - this was a very unsafe feature

* support auto-recovering type indices from type handles
fixes loading of memory-dumped v29+ libraries since those replacee their class indices on load with a pointer to the corresponding type

* support loading PEs without an export table

* also read UnresolvedVirtualCallCount on regular v31

* Disable plugin loading for now

* Overhaul disassembler script + add Binary Ninja target (#12)

* Overhaul diassembler scripts:
- No longer defines top level functions
- Split into three classes: StatusHandler (like before), DisassemblerInterface (for interfacing with the used program API), ScriptContext (for definiting general functions that use the disassembler interface)
- Add type annotations to all class methods and remove 2.7 compatibility stuff (Ghidra now supports Python 3 so this is unnecessary anymore)
- Disassembler backends are now responsible for launching metadata/script processing, to better support disassembler differences
- String handling is back in the base ScriptContext class, disassembler interfaces opt into the fake string segment creation and fall back to the old method if it isn't supported

* Add Binary Ninja disassembler script backend
This uses the new backend-controlled execution to launch metadata processing on a background thread to keep the ui responsive

* make binary ninja script use own _BINARYNINJA_ define and add define helpers to header

* Update README to account for new script and binary ninja backend

* implement fake string segment functions for binary ninja but don't advertise support

* also cache API function types in binary ninja backend

* fix ida script and disable folders again

* Fix metadata usage issues caused by it being a value type now

* make TryMapVATR overrideable and implement it for ELFs

* Make field offset reading use TryMapVATR to reduce exceptions

* Fix NRE in Assembly ctor on < v24.2

* Update actions workflow to produce cross-platform CLI binaries, update readme to reflect .net 9 changes

* workflow: only restore packages for projects that are being built

* workflow: tweak caching and fix gui compilation

* workflow: remove double .zip in CLI artifact name

* 29/31.2 don't actually exist, this logic is not needed
2024-11-14 14:32:11 +01:00
LukeFZ
87766f6f96 Add support for metadata version 29.2 and 31 2024-06-24 18:41:14 +02:00
LukeFZ
939bedac57 Skip function boundaries when a .pdata segment is detected, add (very slow) folder creation which is disabled by default 2024-02-13 15:02:16 +01:00
LukeFZ
ef56ebbd2f Fix header generation when a struct contains an enum pointer 2023-12-07 20:53:03 +01:00
LukeFZ
5b1d9c67d1 Add name mangling to Methods/MethodInfo/TypeInfo/TypeRef, remove Boxing from ValueTypes when used as the this parameter, fix crashes when a module has no attributes 2023-12-06 20:09:35 +01:00
LukeFZ
e9434f4cad Add better il2cpp_array_size_t definition for script outputs in versions post 2017.2.1, fix some other cpp gen issues 2023-12-02 11:22:32 +01:00
LukeFZ
7e7d345c30 Add support for ThreadStatic fields 2023-12-01 07:08:48 +01:00
LukeFZ
ab841ccb2b Optimize some of the string operations 2023-11-30 05:13:19 +01:00
LukeFZ
7c8e0eee3e Add new headers 2023-11-29 19:49:26 +01:00
Katy Coe
b4ed297c93 Unity: Add headers for 2018.4.32-33, 2019.4.21-24, 2020.2.4-3.3, 2021.1.0-2 (24.5, 27.2) 2021-04-12 17:15:18 +02:00
Katy Coe
72b26196af Unity: Update headers for 2019.4.19-20, 2020.2.3-4 2021-02-15 15:02:30 +01:00
Katy Coe
712e21e735 Unity: Update version ranges (2018.4.31, 2019.4.18) 2021-01-29 20:37:35 +01:00
Katy Coe
361f5179d5 Unity: Allow version selection from asset file 2021-01-11 02:30:26 +01:00
Katy Coe
382495d0c7 Unity: Fix 'abstract declaration' error in IDA header parsing 2021-01-04 21:00:27 +01:00
Katy Coe
71be0f2af2 Update year in copyright messages 2021-01-04 05:26:43 +01:00
Katy Coe
956cea0553 C++: Output C++ enums as enum classes 2021-01-04 05:14:11 +01:00
Katy Coe
b76d14b113 C++: Don't output negative enum values in hexadecimal 2021-01-04 04:53:26 +01:00
Katy Coe
b02db857c7 C++: Make C enum field type match underlying type 2021-01-04 04:18:50 +01:00
Katy Coe
c00b474f33 IL2CPP: Change metadata and binary to derive from BinaryObjectStream 2020-12-21 06:37:29 +01:00
Katy Coe
8ae727852f Unity: Fix crash when comparing open-ended latest version 2020-12-20 23:24:59 +01:00
Katy Coe
37f0610eda Unity: Update for 2018.4.30, 2019.4.16, 2020.1.15-17, 2020.2.0+ 2020-12-19 19:47:14 +01:00
Katy Coe
4e4f794376 IL2CPP: Handle ROT encryption of API exports 2020-12-10 21:25:13 +01:00
Katy Coe
4fb805223b C++: Include metadata-global.dat structs in v27 headers 2020-11-26 21:45:20 +01:00
Katy Coe
479aeb7bcd IL2CPP: Implement Il2CppAssemblyNameDefinition change (metadata v24.4) 2020-11-26 21:42:03 +01:00
Katy Coe
ccf56385d8 C++: Include MemoryInformation.h in Unity headers (#100) 2020-11-26 12:30:21 +01:00
Katy Coe
4a22a33dc3 C++: Fix self-referential structs not working in Ghidra 2020-11-26 11:36:38 +01:00
Katy Coe
d67ef3e5ed C++: Fix "_extension" is a reserved word in Ghidra (#102) 2020-11-26 10:20:42 +01:00
Katy Coe
65cf69741d Unity: Update headers 2020-11-24 14:06:53 +01:00
Katy Coe
76825f231b C++: Include IL2CPP intrinsics of .NET managed types (#79) 2020-10-07 08:00:42 +02:00
Katy Coe
9746a6f4a8 C++: Include primitive types in reserved name list 2020-10-07 05:49:06 +02:00
Katy Coe
0c983fcebd C++: Allow parsing enums with negative values 2020-09-24 12:46:15 +02:00
Katy Coe
d26b2d91a8 C++: Types with enum fields will be output in a way that preserves alignment (#62) 2020-09-10 16:06:35 +02:00
Katy Coe
4a2cc55cb6 C++: Handle C and C++ versions of enum type definitions correctly (#62) 2020-09-09 19:06:09 +02:00
Katy Coe
eba76fcf15 C++: Add many new reserved IDA keywords (#57, #62) 2020-09-02 09:18:19 +02:00
Katy Coe
2024a3bfac AppModel: Add WordSizeBytes; tidy up a bit 2020-08-17 02:49:01 +02:00
Katy Coe
92d549081e C++: Correctly handle nested function pointer definitions 2020-08-17 01:14:29 +02:00
Katy Coe
86dd475a56 C++: Fix bugs handling whitespace and typedef struct * 2020-08-16 01:08:18 +02:00
Katy Coe
2723657ee2 C++: Add headers for Unity 2020.2.0a19 (as Unity 2020.2.0) 2020-08-16 00:29:01 +02:00
Katy Coe
ca55125858 Rename AppModel.ILModel to AppModel.TypeModel 2020-08-14 02:18:53 +02:00
Katy Coe
4dd3e7cb92 C++: Add GetType no-alias option and GetComplexType 2020-08-13 06:56:28 +02:00
Katy Coe
75de69e338 C++: Fix calculation of alignment for some structs 2020-08-13 06:56:05 +02:00
Katy Coe
8609523eba C++: Allow typedef aliases to be retrieved from CppTypeCollection indexer 2020-08-13 03:42:15 +02:00
Katy Coe
0c998de844 C++: Fix incorrect field alignment for 2/4/8-byte simple types 2020-08-13 03:41:49 +02:00
Katy Coe
f9c236f143 Unity: Add equality implementation for UnityVersionRange, UnityHeaders 2020-08-07 04:56:47 +02:00
Katy Coe
15fb96ba9a Unity: Over-extend LTS version numbers (2018.4.x and 2019.4.x) 2020-08-06 04:55:30 +02:00
Katy Coe
6770bc2865 C++: Fix System.Array is not itself an array (it's a class) (fix Array__Class * error in Ghidra) 2020-08-05 08:45:45 +02:00
Katy Coe
4ae6772f5a C++: Remove windows.h macros/types from reserved words list 2020-08-01 05:24:07 +02:00
Katy Coe
adb8594620 C++: Don't output enum underlying types (C compat) 2020-07-28 02:20:53 +02:00