Updated to CN Live 1.3.0
This commit is contained in:
parent
642edcf684
commit
dbd6226c96
4 changed files with 44 additions and 19 deletions
|
@ -9,7 +9,9 @@ crate-type = ["cdylib"]
|
|||
|
||||
[features]
|
||||
cn_beta_1_3_0 = []
|
||||
cn_live_1_3_0 = []
|
||||
os_live_1_3_0 = []
|
||||
enable-sdk = []
|
||||
|
||||
[dependencies]
|
||||
ilhook = "2.1.1"
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
: Build for cn_beta_1_3_0
|
||||
cargo build --release --no-default-features -F cn_beta_1_3_0
|
||||
: Build for cn_live_1_3_0
|
||||
cargo build --release --no-default-features -F cn_live_1_3_0
|
||||
: Build for os_live_1_3_0
|
||||
cargo build --release --no-default-features -F os_live_1_3_0
|
12
src/lib.rs
12
src/lib.rs
|
@ -11,11 +11,7 @@ use windows::Win32::{Foundation::HINSTANCE, System::LibraryLoader::GetModuleHand
|
|||
mod interceptor;
|
||||
mod offsets;
|
||||
|
||||
#[cfg(feature = "cn_beta_1_3_0")]
|
||||
use offsets::CN_BETA_1_3_0_CONFIG as CONFIG;
|
||||
|
||||
#[cfg(feature = "os_live_1_3_0")]
|
||||
use offsets::OS_LIVE_1_3_0_CONFIG as CONFIG;
|
||||
use offsets::CONFIG;
|
||||
|
||||
unsafe fn thread_func() {
|
||||
Console::AllocConsole().unwrap();
|
||||
|
@ -38,18 +34,18 @@ unsafe fn thread_func() {
|
|||
.unwrap();
|
||||
|
||||
let krsdk_ex = loop {
|
||||
match GetModuleHandleA(CONFIG.sdk_dll) {
|
||||
match GetModuleHandleA(CONFIG.disable_sdk.sdk_dll) {
|
||||
Ok(handle) => break handle,
|
||||
Err(_) => thread::sleep(Duration::from_millis(1)),
|
||||
}
|
||||
};
|
||||
|
||||
interceptor
|
||||
.replace((krsdk_ex.0 as usize) + CONFIG.eula_accept, dummy)
|
||||
.replace((krsdk_ex.0 as usize) + CONFIG.disable_sdk.eula_accept, dummy)
|
||||
.unwrap();
|
||||
|
||||
interceptor
|
||||
.replace((krsdk_ex.0 as usize) + CONFIG.sdk_go_away, dummy)
|
||||
.replace((krsdk_ex.0 as usize) + CONFIG.disable_sdk.sdk_go_away, dummy)
|
||||
.unwrap();
|
||||
|
||||
println!("Successfully initialized!");
|
||||
|
|
|
@ -1,27 +1,52 @@
|
|||
#[cfg(not(feature = "enable-sdk"))]
|
||||
use windows::core::{PCSTR, s};
|
||||
|
||||
pub(crate) struct InjectConfiguration {
|
||||
pub(crate) f_pak_file_check: usize,
|
||||
pub(crate) kuro_http_get: usize,
|
||||
#[cfg(not(feature = "enable-sdk"))]
|
||||
pub(crate) struct DisableSdkConfiguration {
|
||||
pub(crate) sdk_dll: PCSTR,
|
||||
pub(crate) eula_accept: usize,
|
||||
pub(crate) sdk_go_away: usize,
|
||||
}
|
||||
|
||||
pub(crate) struct InjectConfiguration {
|
||||
pub(crate) f_pak_file_check: usize,
|
||||
pub(crate) kuro_http_get: usize,
|
||||
#[cfg(not(feature = "enable-sdk"))]
|
||||
pub(crate) disable_sdk: DisableSdkConfiguration,
|
||||
}
|
||||
|
||||
#[cfg(feature = "cn_beta_1_3_0")]
|
||||
pub(crate) const CN_BETA_1_3_0_CONFIG: InjectConfiguration = InjectConfiguration {
|
||||
pub(crate) const CONFIG: InjectConfiguration = InjectConfiguration {
|
||||
f_pak_file_check: 0x3D2F460,
|
||||
kuro_http_get: 0xFC8CF0,
|
||||
sdk_dll: s!("KRSDKEx.dll"),
|
||||
eula_accept: 0x4A690,
|
||||
sdk_go_away: 0x8BB80
|
||||
#[cfg(not(feature = "enable-sdk"))]
|
||||
disable_sdk: DisableSdkConfiguration{
|
||||
sdk_dll: s!("KRSDKEx.dll"),
|
||||
eula_accept: 0x4A690,
|
||||
sdk_go_away: 0x8BB80,
|
||||
}
|
||||
};
|
||||
|
||||
#[cfg(feature = "cn_live_1_3_0")]
|
||||
pub(crate) const CONFIG: InjectConfiguration = InjectConfiguration {
|
||||
f_pak_file_check: 0x3D35DF0,
|
||||
kuro_http_get: 0xFC9900,
|
||||
#[cfg(not(feature = "enable-sdk"))]
|
||||
disable_sdk: DisableSdkConfiguration{
|
||||
sdk_dll: s!("KRSDKEx.dll"),
|
||||
eula_accept: 0x4A690,
|
||||
sdk_go_away: 0x8B9F0,
|
||||
}
|
||||
};
|
||||
|
||||
#[cfg(feature = "os_live_1_3_0")]
|
||||
pub(crate) const OS_LIVE_1_3_0_CONFIG: InjectConfiguration = InjectConfiguration {
|
||||
pub(crate) const CONFIG: InjectConfiguration = InjectConfiguration {
|
||||
f_pak_file_check: 0x3CDC430,
|
||||
kuro_http_get: 0xFC6C20,
|
||||
sdk_dll: s!("KRSDK.dll"),
|
||||
eula_accept: 0x94710,
|
||||
sdk_go_away: 0x9FE10
|
||||
#[cfg(not(feature = "enable-sdk"))]
|
||||
disable_sdk: DisableSdkConfiguration{
|
||||
sdk_dll: s!("KRSDK.dll"),
|
||||
eula_accept: 0x94710,
|
||||
sdk_go_away: 0x9FE10
|
||||
}
|
||||
};
|
Loading…
Reference in a new issue