How morkt/garbro works
Main Components
• Core Archive Format Library (ArcFormats): This directory houses hundreds of classes, each implementing handlers for specific archive types and resources (images, audio, and sometimes encryption components). Highlight that these components may use design patterns (like Strategy or Factory) to determine which format to use.
• Resource Processing Core (GameRes and related libraries): Contains common routines to manipulate binary streams, decode images, calculate checksums, and support resource extraction logic.
• Graphical User Interface (GUI): Built with WPF (XAML files, code-behind) providing the interactive visual interface – main window, dialogs, settings, keybindings (as seen in the README).
• Console Application: A command-line front-end alternative supporting similar functionality.
• Ancillary/Utility Modules: The “Image.Convert,” “Experimental” and “Legacy” directories likely provide additional tools, conversion utilities, or older code that support or extend the core capabilities.
• Configuration and Resource Files: Includes config files (app.config, packages.config, etc.) and resource definitions such as language strings that support internationalization.
• External Dependencies: The project requires .NET Framework v4.6 or newer and references to external libraries (for tasks like audio playback and image conversion, e.g., NAudio).
Relationships and Interactions
• The user interacts through the GUI front-end (or alternative console interface), which then calls into the core libraries.
• The GUI layer sends file selection, extraction, or conversion requests to the Archive Format Library. This library identifies the format based on file’s signature or extension and then calls specialized modules.
• The core resource processing modules (GameRes, for example) manage tasks like stream reading, binary parsing, and data conversion for images and audio.
• A common file system abstraction exists which allows the application to treat archives like folders, enabling browsing into nested archive contents.
• Additional experimental or legacy components provide optional or fallback behaviors for formats not handled by the main code base.
Architectural Patterns and Design Principles
• Modularization: Functionality is strongly separated – one module per archive or file format, ensuring that handling a new format can be done with minimal impact on others.
• Layered Architecture: A clean separation between UI (GUI/Console) and business logic (archive processing and resource conversion).
• Extensibility: The use of many distinct classes for each archive type suggests an extensible design where adding support for a new format involves implementing a new component.
• Reusability: Core libraries (e.g., for stream handling, checksums, encryption) are shared among multiple format handlers.