Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ These restrictions apply to prose (conversations, documentation, comments, commi
9. macOS code signing removal via `codesign --remove-signature`.
10. Section validation: verifies patches target data sections, not code sections.
11. Client type detection: path-based heuristic for Retail, Classic, Classic Era.
12. Runtime `launch` subcommand: strategy selected from file version; verified retail recipes for 12.0.7.68887 and 12.1.0.69587 (Windows x64); older version families use the existing runtime strategy.
12. Runtime `launch` subcommand: strategy selected from file version; verified retail recipes for 12.0.7.68887, 12.1.0.69587 and 12.1.5.70961 (Windows x64); older version families use the existing runtime strategy.
13. `dump-text` and `dump-sections` subcommands: recover Arxan-decrypted PE sections from a running client (Windows/Wine).
14. Library API: builder-pattern `Patcher` struct with `WowPatcherError`, `KeyConfig`, `PatchGroup` re-exports.
15. Custom key support: load from bytes, hex strings, or files.
Expand Down Expand Up @@ -425,7 +425,7 @@ The integration test `test_patching_with_real_patterns` verifies the full 256-by

Runtime mode is implemented: the `launch` subcommand selects its strategy
from the executable's file version. Verified retail recipes cover
12.0.7.68887 and 12.1.0.69587 (Windows x64); documented older version
12.0.7.68887, 12.1.0.69587 and 12.1.5.70961 (Windows x64); documented older version
families (1.13.x, 1.14.x, 2.5.x, 3.4.x, 4.4.x, 9.x, 10.x) use the existing
runtime strategy.

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ The patcher supports the following WoW client lines:
| 2.5.x through 2.5.4 | The Burning Crusade, 2007 | Verified |
| 3.4.x through 3.4.4 | Wrath of the Lich King, 2008 | Verified |
| 4.4.x through 4.4.2 | Cataclysm, 2010 | Verified |
| Retail 12.x (2024 to 2026) | Retail (current) | Verified (12.0.7.68887, 12.1.0.69587, runtime `launch`) |
| Retail 12.x (2024 to 2026) | Retail (current) | Verified (12.0.7.68887, 12.1.0.69587, 12.1.5.70961, runtime `launch`) |

Build numbers are the values reported by the client at its login screen and
catalogued at [warcraft.wiki.gg][public-builds].
Expand Down Expand Up @@ -90,7 +90,7 @@ cargo build --release

The [runtime `launch` command](docs/retail-runtime.md) selects its strategy from
the file version. Retail 12.x and later use the new strategy; its verified
Windows x64 recipes cover **12.0.7.68887** and **12.1.0.69587**.
Windows x64 recipes cover **12.0.7.68887**, **12.1.0.69587** and **12.1.5.70961**.

Run `wow-patcher --help` to see all options. The most common invocations:

Expand Down
2 changes: 1 addition & 1 deletion docs/retail-runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ of a build-specific patch recipe are separate checks:

| File version | Selected strategy |
| --- | --- |
| 12.x and later major versions | New retail strategy; verified recipes for **12.0.7.68887** and **12.1.0.69587** |
| 12.x and later major versions | New retail strategy; verified recipes for **12.0.7.68887**, **12.1.0.69587** and **12.1.5.70961** |
| 1.13.x, 1.14.x | Existing runtime strategy |
| 2.5.0–2.5.4, 3.4.0–3.4.4, 4.4.0–4.4.2 | Existing runtime strategy |
| 9.x, 10.x | Existing runtime strategy |
Expand Down
1 change: 1 addition & 0 deletions docs/src/howto-new-retail-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,5 +214,6 @@ fn retail_recipe_requires_all_four_version_components() {
|---|---|---|---|
| 12.0.7.68887 | `0x35C0B4C` | Split (skip 100 pages) | No |
| 12.1.0.69587 | `0x3783B4C` | Full sweep from borrowed storage | Yes |
| 12.1.5.70961 | `0x3AC1E7C` | Full sweep from borrowed storage | Yes |

Use these as templates for address discovery and layout determination. The Forever client (Classic Beta, build 70009) is based on the same retail engine and follows the same patterns — it just needs its own recipe entry once the addresses are reverse-engineered.
2 changes: 1 addition & 1 deletion docs/src/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ wow-patcher version

Launch the client with a runtime strategy selected from its file version.
Retail 12.x and later use the new strategy (verified recipes for
12.0.7.68887 and 12.1.0.69587, requiring `--server-cert` and Windows x64).
12.0.7.68887, 12.1.0.69587 and 12.1.5.70961, requiring `--server-cert` and Windows x64).
Documented older version families use the existing runtime strategy.
See [retail-runtime.md](../retail-runtime.md) for details.

Expand Down
2 changes: 1 addition & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ pub enum Commands {
/// Launch with a runtime strategy selected from the executable's file version.
///
/// Retail 12.x and later use the new strategy; verified recipes cover
/// 12.0.7.68887 and 12.1.0.69587, requiring --server-cert and Windows x64.
/// 12.0.7.68887, 12.1.0.69587 and 12.1.5.70961, requiring --server-cert and Windows x64.
/// Documented older version families use the existing runtime strategy.
Launch {
/// Seconds to wait for decryption in the older strategy (0 = auto-detect).
Expand Down
13 changes: 10 additions & 3 deletions src/cmd/launch_strategy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ pub(crate) fn select_strategy(version: Version) -> Result<LaunchStrategy, String
Err(format!(
"No launch strategy for {version}. Supported families: 1.13.x, 1.14.x, \
2.5.0-2.5.4, 3.4.0-3.4.4, 4.4.0-4.4.2, 9.x, 10.x; \
retail recipes exist for 12.0.7.68887 and 12.1.0.69587. No process started."
retail recipes exist for 12.0.7.68887, 12.1.0.69587 and 12.1.5.70961. No process started."
))
}

pub(crate) fn validate_retail_recipe(version: Version) -> Result<(), String> {
if matches!(
(version.major, version.minor, version.patch, version.build),
(12, 0, 7, 68887) | (12, 1, 0, 69587)
(12, 0, 7, 68887) | (12, 1, 0, 69587) | (12, 1, 5, 70961)
) {
Ok(())
} else {
Err(format!(
"No verified retail recipe for {version}; available recipes require exactly \
12.0.7.68887 or 12.1.0.69587. No process started."
12.0.7.68887, 12.1.0.69587 or 12.1.5.70961. No process started."
))
}
}
Expand All @@ -54,6 +54,7 @@ mod tests {
Version::new(12, 0, 7, 68887),
Version::new(12, 1, 0, 68914),
Version::new(12, 1, 0, 69587),
Version::new(12, 1, 5, 70961),
Version::new(13, 0, 0, 70000),
Version::new(u16::MAX, 0, 0, u32::MAX),
] {
Expand All @@ -77,6 +78,10 @@ mod tests {
validate_retail_recipe(Version::new(12, 1, 0, 69587)),
Ok(())
);
assert_eq!(
validate_retail_recipe(Version::new(12, 1, 5, 70961)),
Ok(())
);
for version in [
Version::new(12, 1, 0, 69586),
Version::new(12, 1, 0, 69588),
Expand All @@ -89,6 +94,8 @@ mod tests {
Version::new(12, 0, 6, 68887),
Version::new(12, 0, 8, 68887),
Version::new(12, 1, 7, 68887),
Version::new(12, 1, 5, 70960),
Version::new(12, 1, 5, 70962),
Version::new(11, 0, 7, 68887),
Version::new(13, 0, 7, 68887),
] {
Expand Down
20 changes: 15 additions & 5 deletions src/cmd/retail/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,16 @@ fn prepare(opts: &Options) -> Result<Plan> {
.iter()
.find(|s| s.name().ok() == Some(".rdata"))
.ok_or("Missing .rdata section")?;
if pe.entry != 0x1d9e10
let (entry_rva, rdata_size) = match recipe.version.build {
69587 => (0x1d9e10, 0xb5081c),
70961 => (0x1da9d0, 0xc1f6f2),
_ => return Err("Missing entry-hold layout for retail recipe".into()),
};
if pe.entry as usize != entry_rva
|| rdata.virtual_address as usize != recipe.stub_rva()
|| rdata.virtual_size != 0xb5081c
|| rdata.virtual_size != rdata_size
{
return Err("Unexpected startup layout for 12.1.0.69587".into());
return Err(format!("Unexpected startup layout for {}", recipe.version).into());
}
let offset = text.pointer_to_raw_data as usize + pe.entry as usize - TEXT_START;
bytes
Expand Down Expand Up @@ -206,11 +211,16 @@ fn prepare(opts: &Options) -> Result<Plan> {
"https://%s.version.battle.net/v2/products/%s/%s",
),
] {
let (anchor, capacity) = if recipe.version.build == 70961 && rva == recipe.urls[0] {
(&original[..48], 48)
} else {
(original, original.len() + 1)
};
add(
"Version URL",
rva,
original.as_bytes(),
padded_string(url, original.len() + 1)?,
anchor.as_bytes(),
padded_string(url, capacity)?,
)?;
}
}
Expand Down
31 changes: 25 additions & 6 deletions src/cmd/retail/recipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub(super) struct Recipe {
pub loader_hash: &'static str,
}

pub(super) const RECIPES: [Recipe; 2] = [
pub(super) const RECIPES: [Recipe; 3] = [
Recipe {
version: Version {
major: 12,
Expand Down Expand Up @@ -55,6 +55,25 @@ pub(super) const RECIPES: [Recipe; 2] = [
image_hash: "B773093EDF986C8085FDC990649BFCB33DF5F692C244BE7FDDF46C49B413923E",
loader_hash: "BC06969951614D168081F7EBEC9513BBCEFEFFDC483BF0AFCD65915DBB29FFC4",
},
Recipe {
version: Version {
major: 12,
minor: 1,
patch: 5,
build: 70961,
},
text_size: 0x3ac1e7c,
resolver: 0x38fd4e0,
gate: 0x38f37b3,
helper: 0x28b8e20,
result_bl: 0x28c8e76,
result_edi: 0x28c6561,
ed25519: 0x3aed970,
portal: 0x3ccf2b0,
urls: [0x3efc098, 0x3efc0d8],
image_hash: "75EAA7D66A4B02019D120CD9DE4F6ED441A137A3289D49DB95610C0349B4A11C",
loader_hash: "72F7DACD10F936FBC225624FBBE8B9DADC6B8B4E4A8B32B410C22AD01FFE2E13",
},
];

impl Recipe {
Expand All @@ -66,14 +85,14 @@ impl Recipe {
}

pub fn holds_entry(&self) -> bool {
self.version.build == 69587
matches!(self.version.build, 69587 | 70961)
}

pub fn stub_rva(&self) -> usize {
if self.holds_entry() {
0x3785000
} else {
super::TEXT_START + self.text_size
match self.version.build {
69587 => 0x3785000,
70961 => 0x3ac3000,
_ => super::TEXT_START + self.text_size,
}
}
}
Expand Down
39 changes: 39 additions & 0 deletions src/cmd/retail/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,30 @@ struct CodeSite {
}

fn code_sites(recipe: &Recipe) -> [CodeSite; 5] {
if recipe.version.build == 70961 {
return [
CodeSite {
rva: recipe.resolver,
signature: "48 89 5C 24 08 57 48 83 EC 20 48 8B F9",
},
CodeSite {
rva: recipe.gate,
signature: "41 F6 C5 01 74 5C",
},
CodeSite {
rva: recipe.helper,
signature: "48 89 5C",
},
CodeSite {
rva: recipe.result_bl,
signature: "32 DB",
},
CodeSite {
rva: recipe.result_edi,
signature: "E8 4A 3C 00 00 44 0F",
},
];
}
[
CodeSite {
rva: recipe.resolver,
Expand Down Expand Up @@ -267,4 +291,19 @@ mod tests {
.starts_with("48 89 5C 24 08 57 48 83 EC 20 48 8B F9")
);
}

#[test]
fn recipe_70961_signatures_match_expected_runtime_bytes() {
let sites = code_sites(&recipe::RECIPES[2]);
for (index, bytes) in [
(0, "48895C2408574883EC20488BF9"),
(1, "41F6C501745C"),
(2, "48895C"),
(3, "32DB"),
(4, "E84A3C0000440F"),
] {
let bytes = hex::decode(bytes).unwrap();
assert!(matches(&bytes, sites[index].signature));
}
}
}
2 changes: 2 additions & 0 deletions tests/launch_cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ fn newer_retail_versions_enter_retail_but_require_a_matching_recipe() {
"12.1.0.69586",
"12.1.0.69588",
"12.0.7.69587",
"12.1.5.70960",
"12.1.5.70962",
"13.0.0.70000",
] {
let dir = TempDir::new().unwrap();
Expand Down