From 79814d17e11811e118e8958236baab164c5ca328 Mon Sep 17 00:00:00 2001 From: anna <44528100+pozm@users.noreply.github.com> Date: Sun, 12 Mar 2023 22:18:25 +0000 Subject: [PATCH] add support for 3.4.2 --- gdke-gui/src/main.rs | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/gdke-gui/src/main.rs b/gdke-gui/src/main.rs index 7df4a8d..27d8be2 100644 --- a/gdke-gui/src/main.rs +++ b/gdke-gui/src/main.rs @@ -7,31 +7,33 @@ use std::error::Error; use gdke_gui::{app::gdkeApp, Data}; use poggers::{external::process::ExProcess, traits::Mem}; -const SIGS: [&str; 3] = ["48 8D 05 ? ? ? ? 41 8A 04 04","48 8D 05 ? ? ? ? 0F B6 ? 03","4C 8D 05 ? ? ? ? 0F 1F 40 00"]; +const SIGS: [&str; 4] = [ + "48 8D 3D ? ? ? ? 48 85 C0 74 3B", + "48 8D 05 ? ? ? ? 41 8A 04 04", + "48 8D 05 ? ? ? ? 0F B6 ? 03", + "4C 8D 05 ? ? ? ? 0F 1F 40 00", +]; fn main() { - let (stx, srx) = std::sync::mpsc::channel::(); let (ctx, crx) = std::sync::mpsc::channel::(); - - let jh = std::thread::spawn(move|| { + let jh = std::thread::spawn(move || { loop { if let Ok(x) = crx.try_recv() { match x { Data::Pid(pid) => { println!("Got pid: {}", pid); - match (|| -> Result<(),Box> { - + match (|| -> Result<(), Box> { let proc = ExProcess::new_from_pid(pid)?; let bm = proc.get_base_module()?; for sig in SIGS.iter() { - let res = unsafe {bm.scan_virtual(sig)}; + let res = unsafe { bm.scan_virtual(sig) }; if let Some(x) = res { - let data = unsafe {bm.resolve_relative_ptr(x+3, 4)}; + let data = unsafe { bm.resolve_relative_ptr(x + 3, 4) }; if let Ok(x) = data { println!("found key @ {:X}", x); - let key_data = unsafe {bm.read_sized(x, 32)}; + let key_data = unsafe { bm.read_sized(x, 32) }; if let Ok(x) = key_data { // print!("Key: "); let mut data_string = String::new(); @@ -53,16 +55,15 @@ fn main() { } // Ok(()) Err("Failed to find key".into()) - })() { - Ok(_) => {}, + Ok(_) => {} Err(er) => { println!("Error: {}", er); stx.send(Data::Failure(er.to_string())).unwrap(); continue; } } - }, + } _ => {} } }