feat: update pattern
This commit is contained in:
+10
-21
@@ -7,12 +7,10 @@ use crate::util::scan_il2cpp_section;
|
||||
const IL2CPP_STRING_NEW_LEN: &str =
|
||||
"E8 ? ? ? ? EB ? 31 C0 48 89 06 48 8B 47 ? 48 89 46 ? F2 0F 10 47";
|
||||
const MAKE_INITIAL_URL: &str =
|
||||
"E8 ? ? ? ? 48 89 D9 48 89 C2 E8 ? ? ? ? 48 89 D9 4C 89 FA E8 ? ? ? ? 49 89 5D"; // TODO
|
||||
"55 41 56 56 57 53 48 81 EC 90 00 00 00 48 8D AC 24 ? ? ? ? 48 C7 45 ? ? ? ? ? 48 85 C9 74";
|
||||
const SET_DITHER: &str = "E8 ? ? ? ? 84 C0 75 ? C7 43";
|
||||
const SDK_PUBLIC_KEY_LITERAL: &str =
|
||||
"48 8B 0D ? ? ? ? 4C 89 E2 E8 ? ? ? ? 48 89 C6 48 8B 0D ? ? ? ? E8 ? ? ? ? 48 89 C7 48 8B 0D";
|
||||
// const HK_CHECK1: &str = "55 41 56 56 57 53 48 81 EC 00 01 00 00 48 8D AC 24 80 00 00 00 C7 45 7C 00 00 00 00";
|
||||
// const HK_CHECK2: &str = "55 41 57 41 56 41 55 41 54 56 57 53 48 81 EC B8 02 00 00";
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct RVAConfig {
|
||||
@@ -38,7 +36,15 @@ pub static GAME_ASSEMBLY_BASE: LazyLock<usize> =
|
||||
|
||||
macro_rules! set_rva {
|
||||
($base:ident, $config:ident, $field:ident, $scan_fn:ident, $rva_pat:expr, $fallback:expr) => {
|
||||
if let Some(addr) = unsafe { $scan_fn($rva_pat) } {
|
||||
if $rva_pat == "" {
|
||||
$config.$field = *$base + $fallback;
|
||||
println!(
|
||||
"[hkrpg::addr::set_rva] Using fallback relative address for {} [{}] -> 0x{:X}",
|
||||
stringify!($field),
|
||||
stringify!($base),
|
||||
$config.$field - *$base
|
||||
);
|
||||
} else if let Some(addr) = unsafe { $scan_fn($rva_pat) } {
|
||||
$config.$field = addr;
|
||||
println!(
|
||||
"[hkrpg::addr::set_rva] Found relative address for {} [{}] -> 0x{:X}",
|
||||
@@ -101,21 +107,4 @@ pub unsafe fn init_rvas() {
|
||||
SDK_PUBLIC_KEY_LITERAL,
|
||||
0x0
|
||||
)
|
||||
|
||||
// set_rva!(
|
||||
// UNITY_PLAYER_BASE,
|
||||
// config,
|
||||
// hk_check1,
|
||||
// scan_unity_player_section,
|
||||
// HK_CHECK1,
|
||||
// 0x0
|
||||
// );
|
||||
// set_rva!(
|
||||
// UNITY_PLAYER_BASE,
|
||||
// config,
|
||||
// hk_check2,
|
||||
// scan_unity_player_section,
|
||||
// HK_CHECK2,
|
||||
// 0x0
|
||||
// );
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ impl HkrpgModule for HkrpgModuleContext<Network> {
|
||||
|
||||
impl Network {
|
||||
const SDK_URL: &str = "http://127.0.0.1:21000";
|
||||
// const DISPATCH_URL: &str = "http://127.0.0.1:21000";
|
||||
const DISPATCH_URL: &str = "http://127.0.0.1:21000";
|
||||
const REDIRECT_SDK: bool = true;
|
||||
const REDIRECT_DISPATCH: bool = true;
|
||||
|
||||
@@ -38,7 +38,7 @@ impl Network {
|
||||
s if (s.contains("bhsr.com") || s.contains("starrails.com"))
|
||||
&& Self::REDIRECT_DISPATCH =>
|
||||
{
|
||||
Self::SDK_URL.to_string()
|
||||
Self::DISPATCH_URL.to_string()
|
||||
}
|
||||
s => {
|
||||
println!("Leaving request as-is: {s}");
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ use windows::Win32::{
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
#[allow(non_snake_case, unused_variables)]
|
||||
extern "cdecl" fn Initialize() -> bool {
|
||||
extern "C" fn Initialize() -> bool {
|
||||
std::thread::sleep(std::time::Duration::from_secs(2));
|
||||
|
||||
unsafe {
|
||||
|
||||
Reference in New Issue
Block a user