Loader: map title-shipped DLLs, patch static TLS loads to slot 0, crash reporter, title paths for GetModuleFileName*. HLE: task queue and async, XUser (one offline user), system ids, title id, features, invites, game events, persistent local storage, GameInput with no devices, xmem, console audio hardware queues, life cycle (close suspends, then terminates), and a file layer with virtual drives rewritten in path-taking imports. GPU: D3D12.X device, DXGI chain, heaps, resources, fences, queues and command lists translated onto a host D3D12 device; clears, barriers, copies, resolves and PresentX into the title's window. Shaders: SGD5 reader and `victory translate`; SSA IR with node splitting for irreducible flow; structurisation removing EXEC. Co-Authored-By: Claude Opus 5.5 <[email protected]>
34 lines
927 B
Rust
34 lines
927 B
Rust
//! How imports get their addresses.
|
|
|
|
use victory_pe::ImportSymbol;
|
|
|
|
/// Who provides a bound import.
|
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
|
pub enum Provenance {
|
|
/// Our implementation of the console API.
|
|
Hle,
|
|
/// The host's own implementation (e.g. Windows API sets that behave the
|
|
/// same on console and PC).
|
|
Host,
|
|
/// A DLL the title ships, mapped like the executable.
|
|
Title,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
pub enum Resolution {
|
|
Found {
|
|
address: usize,
|
|
provenance: Provenance,
|
|
},
|
|
/// Nobody implements it; the loader installs a reporting stub.
|
|
Missing,
|
|
}
|
|
|
|
/// Supplies an address for each `dll!symbol` the title imports.
|
|
///
|
|
/// `dll` is passed exactly as written in the image; implementations should
|
|
/// compare case-insensitively.
|
|
pub trait ImportResolver {
|
|
fn resolve(&self, dll: &str, symbol: &ImportSymbol) -> Resolution;
|
|
}
|