add support for 3.4.2

This commit is contained in:
anna 2023-03-12 22:18:25 +00:00
parent 7c7066e58e
commit 79814d17e1
No known key found for this signature in database
GPG Key ID: 020F70A824FB8206
1 changed files with 13 additions and 12 deletions

View File

@ -7,31 +7,33 @@ use std::error::Error;
use gdke_gui::{app::gdkeApp, Data}; use gdke_gui::{app::gdkeApp, Data};
use poggers::{external::process::ExProcess, traits::Mem}; 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() { fn main() {
let (stx, srx) = std::sync::mpsc::channel::<Data>(); let (stx, srx) = std::sync::mpsc::channel::<Data>();
let (ctx, crx) = std::sync::mpsc::channel::<Data>(); let (ctx, crx) = std::sync::mpsc::channel::<Data>();
let jh = std::thread::spawn(move || {
let jh = std::thread::spawn(move|| {
loop { loop {
if let Ok(x) = crx.try_recv() { if let Ok(x) = crx.try_recv() {
match x { match x {
Data::Pid(pid) => { Data::Pid(pid) => {
println!("Got pid: {}", pid); println!("Got pid: {}", pid);
match (|| -> Result<(),Box<dyn Error>> { match (|| -> Result<(), Box<dyn Error>> {
let proc = ExProcess::new_from_pid(pid)?; let proc = ExProcess::new_from_pid(pid)?;
let bm = proc.get_base_module()?; let bm = proc.get_base_module()?;
for sig in SIGS.iter() { for sig in SIGS.iter() {
let res = unsafe {bm.scan_virtual(sig)}; let res = unsafe { bm.scan_virtual(sig) };
if let Some(x) = res { 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 { if let Ok(x) = data {
println!("found key @ {:X}", x); 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 { if let Ok(x) = key_data {
// print!("Key: "); // print!("Key: ");
let mut data_string = String::new(); let mut data_string = String::new();
@ -53,16 +55,15 @@ fn main() {
} }
// Ok(()) // Ok(())
Err("Failed to find key".into()) Err("Failed to find key".into())
})() { })() {
Ok(_) => {}, Ok(_) => {}
Err(er) => { Err(er) => {
println!("Error: {}", er); println!("Error: {}", er);
stx.send(Data::Failure(er.to_string())).unwrap(); stx.send(Data::Failure(er.to_string())).unwrap();
continue; continue;
} }
} }
}, }
_ => {} _ => {}
} }
} }