launcher
flavor.psp.format_2025.pe_utils.launcher
¶
Launcher type detection and processing utilities.
Provides utilities for detecting launcher types and processing them for PSPF compatibility.
Functions¶
get_launcher_type
¶
Detect launcher type from PE characteristics.
Go and Rust compilers produce PE files with different characteristics: - Go: Minimal DOS stub (PE offset 0x80 / 128 bytes) - Rust: Larger DOS stub (PE offset 0xE8 / 232 bytes or more)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
launcher_data
|
bytes
|
Launcher binary data |
required |
Returns:
| Type | Description |
|---|---|
str
|
"go", "rust", or "unknown" |
Source code in flavor/psp/format_2025/pe_utils/launcher.py
process_launcher_for_pspf
¶
Process launcher binary for PSPF embedding compatibility.
This is the main entry point for PE manipulation. It uses a hybrid approach: - Go launchers: Use PE overlay (no modifications, PSPF appended after sections) - Rust launchers: Use DOS stub expansion (PSPF at fixed 0xF0 offset)
Phase 29: Go binaries are fundamentally incompatible with DOS stub expansion due to their PE structure (15 sections, unusual section names, missing data directories). The PE overlay approach is the industry standard and preserves 100% PE structure integrity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
launcher_data
|
bytes
|
Original launcher binary |
required |
Returns:
| Type | Description |
|---|---|
bytes
|
Processed launcher binary (expanded if Rust, unchanged if Go/Unix) |