How v0idzz/reemit works
Main Components
• Common Library: Represent “Reemit.Common” as the shared core. This module contains essential helper classes (e.g., BinaryReaderExtensions, SharedReader, etc.) that the rest of the system depends on.
• CLR Decompiler Module: Represent “Reemit.Decompiler.Clr”. This module is responsible for disassembling CLR instructions, reading metadata (including coded indexes, metadata tables, and method headers) and includes a dedicated set of unit tests. Consider highlighting subcomponents such as the “Disassembler” and “Metadata” parsers.
• PE Decompiler Module: Represent “Reemit.Decompiler.PE”. This handles PE file-specific decoding (e.g., reading the MS-DOS header, PE headers, and several enumerated types defining architecture details).
• Unified Decompiler Core: Represent “Reemit.Decompiler” as a higher-level orchestrator that uses both the CLR and the PE modules. This layer binds together lower-level routines to provide a cohesive decompilation engine.
• Testing Framework: Although not part of the runtime architecture, it is helpful to show separate test modules (e.g., Reemit.Common.UnitTests, Reemit.Decompiler.Clr.UnitTests, Reemit.Decompiler.PE.UnitTests, Reemit.Gui.UnitTests) to underline a robust testing discipline across components.
Relationships and Data Flow
• That the decompiler core delegates specific tasks to the CLR and PE modules according to the type of file being processed.
• That the Common Library is a dependency for both decompiler modules – hinting it sits at a lower level that provides cross-cutting functionalities.
Architectural Patterns and Design Principles
• Modular Design & Separation of Concerns: Emphasize that each “Reemit.*” project addresses a specific part of the overall decompilation process. This minimizes coupling while allowing each module to have its own set of unit tests.
• MVVM Pattern in the GUI: In the GUI section, note both Views (Axaml files) and ViewModels, which implies that user interaction is decoupled from business logic.
Relevant Technologies, Frameworks, or Libraries
• .NET (as seen through .csproj and GitHub workflows, e.g., dotnet.yml) is the primary framework.
• The project appears to target ECMA-335, so the decompilation engines handle IL, metadata, and native PE headers.
• In the GUI layer, consider that Avalonia (or similar) might be used since Axaml is evident in file names.
• Essential elements such as the layered structure and key dependencies.