Compare commits

...

2 commits

Author SHA1 Message Date
6d98f8c77e
Tentative support for 1.4 2024-11-15 16:01:07 +01:00
3cb114e821
🦼 bug 2024-11-04 22:16:14 +01:00
5 changed files with 59 additions and 35 deletions

View file

@ -9,9 +9,8 @@ crate-type = ["cdylib"]
[features]
cn_beta_1_4_0 = []
cn_beta_1_3_0 = []
cn_live_1_3_0 = []
os_live_1_3_0 = []
cn_live_1_4_0 = []
os_live_1_4_0 = []
enable-sdk = []
only-sig-bypass = []
regular = ["dep:regex", "dep:widestring"]

41
_archive/offsets.rs Normal file
View file

@ -0,0 +1,41 @@
#[cfg(feature = "cn_beta_1_3_0")]
pub(crate) const CONFIG: InjectConfiguration = InjectConfiguration {
f_pak_file_check: 0x3D2F460,
f_pak_file_check_preamble: 0x8148574157565340,
#[cfg(all(not(feature = "only-sig-bypass"), feature = "regular"))]
kuro_http_get: 0xFC8CF0,
#[cfg(all(not(feature = "enable-sdk"), not(feature = "only-sig-bypass"), feature = "regular"))]
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,
f_pak_file_check_preamble: 0x8148574157565340,
#[cfg(all(not(feature = "only-sig-bypass"), feature = "regular"))]
kuro_http_get: 0xFC9900,
#[cfg(all(not(feature = "enable-sdk"), not(feature = "only-sig-bypass"), feature = "regular"))]
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 CONFIG: InjectConfiguration = InjectConfiguration {
f_pak_file_check: 0x3CDC430,
f_pak_file_check_preamble: 0x8148574157565340,
#[cfg(all(not(feature = "only-sig-bypass"), feature = "regular"))]
kuro_http_get: 0xFC6C20,
#[cfg(all(not(feature = "enable-sdk"), not(feature = "only-sig-bypass"), feature = "regular"))]
disable_sdk: DisableSdkConfiguration{
sdk_dll: s!("KRSDK.dll"),
eula_accept: 0x95440,
sdk_go_away: 0xA1280
}
};

View file

@ -15,12 +15,10 @@ EXIT /B 0
SETLOCAL ENABLEDELAYEDEXPANSION
: Build for cn_beta_1_4_0
call:cargoReleaseBuild "cn_beta_1_4_0,%~1" %~1
: Build for cn_beta_1_3_0
call:cargoReleaseBuild "cn_beta_1_3_0,%~1" %~1
: Build for cn_live_1_3_0
call:cargoReleaseBuild "cn_live_1_3_0,%~1" %~1
call:cargoReleaseBuild "cn_live_1_4_0,%~1" %~1
: Build for os_live_1_3_0
call:cargoReleaseBuild "os_live_1_3_0,%~1" %~1
call:cargoReleaseBuild "os_live_1_4_0,%~1" %~1
ENDLOCAL
EXIT /B 0

View file

@ -52,7 +52,7 @@ unsafe extern "win64" fn on_kurohttp_get(reg: *mut Registers, _: usize) {
if let Some(result) = replacer.replace(url.as_str()) {
println!("Redirecting to: {result}");
// TODO: Track https://doc.rust-lang.org/nightly/unstable-book/library-features/str-from-utf16-endian.html to replace widestring when stabilized
let new_url = widestring::U16String::from_str(result.as_str());
let new_url = widestring::U16CString::from_str(result.as_str()).unwrap();
let new_wstr = PCWSTR::from_raw(new_url.as_ptr());
std::ptr::copy_nonoverlapping(new_wstr.as_ptr(), wstr, new_wstr.as_wide().len() + 2);
};

View file

@ -19,7 +19,7 @@ pub(crate) struct InjectConfiguration {
#[cfg(feature = "cn_beta_1_4_0")]
pub(crate) const CONFIG: InjectConfiguration = InjectConfiguration {
f_pak_file_check: 0x3E37D90, // 0x3E37D90
f_pak_file_check: 0x3E37D90,
f_pak_file_check_preamble: 0x8148574157565340,
#[cfg(all(not(feature = "only-sig-bypass"), feature = "regular"))]
kuro_http_get: 0xFE9E00,
@ -31,44 +31,30 @@ pub(crate) const CONFIG: InjectConfiguration = InjectConfiguration {
}
};
#[cfg(feature = "cn_beta_1_3_0")]
#[cfg(feature = "cn_live_1_4_0")]
pub(crate) const CONFIG: InjectConfiguration = InjectConfiguration {
f_pak_file_check: 0x3D2F460,
f_pak_file_check_preamble: 0x8148574157565340,
f_pak_file_check: 0x3E3FCB0,
f_pak_file_check_preamble: 0x5741544156535540,
#[cfg(all(not(feature = "only-sig-bypass"), feature = "regular"))]
kuro_http_get: 0xFC8CF0,
kuro_http_get: 0xFED3E0,
#[cfg(all(not(feature = "enable-sdk"), not(feature = "only-sig-bypass"), feature = "regular"))]
disable_sdk: DisableSdkConfiguration{
sdk_dll: s!("KRSDKEx.dll"),
eula_accept: 0x4A690,
sdk_go_away: 0x8BB80,
eula_accept: 0x4A6D0,
sdk_go_away: 0x8BB40,
}
};
#[cfg(feature = "cn_live_1_3_0")]
#[cfg(feature = "os_live_1_4_0")]
pub(crate) const CONFIG: InjectConfiguration = InjectConfiguration {
f_pak_file_check: 0x3D35DF0,
f_pak_file_check_preamble: 0x8148574157565340,
f_pak_file_check: 0x3DE6650,
f_pak_file_check_preamble: 0x5741544156535540,
#[cfg(all(not(feature = "only-sig-bypass"), feature = "regular"))]
kuro_http_get: 0xFC9900,
#[cfg(all(not(feature = "enable-sdk"), not(feature = "only-sig-bypass"), feature = "regular"))]
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 CONFIG: InjectConfiguration = InjectConfiguration {
f_pak_file_check: 0x3CDC430,
f_pak_file_check_preamble: 0x8148574157565340,
#[cfg(all(not(feature = "only-sig-bypass"), feature = "regular"))]
kuro_http_get: 0xFC6C20,
kuro_http_get: 0xFEA7A0,
#[cfg(all(not(feature = "enable-sdk"), not(feature = "only-sig-bypass"), feature = "regular"))]
disable_sdk: DisableSdkConfiguration{
sdk_dll: s!("KRSDK.dll"),
eula_accept: 0x95440,
sdk_go_away: 0xA1280
eula_accept: 0x959D0,
sdk_go_away: 0xA1810
}
};