107 Commits

Author SHA1 Message Date
LukeFZ
a88e91451a add (untested) support for metadata v38 2025-08-22 04:53:00 +02:00
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
Luke
8403f8a62d Fix incorrect if condition in GetVTable causing them to all be empty 2024-11-19 00:13:26 +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
b21b6e89ab properly fix scoped name for generic arrays 2024-02-27 17:34:24 +01:00
LukeFZ
e328ed9b84 just check for FullName == null in getScopedFullname 2024-02-25 15:23:58 +01:00
LukeFZ
2a492e02ba Update getScopedFullName for generic params + update README 2024-02-25 11:32:20 +01:00
LukeFZ
1d2890961c Fix custom attribute parsing when a null array is used and when an assembly has no attributes 2023-12-07 20:52:06 +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
7120970ece Use actual size of static array initializers 2023-12-01 08:14:12 +01:00
LukeFZ
7e7d345c30 Add support for ThreadStatic fields 2023-12-01 07:08:48 +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
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
ab841ccb2b Optimize some of the string operations 2023-11-30 05:13:19 +01:00
LukeFZ
9f6309fb46 forgot to commit the if part 2023-11-29 21:39:24 +01:00
LukeFZ
8ffc7e0021 Add stuff for v29 2023-11-29 21:32:43 +01:00
LukeFZ
9f0d0476bb cache tyoes 2023-11-29 21:19:41 +01:00
Katy Coe
4d6686a063 Don't crash on 64-bit Flags enums with top bit set (#131) 2021-01-28 20:21:20 +01:00
Katy Coe
3a9a190530 Model: Fix GetType() and GetGenericMethod() with global namespace 2021-01-26 20:51:05 +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
cd7ddf193a Model: Implement MetadataToken property 2021-01-10 08:37:49 +01:00
Katy Coe
a007b128fb Model: Add MethodImplementationFlags 2021-01-08 22:23:29 +01:00
Katy Coe
e9a66b98d4 Model: Add PropertyAttributes 2021-01-08 22:23:29 +01:00
Katy Coe
bca8baceb9 Model: Copy member attribute flags directly 2021-01-08 22:23:29 +01:00
Katy Coe
71be0f2af2 Update year in copyright messages 2021-01-04 05:26:43 +01:00
Katy Coe
7c65d2c741 Model: Eliminate no-longer needed thread lock in CAD 2020-12-30 09:16:25 +01:00
Katy Coe
b004b8195b Model: Fix crash in ResolveGenericArguments with 32-bit binary rebased above 0x80000000 (#119) 2020-12-30 08:25:01 +01:00
Katy Coe
5dc8e823c4 Plugins: Add IPostProcessTypeModel 2020-12-21 19:11:49 +01:00
Katy Coe
b1d61f81f0 Model: Allow Name to be changed by plugins 2020-12-21 19:02:03 +01:00
Katy Coe
3ddf04eafc Model: Don't crash on obfuscated assembly or namespace strings 2020-12-08 15:37:24 +01:00
Katy Coe
7289001933 IL2CPP: Add Unity 2021.1 TODOs 2020-11-26 21:42:36 +01:00
Katy Coe
4a75291140 C#: Output floats and doubles with InvariantCulture (#82) 2020-10-13 08:32:38 +02:00
Katy Coe
ac17a3a510 C#: Fix handling of scoped names pointing to global:: scope 2020-09-14 12:28:00 +02:00
Katy Coe
27b9b290da C#/C++: Handle Unicode characters in identifiers 2020-09-14 12:27:12 +02:00
Katy Coe
ff7110144a C#: Sanitize parameter names (#70) 2020-09-14 12:26:37 +02:00
Katy Coe
47cd6b928b C#: Sanitize method names (#70) 2020-09-14 12:25:52 +02:00
Katy Coe
fcbfc65204 C#: Sanitize type names (#70) 2020-09-14 05:02:47 +02:00
Katy Coe
8d015c8271 C#: Sanitize field and event names (#70) 2020-09-13 15:04:02 +02:00
Katy Coe
e511b99dec Model: UnmangledBaseName / CSharpSafeName refactoring (#70) 2020-09-13 14:51:20 +02:00
Katy Coe
54ac9d7c1a IL2CPP: Fix crash when loading Il2CppCodeGenModule with no concrete methods (#58) 2020-08-22 03:30:17 +02:00
Katy Coe
5828ed106b Model/C#: Provide FieldHasRVA flag; output metadata preview for static array initializer implementations (#59) 2020-08-22 03:14:11 +02:00
Katy Coe
4b86087c7a Allow longs to call ToAddressString() (as well as ulongs) 2020-08-17 01:43:52 +02:00
Katy Coe
ec6066aa1d Model: Handle generic type definition fetch for metadata v27 2020-08-16 01:13:27 +02:00
Katy Coe
1f738a60c6 IL2CPP: Load metadata v27; mark broken areas with TODO 2020-08-15 06:28:48 +02:00
Katy Coe
99a7e2e8cb C#: Output async keyword for async methods (and suppress AsyncStateMachine) 2020-08-14 03:33:41 +02:00
Katy Coe
87de370a3a Model: Add Model.CustomAttributeGeneratorsByAddress 2020-08-09 21:35:55 +02:00