From ac9d18fda254e67b81bb77278c0f0e30bc83165a Mon Sep 17 00:00:00 2001 From: xeon Date: Tue, 3 Jun 2025 19:32:56 +0300 Subject: [PATCH] OSPRODWin2.0.0 support --- Cargo.lock | 20 ++++++++-------- Cargo.toml | 2 +- launcher/src/main.rs | 4 ++-- {vivian => yixuan}/Cargo.toml | 4 ++-- {vivian => yixuan}/sdk_public_key.xml | 0 {vivian => yixuan}/server_public_key.xml | 0 {vivian => yixuan}/src/interceptor.rs | 0 {vivian => yixuan}/src/lib.rs | 4 ++-- .../src/modules/censorship_patch.rs | 10 ++++---- {vivian => yixuan}/src/modules/crypto.rs | 24 ++++++++++--------- .../src/modules/hoyopass_patch.rs | 8 +++---- {vivian => yixuan}/src/modules/mod.rs | 0 {vivian => yixuan}/src/modules/network.rs | 6 ++--- {vivian => yixuan}/src/util.rs | 0 14 files changed, 42 insertions(+), 40 deletions(-) rename {vivian => yixuan}/Cargo.toml (92%) rename {vivian => yixuan}/sdk_public_key.xml (100%) rename {vivian => yixuan}/server_public_key.xml (100%) rename {vivian => yixuan}/src/interceptor.rs (100%) rename {vivian => yixuan}/src/lib.rs (91%) rename {vivian => yixuan}/src/modules/censorship_patch.rs (87%) rename {vivian => yixuan}/src/modules/crypto.rs (77%) rename {vivian => yixuan}/src/modules/hoyopass_patch.rs (85%) rename {vivian => yixuan}/src/modules/mod.rs (100%) rename {vivian => yixuan}/src/modules/network.rs (93%) rename {vivian => yixuan}/src/util.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index f2fcc01..76da875 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -239,16 +239,6 @@ version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" -[[package]] -name = "vivian" -version = "0.0.1" -dependencies = [ - "ilhook", - "num_enum", - "thiserror 2.0.11", - "windows", -] - [[package]] name = "windows" version = "0.59.0" @@ -441,3 +431,13 @@ checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] + +[[package]] +name = "yixuan" +version = "0.0.1" +dependencies = [ + "ilhook", + "num_enum", + "thiserror 2.0.11", + "windows", +] diff --git a/Cargo.toml b/Cargo.toml index 5d54228..4fcf09b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -members = ["launcher", "vivian"] +members = ["launcher", "yixuan"] resolver = "2" [workspace.package] diff --git a/launcher/src/main.rs b/launcher/src/main.rs index b611481..115c797 100644 --- a/launcher/src/main.rs +++ b/launcher/src/main.rs @@ -12,8 +12,8 @@ use windows::Win32::System::Threading::{ PROCESS_INFORMATION, STARTUPINFOA, }; -const GAME_EXECUTABLE: PCSTR = s!("ZenlessZoneZeroBeta.exe"); -const INJECT_DLL: &str = "vivian.dll"; +const GAME_EXECUTABLE: PCSTR = s!("ZenlessZoneZero.exe"); +const INJECT_DLL: &str = "yixuan.dll"; fn inject_standard(h_target: HANDLE, dll_path: &str) -> bool { unsafe { diff --git a/vivian/Cargo.toml b/yixuan/Cargo.toml similarity index 92% rename from vivian/Cargo.toml rename to yixuan/Cargo.toml index 0c1333e..5069389 100644 --- a/vivian/Cargo.toml +++ b/yixuan/Cargo.toml @@ -1,10 +1,10 @@ [package] -name = "vivian" +name = "yixuan" edition = "2021" version.workspace = true [lib] -name = "vivian" +name = "yixuan" crate-type = ["cdylib"] [dependencies] diff --git a/vivian/sdk_public_key.xml b/yixuan/sdk_public_key.xml similarity index 100% rename from vivian/sdk_public_key.xml rename to yixuan/sdk_public_key.xml diff --git a/vivian/server_public_key.xml b/yixuan/server_public_key.xml similarity index 100% rename from vivian/server_public_key.xml rename to yixuan/server_public_key.xml diff --git a/vivian/src/interceptor.rs b/yixuan/src/interceptor.rs similarity index 100% rename from vivian/src/interceptor.rs rename to yixuan/src/interceptor.rs diff --git a/vivian/src/lib.rs b/yixuan/src/lib.rs similarity index 91% rename from vivian/src/lib.rs rename to yixuan/src/lib.rs index f5c5dd3..a405898 100644 --- a/vivian/src/lib.rs +++ b/yixuan/src/lib.rs @@ -32,10 +32,10 @@ unsafe fn thread_fn() { thread::sleep(Duration::from_secs(5)); util::disable_memory_protection(); - println!("vivian-patch (2.0.5 BETA) is initializing"); + println!("yixuan-patch (2.0.0 PROD) is initializing"); println!( - "to work with vivian-rs: https://git.xeondev.com/vivian-rs/vivian-rs/src/branch/2.0_beta" + "to work with yixuan-rs: https://git.xeondev.com/yixuan-rs/yixuan-rs" ); println!("\nJoin us on Discord at https://discord.gg/reversedrooms\n\n\n"); diff --git a/vivian/src/modules/censorship_patch.rs b/yixuan/src/modules/censorship_patch.rs similarity index 87% rename from vivian/src/modules/censorship_patch.rs rename to yixuan/src/modules/censorship_patch.rs index ff10d27..33ef0f8 100644 --- a/vivian/src/modules/censorship_patch.rs +++ b/yixuan/src/modules/censorship_patch.rs @@ -3,12 +3,12 @@ use std::sync::atomic::{AtomicU32, Ordering}; use super::{ModuleInitError, NapModule, NapModuleContext}; -const SET_DITHER_CONFIG: usize = 0x86FE960; -const DITHER_CONFIG_AVATAR_USING_DITHER_ALPHA: usize = 0x41; +const SET_DITHER_CONFIG: usize = 0x8CA93D0; +const DITHER_CONFIG_AVATAR_USING_DITHER_ALPHA: usize = 0x49; -const ON_ENTER_SCENE_SC_NOTIFY: usize = 0x85088C0; -const ENTER_SCENE_SC_NOTIFY_SCENE_DATA: usize = 0x20; -const SCENE_DATA_SCENE_TYPE: usize = 0x6C; +const ON_ENTER_SCENE_SC_NOTIFY: usize = 0x86E6F80; +const ENTER_SCENE_SC_NOTIFY_SCENE_DATA: usize = 0x10; +const SCENE_DATA_SCENE_TYPE: usize = 0x74; const SCENE_TYPE_HALL: u32 = 1; static LAST_ENTER_SCENE_TYPE: AtomicU32 = AtomicU32::new(0); diff --git a/vivian/src/modules/crypto.rs b/yixuan/src/modules/crypto.rs similarity index 77% rename from vivian/src/modules/crypto.rs rename to yixuan/src/modules/crypto.rs index 93b77ef..6a88840 100644 --- a/vivian/src/modules/crypto.rs +++ b/yixuan/src/modules/crypto.rs @@ -7,14 +7,14 @@ use crate::{ util::{import, GAME_ASSEMBLY_BASE}, }; -import!(rsa_create() -> usize = 0x1B582F20); -import!(rsa_from_xml_string(instance: usize, xml_string: usize) -> usize = 0x1B583160); -import!(il2cpp_string_new(cstr: *const u8) -> usize = 0x1158AA0); +import!(rsa_create() -> usize = 0x1B56F0F0); +import!(rsa_from_xml_string(instance: usize, xml_string: usize) -> usize = 0x1B56F330); +import!(il2cpp_string_new(cstr: *const u8) -> usize = 0x115CCC0); pub unsafe fn initialize_rsa_public_key() { const SERVER_PUBLIC_KEY: &str = include_str!("../../server_public_key.xml"); let rsa_public_key_backdoor_field = - ((*(GAME_ASSEMBLY_BASE.wrapping_add(0x554E500) as *const usize)) + 252856) as *mut usize; + ((*(GAME_ASSEMBLY_BASE.wrapping_add(0x5550778) as *const usize)) + 252784) as *mut usize; let rsa = rsa_create(); rsa_from_xml_string( @@ -33,18 +33,20 @@ pub unsafe fn initialize_rsa_public_key() { pub unsafe fn replace_sdk_public_key_string_literal() { const SDK_PUBLIC_KEY: &str = include_str!("../../sdk_public_key.xml"); - *(GAME_ASSEMBLY_BASE.wrapping_add(0x5950C50) as *mut usize) = il2cpp_string_new( + *(GAME_ASSEMBLY_BASE.wrapping_add(0x5952CA8) as *mut usize) = il2cpp_string_new( CString::new(SDK_PUBLIC_KEY) .unwrap() .to_bytes_with_nul() .as_ptr(), ) as usize; - *(GAME_ASSEMBLY_BASE.wrapping_add(0x5974060) as *mut usize) = il2cpp_string_new( - [27818, 40348, 47410, 27936, 51394, 33172, 51987, 8709, 44748, - 23705, 45753, 21092, 57054, 52661, 369, 62630, 11725, 7496, 36921, 28271, - 34880, 52645, 31515, 18214, 3108, 2077, 13490, 25459, 58590, 47504, 15163, - 8951, 44748, 23705, 45753, 29284, 57054, 52661] + *(GAME_ASSEMBLY_BASE.wrapping_add(0x59760D0) as *mut usize) = il2cpp_string_new( + [ + 27818, 40348, 47410, 27936, 51394, 33172, 51987, 8709, 44748, 23705, 45753, 21092, + 57054, 52661, 369, 62630, 11725, 7496, 36921, 28271, 34880, 52645, 31515, 18214, 3108, + 2077, 13490, 25459, 58590, 47504, 15163, 8951, 44748, 23705, 45753, 29284, 57054, + 52661, 43266, 17556, 17415, 52254, 32830, + ] .into_iter() .enumerate() .flat_map(|(i, v)| { @@ -62,7 +64,7 @@ pub unsafe fn replace_sdk_public_key_string_literal() { pub unsafe fn monitor_network_state(interceptor: &mut Interceptor) { interceptor .attach( - GAME_ASSEMBLY_BASE.wrapping_add(0xDE96720), + GAME_ASSEMBLY_BASE.wrapping_add(0xDE28090), on_network_state_change, ) .unwrap(); diff --git a/vivian/src/modules/hoyopass_patch.rs b/yixuan/src/modules/hoyopass_patch.rs similarity index 85% rename from vivian/src/modules/hoyopass_patch.rs rename to yixuan/src/modules/hoyopass_patch.rs index a6b4b5a..99491d1 100644 --- a/vivian/src/modules/hoyopass_patch.rs +++ b/yixuan/src/modules/hoyopass_patch.rs @@ -4,10 +4,10 @@ use crate::util::GAME_ASSEMBLY_BASE; use super::{ModuleInitError, NapModule, NapModuleContext}; -const ON_COMBO_INIT_SUCCESS: usize = 0x1ACCE700; -const STATICS: usize = 0x554E500; -const STATIC_ID: usize = 34496; -const FIELD_OFFSET: usize = 0x44; +const ON_COMBO_INIT_SUCCESS: usize = 0x1ACAB470; +const STATICS: usize = 0x5550778; +const STATIC_ID: usize = 34512; +const FIELD_OFFSET: usize = 0x40; pub struct HoyopassPatch; diff --git a/vivian/src/modules/mod.rs b/yixuan/src/modules/mod.rs similarity index 100% rename from vivian/src/modules/mod.rs rename to yixuan/src/modules/mod.rs diff --git a/vivian/src/modules/network.rs b/yixuan/src/modules/network.rs similarity index 93% rename from vivian/src/modules/network.rs rename to yixuan/src/modules/network.rs index 2137bf6..096a004 100644 --- a/vivian/src/modules/network.rs +++ b/yixuan/src/modules/network.rs @@ -6,8 +6,8 @@ use crate::util::{self, import, read_csharp_string}; use super::{ModuleInitError, NapModule, NapModuleContext}; -const MAKE_INITIAL_URL: usize = 0x1D172280; -const WEB_REQUEST_CREATE: usize = 0x1CC5EC00; +const MAKE_INITIAL_URL: usize = 0x1D14BCE0; +const WEB_REQUEST_CREATE: usize = 0x1CC33EF0; pub struct Network; @@ -37,7 +37,7 @@ unsafe extern "win64" fn on_web_request_create(reg: *mut Registers, _: usize) { } } -import!(il2cpp_string_new(cstr: *const u8) -> usize = 0x1158AA0); +import!(il2cpp_string_new(cstr: *const u8) -> usize = 0x115CCC0); impl Network { const SDK_URL: &str = "http://127.0.0.1:20100"; diff --git a/vivian/src/util.rs b/yixuan/src/util.rs similarity index 100% rename from vivian/src/util.rs rename to yixuan/src/util.rs