Commit Graph

122 Commits

Author SHA1 Message Date
Luke
3439ca912b Implement new GUI and CLI, fix misc. smaller issues (#22)
* Initial commit of new UI c# component

* Initial commit of new UI frontend component

* target WinExe to hide console window in release mode, move ui exe into resources

* force single file publishing and add initial gh workflow for publishing ui

* fix workflow errors

* update dependencies and remove cxxdemangler, as it was outdated

* fix c# single file output due to invalid output path

* smaller tweaks, hack around loops in cpp type layouting

* process other queued exports even if one fails and show error message

* add basic support for processing LC_DYLD_CHAINED_FIXUPS

* ELF loading should not use the file offset for loading the dynamic section

* fix symbol table loading in some modified elfs

* add "start export" button on format selection screen, clear all toasts after selecting an export format

* embed ui executable directly into c# assembly

* only build tauri component in c# release builds

* add il2cpp file (binary, metadata) export to advanced tab

* fix and enable binary ninja fake string segment support

* add support for metadata

* unify logic for getting element type index

* fix new ui not allowing script exports other than ida

* new ui: clear out loaded binary if no IL2CPP images could be loaded

* fix toAddr calls in ghidra script target

* remove dependency on a section being named .text in loaded pe files

* tweak symbol reading a bit and remove sht relocation reading

* add initial support for required forward references in il2cpp types, also fix issues with type names clashing with il2cpp api types

* reduce clang errors for header file, fix better array size struct, emit required forward definitions in header

* expose forward definitions in AppModel, fix issue with method-only used types not being emitted

* remove debug log line

* fix spelling mistakes in gui outputs

* fix il2cpp_array_size_t not being an actual type for later method definitions

* change the default port for new ui dev to 5000

* show current version and hash in new ui footer

* seperate redux ui impl into FrontendCore project

* make inspector version a server api, split up output subtypes and tweak some option names

* add redux CLI based on redux GUI output formats

* replace all Console.WriteLine calls in core inspector with AnsiConsole calls

* add workflow for new cli and add back old gui workflow

* disable aot publish and enable single file for redux cli
2025-08-15 21:13:32 +02:00
LukeFZ
5254c4b85a adjust v24.4<->v24.5 condition and update sln file 2024-11-17 23:20:50 +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
5b0476fcc5 add remaining 31.1/31.2 versioning conditions 2024-08-18 23:23:32 +02:00
LukeFZ
4ce4d0e799 backport 29/31 version fixes from new versioning branch 2024-08-18 23:20:49 +02:00
LukeFZ
87766f6f96 Add support for metadata version 29.2 and 31 2024-06-24 18:41:14 +02:00
Luke
396c222ac5 Tweak 29.1 heuristic 2024-06-24 14:18:49 +02: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
7120970ece Use actual size of static array initializers 2023-12-01 08:14:12 +01:00
LukeFZ
227aefedef simplify custom attribute logic a bit by always returning arrays as ConstantBlobArrayElement 2023-12-01 06:46:58 +01:00
LukeFZ
6aa96b431d Support reading and writing custom arguments for v29 2023-12-01 04:43:27 +01:00
LukeFZ
40201d6e84 Load tokens from AttributeDataRanges for v29 2023-11-30 21:38:06 +01:00
LukeFZ
d7067225fe fix Il2CppType definition for 27.2+ (better) 2023-11-30 21:37:17 +01:00
LukeFZ
ef1a5d1e83 Add BlobReader, fix Il2CppType for 27.2+ 2023-11-30 13:31:37 +01:00
LukeFZ
a4528e5f55 Add FieldRva MetadataUsage type and fix current heuristic 2023-11-30 05:15:01 +01:00
LukeFZ
a24fcb50bd use different late binding and image scan implementations 2023-11-29 21:34:49 +01:00
LukeFZ
8ffc7e0021 Add stuff for v29 2023-11-29 21:32:43 +01:00
LukeFZ
a6d9291303 add classes for ver 29, fix some stuff for v24 2023-11-29 21:22:51 +01:00
LukeFZ
e3e0382e8c forgot to commit the pointerSize decl 2023-11-29 21:20:26 +01:00
LukeFZ
96e466743d Fix 24.5 compatibility, check metadata from data first since thats more common now 2023-11-29 21:16:43 +01:00
Katy Coe
0844d4b6bd IL2CPP: Fix regression in Metadata.Sizeof relating to #148 2021-04-12 18:59:33 +02:00
Katy Coe
98157c99ed IL2CPP: Handle metadata v24.5 (Unity 2019.4.21-2019.4.24) (#148) 2021-04-12 17:53:31 +02:00
Katy Coe
0b3d065180 IL2CPP: Update struct layout for v24.5 (#148) 2021-04-12 17:22:15 +02:00
Katy Coe
55401a447f Formats: Don't crash on secondary load strategies with existing type mappings (#140) 2021-02-23 23:44:07 +01:00
Sam Byass
d8e9c60190 IL2CPP: Add metadata 27.1 structure layout (#139) 2021-02-16 12:48:06 +01:00
Katy Coe
cc0a0718df IL2CPP: Add basic validation to found CodeGenModule pointer (#137) 2021-02-12 14:04:30 +01:00
Katy Coe
f555ce40ff IL2CPP: Fix binary validation bug (typeDefinitionsSizes) 2021-01-15 16:33:27 +01:00
Katy Coe
c56bd26e4b IL2CPP: Abstract binary field order reconstruction to plugin 2021-01-12 14:31:14 +01:00
Katy Coe
5c66889e52 IL2CPP: Abstract metadata string decryption to plugin 2021-01-12 12:16:01 +01:00
Katy Coe
538078fcea IL2CPP: Add core plugin update reminder on failure 2021-01-12 12:10:07 +01:00
Katy Coe
c4cf6bb39c IL2CPP: Fix regression in TryPrepareMetadata 2021-01-12 12:09:44 +01:00
Katy Coe
c94fec41d7 IL2CPP: Abstract API export name decryption to plugin 2021-01-12 04:48:44 +01:00
Katy Coe
930b00f588 IL2CPP: Add plugin warning when failing to analyze 2021-01-12 01:10:30 +01:00
Katy Coe
52f477698e IL2CPP: Fix off-by-1 pointer error in non-PE x86/64 files (#123) 2021-01-11 19:13:28 +01:00
Katy Coe
71be0f2af2 Update year in copyright messages 2021-01-04 05:26:43 +01:00
Katy Coe
0ce0bbe74d Plugins: Add PreProcessBinary, PostProcessBinary, PostProcessAppModel 2020-12-29 21:32:54 +01:00
Katy Coe
14e80c3022 IL2CPP: Add statusCallback to LoadFromPackage and LoadFromFile 2020-12-26 22:41:38 +01:00
Katy Coe
e929d8d97e Plugins: Add LoadPipelineStarting / LoadPipelineEnding, rename IsHandled to FullyProcessed 2020-12-25 22:29:31 +01:00
Katy Coe
7f755d2282 IL2CPP: Allow more reversePInvokeWrappers (#117) 2020-12-24 05:08:19 +01:00
Katy Coe
4b53969ba0 IL2CPP: Don't read lock archive files when loading 2020-12-22 04:50:12 +01:00
Katy Coe
e7bcd41d84 GUI: Tidy up status messages a bit 2020-12-22 03:18:32 +01:00
Katy Coe
e058c39f19 Plugins: Add IPostProcessPackage 2020-12-22 03:17:49 +01:00
Katy Coe
b9409e7425 Plugins: Add hook TODOs 2020-12-21 23:02:32 +01:00
Katy Coe
3e27cd25e9 Plugins: Simplify event data; add GetStrings and GetStringLiterals 2020-12-21 22:54:01 +01:00
Katy Coe
fbc8e0950c IL2CPP: Use mapped objects for Sizeof 2020-12-21 22:03:43 +01:00
Katy Coe
70d0795c44 IL2CPP: Fix regression in buildLateBindingMetadataUsages() (v27) 2020-12-21 06:38:09 +01:00
Katy Coe
c00b474f33 IL2CPP: Change metadata and binary to derive from BinaryObjectStream 2020-12-21 06:37:29 +01:00
Katy Coe
9af53561cf IL2CPP: Improve buildLateBindingMetadataUsages performance 2020-12-20 23:24:26 +01:00
Katy Coe
c6e9e26111 Plugins: Add PluginEventInfo and IPostProcessMetadata 2020-12-20 23:24:09 +01:00
Katy Coe
64a7b26134 IL2CPP: Add Il2CppConstants.MetadataSignature 2020-12-20 21:06:46 +01:00