From 1ec505c1c1ebf01186f6d81839b31b34f9502bb5 Mon Sep 17 00:00:00 2001 From: traffic95 Date: Tue, 10 Jun 2025 21:33:13 +0200 Subject: [PATCH] CNBetaWin2.1.1 support --- launcher/src/main.rs | 2 +- yixuan/src/lib.rs | 4 ++-- yixuan/src/modules/censorship_patch.rs | 12 ++++++------ yixuan/src/modules/crypto.rs | 16 ++++++++-------- yixuan/src/modules/hoyopass_patch.rs | 8 ++++---- yixuan/src/modules/network.rs | 6 +++--- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/launcher/src/main.rs b/launcher/src/main.rs index 115c797..8f97971 100644 --- a/launcher/src/main.rs +++ b/launcher/src/main.rs @@ -12,7 +12,7 @@ use windows::Win32::System::Threading::{ PROCESS_INFORMATION, STARTUPINFOA, }; -const GAME_EXECUTABLE: PCSTR = s!("ZenlessZoneZero.exe"); +const GAME_EXECUTABLE: PCSTR = s!("ZenlessZoneZeroBeta.exe"); const INJECT_DLL: &str = "yixuan.dll"; fn inject_standard(h_target: HANDLE, dll_path: &str) -> bool { diff --git a/yixuan/src/lib.rs b/yixuan/src/lib.rs index a405898..8541df2 100644 --- a/yixuan/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!("yixuan-patch (2.0.0 PROD) is initializing"); + println!("yixuan-patch (2.1.1 BETA) is initializing"); println!( - "to work with yixuan-rs: https://git.xeondev.com/yixuan-rs/yixuan-rs" + "to work with yixuan-rs: https://git.xeondev.com/yixuan-rs/yixuan-rs/src/branch/2.1_beta" ); println!("\nJoin us on Discord at https://discord.gg/reversedrooms\n\n\n"); diff --git a/yixuan/src/modules/censorship_patch.rs b/yixuan/src/modules/censorship_patch.rs index 9ecf925..bbf07b1 100644 --- a/yixuan/src/modules/censorship_patch.rs +++ b/yixuan/src/modules/censorship_patch.rs @@ -3,13 +3,13 @@ use std::sync::atomic::{AtomicU32, Ordering}; use super::{ModuleInitError, NapModule, NapModuleContext}; -const SET_DITHER_CONFIG: usize = 0x8CA93D0; -const DITHER_CONFIG_AVATAR_USING_DITHER_ALPHA: usize = 0x49; +const SET_DITHER_CONFIG: usize = 0x19BF3070; +const DITHER_CONFIG_AVATAR_USING_DITHER_ALPHA: usize = 0x4C; -const ON_ENTER_BIG_SCENE_SC_NOTIFY: usize = 0x104721E0; -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 ON_ENTER_BIG_SCENE_SC_NOTIFY: usize = 0x9CE9460; +const ON_ENTER_SCENE_SC_NOTIFY: usize = 0xB12BEF0; +const ENTER_SCENE_SC_NOTIFY_SCENE_DATA: usize = 0x18; +const SCENE_DATA_SCENE_TYPE: usize = 0x6C; const SCENE_TYPE_HALL: u32 = 1; static LAST_ENTER_SCENE_TYPE: AtomicU32 = AtomicU32::new(0); diff --git a/yixuan/src/modules/crypto.rs b/yixuan/src/modules/crypto.rs index 6a88840..53101f8 100644 --- a/yixuan/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 = 0x1B56F0F0); -import!(rsa_from_xml_string(instance: usize, xml_string: usize) -> usize = 0x1B56F330); -import!(il2cpp_string_new(cstr: *const u8) -> usize = 0x115CCC0); +import!(rsa_create() -> usize = 0x1C208E70); +import!(rsa_from_xml_string(instance: usize, xml_string: usize) -> usize = 0x1C2090B0); +import!(il2cpp_string_new(cstr: *const u8) -> usize = 0x1190EE0); 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(0x5550778) as *const usize)) + 252784) as *mut usize; + ((*(GAME_ASSEMBLY_BASE.wrapping_add(0x56E72C8) as *const usize)) + 263920) as *mut usize; let rsa = rsa_create(); rsa_from_xml_string( @@ -33,19 +33,19 @@ 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(0x5952CA8) as *mut usize) = il2cpp_string_new( + *(GAME_ASSEMBLY_BASE.wrapping_add(0x5AFF358) 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(0x59760D0) as *mut usize) = il2cpp_string_new( + *(GAME_ASSEMBLY_BASE.wrapping_add(0x5B21848) 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, + 52661, ] .into_iter() .enumerate() @@ -64,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(0xDE28090), + GAME_ASSEMBLY_BASE.wrapping_add(0x8A82460), on_network_state_change, ) .unwrap(); diff --git a/yixuan/src/modules/hoyopass_patch.rs b/yixuan/src/modules/hoyopass_patch.rs index 99491d1..46ba69d 100644 --- a/yixuan/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 = 0x1ACAB470; -const STATICS: usize = 0x5550778; -const STATIC_ID: usize = 34512; -const FIELD_OFFSET: usize = 0x40; +const ON_COMBO_INIT_SUCCESS: usize = 0x1B854530; +const STATICS: usize = 0x56E72C8; +const STATIC_ID: usize = 34656; +const FIELD_OFFSET: usize = 0x46; pub struct HoyopassPatch; diff --git a/yixuan/src/modules/network.rs b/yixuan/src/modules/network.rs index 096a004..5bc808b 100644 --- a/yixuan/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 = 0x1D14BCE0; -const WEB_REQUEST_CREATE: usize = 0x1CC33EF0; +const MAKE_INITIAL_URL: usize = 0x1DDCAF80; +const WEB_REQUEST_CREATE: usize = 0x1D8CB700; 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 = 0x115CCC0); +import!(il2cpp_string_new(cstr: *const u8) -> usize = 0x1190EE0); impl Network { const SDK_URL: &str = "http://127.0.0.1:20100";