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]
|
[features]
|
||||||
cn_beta_1_3_0 = []
|
cn_beta_1_3_0 = []
|
||||||
|
cn_live_1_3_0 = []
|
||||||
os_live_1_3_0 = []
|
os_live_1_3_0 = []
|
||||||
|
enable-sdk = []
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
ilhook = "2.1.1"
|
ilhook = "2.1.1"
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
: Build for cn_beta_1_3_0
|
: Build for cn_beta_1_3_0
|
||||||
cargo build --release --no-default-features -F 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
|
: Build for os_live_1_3_0
|
||||||
cargo build --release --no-default-features -F 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 interceptor;
|
||||||
mod offsets;
|
mod offsets;
|
||||||
|
|
||||||
#[cfg(feature = "cn_beta_1_3_0")]
|
use offsets::CONFIG;
|
||||||
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;
|
|
||||||
|
|
||||||
unsafe fn thread_func() {
|
unsafe fn thread_func() {
|
||||||
Console::AllocConsole().unwrap();
|
Console::AllocConsole().unwrap();
|
||||||
|
@ -38,18 +34,18 @@ unsafe fn thread_func() {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let krsdk_ex = loop {
|
let krsdk_ex = loop {
|
||||||
match GetModuleHandleA(CONFIG.sdk_dll) {
|
match GetModuleHandleA(CONFIG.disable_sdk.sdk_dll) {
|
||||||
Ok(handle) => break handle,
|
Ok(handle) => break handle,
|
||||||
Err(_) => thread::sleep(Duration::from_millis(1)),
|
Err(_) => thread::sleep(Duration::from_millis(1)),
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
interceptor
|
interceptor
|
||||||
.replace((krsdk_ex.0 as usize) + CONFIG.eula_accept, dummy)
|
.replace((krsdk_ex.0 as usize) + CONFIG.disable_sdk.eula_accept, dummy)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
interceptor
|
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();
|
.unwrap();
|
||||||
|
|
||||||
println!("Successfully initialized!");
|
println!("Successfully initialized!");
|
||||||
|
|
|
@ -1,27 +1,52 @@
|
||||||
|
#[cfg(not(feature = "enable-sdk"))]
|
||||||
use windows::core::{PCSTR, s};
|
use windows::core::{PCSTR, s};
|
||||||
|
|
||||||
pub(crate) struct InjectConfiguration {
|
#[cfg(not(feature = "enable-sdk"))]
|
||||||
pub(crate) f_pak_file_check: usize,
|
pub(crate) struct DisableSdkConfiguration {
|
||||||
pub(crate) kuro_http_get: usize,
|
|
||||||
pub(crate) sdk_dll: PCSTR,
|
pub(crate) sdk_dll: PCSTR,
|
||||||
pub(crate) eula_accept: usize,
|
pub(crate) eula_accept: usize,
|
||||||
pub(crate) sdk_go_away: 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")]
|
#[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,
|
f_pak_file_check: 0x3D2F460,
|
||||||
kuro_http_get: 0xFC8CF0,
|
kuro_http_get: 0xFC8CF0,
|
||||||
sdk_dll: s!("KRSDKEx.dll"),
|
#[cfg(not(feature = "enable-sdk"))]
|
||||||
eula_accept: 0x4A690,
|
disable_sdk: DisableSdkConfiguration{
|
||||||
sdk_go_away: 0x8BB80
|
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")]
|
#[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,
|
f_pak_file_check: 0x3CDC430,
|
||||||
kuro_http_get: 0xFC6C20,
|
kuro_http_get: 0xFC6C20,
|
||||||
sdk_dll: s!("KRSDK.dll"),
|
#[cfg(not(feature = "enable-sdk"))]
|
||||||
eula_accept: 0x94710,
|
disable_sdk: DisableSdkConfiguration{
|
||||||
sdk_go_away: 0x9FE10
|
sdk_dll: s!("KRSDK.dll"),
|
||||||
|
eula_accept: 0x94710,
|
||||||
|
sdk_go_away: 0x9FE10
|
||||||
|
}
|
||||||
};
|
};
|
Loading…
Reference in a new issue