diff --git a/launcher/src/main.rs b/launcher/src/main.rs index f478e18..b581b6d 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!("ZenlessZoneZeroBeta.exe"); +const GAME_EXECUTABLE: PCSTR = s!("ZenlessZoneZero.exe"); const INJECT_DLL: &str = "trigger.dll"; fn inject_standard(h_target: HANDLE, dll_path: &str) -> bool { diff --git a/trigger/src/modules/crypto.rs b/trigger/src/modules/crypto.rs index fa88226..847a290 100644 --- a/trigger/src/modules/crypto.rs +++ b/trigger/src/modules/crypto.rs @@ -7,14 +7,14 @@ use crate::{ util::{import, read_csharp_string, GAME_ASSEMBLY_BASE}, }; -import!(rsa_create() -> usize = 0x69100D0); -import!(rsa_from_xml_string(instance: usize, xml_string: usize) -> usize = 0x6910310); -import!(il2cpp_string_new(cstr: *const u8) -> usize = 0x3538F0); +import!(rsa_create() -> usize = 0x18F33050); +import!(rsa_from_xml_string(instance: usize, xml_string: usize) -> usize = 0x18F33290); +import!(il2cpp_string_new(cstr: *const u8) -> usize = 0x2E7FC0); 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(0x4F251C0) as *const usize)) + 244080) as *mut usize; + ((*(GAME_ASSEMBLY_BASE.wrapping_add(0x4EB7100) as *const usize)) + 244072) as *mut usize; let rsa = rsa_create(); rsa_from_xml_string( @@ -33,14 +33,14 @@ 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(0x5237348) as *mut usize) = il2cpp_string_new( + *(GAME_ASSEMBLY_BASE.wrapping_add(0x51C92D8) 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(0x5257948) as *mut usize) = il2cpp_string_new( + *(GAME_ASSEMBLY_BASE.wrapping_add(0x5257950) as *mut usize) = il2cpp_string_new( [ 27818, 40348, 47410, 27936, 51394, 33172, 51987, 33287, 44524, 39195, 47922, 8238, 53932, 42445, 929, 38470, 27758, 56475, 5938, 26471, 58462, 55701, 37675, 22326, 36428, @@ -63,14 +63,14 @@ 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(0x86F05A0), + GAME_ASSEMBLY_BASE.wrapping_add(0x773B460), on_network_state_change, ) .unwrap(); interceptor .attach( - GAME_ASSEMBLY_BASE.wrapping_add(0x9326760), + GAME_ASSEMBLY_BASE.wrapping_add(0x8F88960), download_data_slave, ) .unwrap(); diff --git a/trigger/src/modules/network.rs b/trigger/src/modules/network.rs index b46ccee..25743ec 100644 --- a/trigger/src/modules/network.rs +++ b/trigger/src/modules/network.rs @@ -2,12 +2,11 @@ use std::ffi::CString; use ilhook::x64::Registers; -use crate::util::{self, import, read_csharp_string}; +use crate::util::{self, import}; use super::{ModuleInitError, NapModule, NapModuleContext}; -const MAKE_INITIAL_URL: usize = 0x7CE75F0; -const WEB_REQUEST_CREATE: usize = 0x798F080; +const MAKE_INITIAL_URL: usize = 0x6D2C560; pub struct Network; @@ -18,26 +17,11 @@ impl NapModule for NapModuleContext { Network::on_make_initial_url, )?; - self.interceptor.attach( - self.base.wrapping_add(WEB_REQUEST_CREATE), - on_web_request_create, - )?; - Ok(()) } } -unsafe extern "win64" fn on_web_request_create(reg: *mut Registers, _: usize) { - let s = read_csharp_string((*reg).rcx as usize); - if s.contains("StandaloneWindows64/cn/") { - let s = s.replace("StandaloneWindows64/cn/", "StandaloneWindows64/oversea/"); - println!("replaced: {s}"); - (*reg).rcx = - il2cpp_string_new(CString::new(s).unwrap().to_bytes_with_nul().as_ptr()) as u64; - } -} - -import!(il2cpp_string_new(cstr: *const u8) -> usize = 0x3538F0); +import!(il2cpp_string_new(cstr: *const u8) -> usize = 0x2E7FC0); impl Network { const SDK_URL: &str = "http://127.0.0.1:20100";