Core Design Principles
Osiris follows several strict technical constraints that distinguish it from typical C++ applications:No C Runtime Library (CRT)
The release builds do not link against the C runtime library. This reduces the binary footprint and avoids potential detection vectors.No Heap Allocations
All memory is pre-allocated from a static buffer. The system uses a custom memory allocator with a free region list:No Static Imports (Windows)
On Windows, the DLL has no static imports in the import table. All API functions are resolved dynamically at runtime through pattern scanning.No Threads
The application runs entirely on the game’s threads, hooking into the game’s execution flow rather than creating new threads.No Exceptions
Exception handling is disabled (noexcept everywhere). Error handling uses return values and assertions.
Global Context Architecture
The entire application state is managed through a singletonGlobalContext that uses a two-phase initialization pattern.
Initialization Phases
Phase 1: Partial Context
ThePartialGlobalContext is created during DLL load and performs minimal initialization:
- Loads game DLLs (client.dll, panorama.dll, SDL3.dll, etc.)
- Initializes pattern finders for each module
- Sets up the PeepEvents hook (entry point for game thread execution)
- Minimal state, safe to run during DLL loading
Phase 2: Full Context
TheFullGlobalContext is created lazily from the game thread and contains the complete application state:
- All memory pattern search results
- Game state (config, features, HUD)
- All hooks (ViewRender, PeepEvents, ClientMode)
- Panorama GUI state
- Feature-specific states (glow, player info, etc.)
Deferred Initialization Pattern
- DLL loading is fast and safe
- Game initialization completes before full initialization
- All heavy operations run on the game thread
Memory Management
Osiris uses a custom memory allocator based on a free region list:- No runtime heap allocations
- Predictable memory usage
- Memory leak detection in debug builds
- No dependency on CRT allocator
Cross-Platform Support
Osiris supports both Windows and Linux through platform abstraction:Source/MemoryPatterns/Windows/- Windows memory patternsSource/MemoryPatterns/Linux/- Linux memory patterns
Execution Flow
- DLL Load:
DllMainorDllEntryPointcalled - Partial Init: Create
PartialGlobalContext, install PeepEvents hook - Game Thread Entry: Hook intercepts SDL event polling
- Full Init: Create
FullGlobalContextfrom game thread - Runtime: Hooks execute on game frames, GUI runs in Panorama
- Unload: Restore hooks, clean up state
State Management
All state is stored in the global context with no static/global variables (except the context itself):- Single source of truth
- Easy access from any component
- Clean shutdown
- No initialization order issues
Type Safety
Osiris extensively uses strong typing and templates for compile-time safety:- Type-safe entity handles
- Compile-time pattern validation
- Template-based factory methods
constexprandconstevalfor compile-time computation
Related Topics
- Memory Patterns - Pattern scanning system
- Panorama GUI - User interface integration
- Hooking - Hook implementation details