Commit Graph

39 Commits

Author SHA1 Message Date
LukeFZ
67bb15d7a2 fix il2cpp_array_size_t not being an actual type for later method definitions 2025-07-25 21:38:05 +02:00
LukeFZ
48473e9247 reduce clang errors for header file, fix better array size struct, emit required forward definitions in header 2025-07-25 21:21:10 +02: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
42d97813df Fix idaclang support for 8.3 2024-02-16 09:49:00 +01:00
LukeFZ
55532fdc8a Overhaul IDA script output and add progress waitbox 2024-02-13 06:48:36 +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
Katy Coe
8da20a4afa IDA: Disable C++ (enum class errors) 2021-01-08 22:10:49 +01:00
Katy Coe
71be0f2af2 Update year in copyright messages 2021-01-04 05:26:43 +01:00
Katy Coe
4e4f794376 IL2CPP: Handle ROT encryption of API exports 2020-12-10 21:25:13 +01:00
Warpten
2493f9f160 C++: Add MethodInfo to scaffolding output (#84) 2020-11-24 13:59:35 +01:00
Katy Coe
85ab34f569 C++: Include unused concrete types in scaffolding output (#71) 2020-09-21 20:56:19 +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
a548fbb4f6 C++: Disable C4359 for 32-bit scaffolding 2020-09-09 18:49:58 +02:00
Katy Coe
d81cf7fef6 C++: Write IL2CPP metadata version to appdata/il2cpp-metadata-version.h 2020-09-09 17:38:05 +02:00
Katy Coe
fd4e61bacd AppModel/C++: Unused concrete value types were not included 2020-09-05 11:42:58 +02:00
Katy Coe
dde0b74831 C++: Don't overwrite contents of user/main.* in scaffolding 2020-09-02 05:02:48 +02:00
Katy Coe
2024a3bfac AppModel: Add WordSizeBytes; tidy up a bit 2020-08-17 02:49:01 +02:00
Katy Coe
eb55e5b527 AppModel/C++/JSON/Script: Don't output generic method definitions (no compiled code) 2020-08-04 05:14:19 +02:00
Katy Coe
c22227441e C++: Output .vcxproj.filters file for solution folder structure 2020-08-01 17:03:44 +02:00
Katy Coe
8372afd619 C++: Rename il2cpp-api-functions-ptr.h and il2cpp-types-ptr.h 2020-08-01 16:56:11 +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
c6175989cf C++: Add #pragma to disable MSVC C4309 enum truncation warnings 2020-08-01 03:35:07 +02:00
Katy Coe
4978348d8f C++/IDA: Output text files as ASCII instead of UTF8 (Ghidra fix) 2020-07-28 04:13:43 +02:00
Katy Coe
7fa80a4848 C++: Allow il2cpp-types.h to be output independently; include conditional disassembler pre-amble 2020-07-28 02:26:15 +02:00
Katy Coe
59f5083235 C++: Add #pragma to disable MSVC C4369 enum range warnings 2020-07-25 16:55:40 +02:00
Katy Coe
44a5fe009a C++: Output il2cpp-api-functions.h with unavailable exports elided 2020-07-24 17:20: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
ccb401bb12 IL2CPP: Add Binary.GetAPIExports() 2020-07-20 17:09:19 +02:00
Katy Coe
386a666fff C++: Output DLL injection boilerplate project 2020-07-19 15:44:26 +02:00
Katy Coe
f7d2dd6e2d C++: Output method pointers and signatures 2020-07-18 21:47:33 +02:00
Katy Coe
6d50ab7546 C++: Output Il2CppClass* (TypeInfo) pointers 2020-07-18 21:23:23 +02:00
Katy Coe
7124149fef C++: Output IL2CPP API function pointers 2020-07-18 19:47:45 +02:00
Katy Coe
632d1d2d9b C++: Generate output in a folder 2020-07-18 19:18:08 +02:00
Katy Coe
0808fe966a AppModel: IDA output integration; item groups 2020-07-16 12:37:39 +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
117a440b58 Outputs: Fix C++ output crash for il2cpp versions <19 2020-07-02 20:08:53 +02:00
Katy Coe
24e4c65c4c Outputs: Add MSVC/GCC option to CppScaffolding and CLI 2020-07-02 15:18:15 +02:00
Katy Coe
c59245ec56 Outputs: Add C++ output module 2020-07-02 14:21:40 +02:00