Add support for generating PDBs from NativeAOT libraries
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 28/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- csharp
- Ambito
- compilers, devtools, reverse-engineering
Direzione di ricerca
Inizia dalle sorgenti NativeFormat di .NET runtime, in particolare NativeMetadataReader.cs, MetadataBlob.cs e la voce ReflectionMapBlob.EmbeddedMetadata del ReadyToRun header. Determina come ILSpy possa individuare e leggere i metadati di reflection di NativeAOT nelle versioni di .NET supportate, quindi definisci test o librerie di esempio che dimostrino che tali metadati possono essere scaricati o utilizzati per generare un PDB. Il lavoro è completato quando le librerie NativeAOT vengono gestite con limiti di versione documentati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Is your feature request related to a problem? Please describe.
Currently, ILSpy cannot do anything with NativeAOT libraries. NativeAOT libraries have all the functions compiled to native binary code, which means that adding support for decompiling them would be out-of-scope for this project, but the reflection metadata is still present in the library, so perhaps we could add support for generating a PDB for them, or at least dumping the metadata somehow.
Additional context
No reverse-engineering tool currently implements dumping the reflection metadata from NativeAOT libraries, so if we were to pursue this, we'd have to implement that. There is a ghidra plugin that implements mapping the method tables to the function locations, but has no support for reading the reflection metadata.
The main place to look at for starting to implement that is here: https://github.com/dotnet/runtime/tree/main/src/coreclr/tools/Common/Internal/Metadata/NativeFormat
They store the reflection metadata in a blob that's referenced in the ReadyToRun header at ID 313 (ReadOnlyBlobStart + ReflectionMapBlob.EmbeddedMetadata)
Theorietically, if you have the correct dotnet version, all you'd need to do is instantiate a MetadataReader with a pointer to the EmbeddedMetadata blob that you'd get from the ReadyToRun header, but they don't expose that that class or constructor because it's in an internal namespace, so we'd probably have to make copies of the reflection library.
The biggest problem we'd face is that the reflection metadata format changes between dotnet versions (and they don't update the signature to reflect breaking changes). For example, I know that .net 10 is not compatible with .net 8 and 9.
More info on how the ReadyToRun header is constructed and its location in the NativeAOT binary can be located here: https://migeel.sk/blog/2023/09/15/reverse-engineering-natively-compiled-dotnet-apps/
I'm interested in pursuing this if y'all are interested and can provide some guidance, please let me know.
- Lingua principale
- C#
- Stelle
- 27.1k
- Fork
- 3.8k
- Merge medio
- 1g 23h
- PR unite (30g)
- 44
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di icsharpcode/ILSpy
-
AvaloniaEdit Issues to dateApertaExternal UI
Difficoltà 1/5 1-3 ore Idoneità per principianti 75/100
icsharpcode/ILSpy#4284 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
icsharpcode/ILSpy#4357 ·
I maintainer di solito rispondono entro 1 giorno
-
Misdecompilation of a lazy initialization patternForse già presa @siegfriedpammer l’ha presa 5 giorni fa. ApertaBug Decompiler
Difficoltà 4/5 3-5 giorni Idoneità per principianti 20/100
icsharpcode/ILSpy#4349 ·
I maintainer di solito rispondono entro 1 giorno
-
Bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
icsharpcode/ILSpy#4343 ·
I maintainer di solito rispondono entro 1 giorno
-
AI
Difficoltà 4/5 1-2 giorni Idoneità per principianti 55/100
icsharpcode/ILSpy#4300 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di icsharpcode/ILSpy
Issue simili
-
DXF with empty names failsApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 3 giorni
-
bug python
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
ilia-sokolov/OfficeAgent.NET#89 ·
I maintainer di solito rispondono entro 13 giorni
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
juandresrodca/AdminForge#66 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
umbraco/Umbraco.Automate#612 ·
I maintainer di solito rispondono entro 1 giorno