fix bug with exit

This commit is contained in:
aixeria 2023-03-29 18:51:14 +01:00
parent 949749dee7
commit eaef238be2
No known key found for this signature in database
GPG Key ID: 467AA86A19528630
7 changed files with 56 additions and 30 deletions

8
.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

57
Cargo.lock generated
View File

@ -252,7 +252,7 @@ checksum = "3b015a331cc64ebd1774ba119538573603427eaace0a1950c423ab971f903796"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn 1.0.107",
] ]
[[package]] [[package]]
@ -269,7 +269,7 @@ checksum = "1cd7fce9ba8c3c042128ce72d8b2ddbf3a05747efb67ea0313c635e10bda47a2"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn 1.0.107",
] ]
[[package]] [[package]]
@ -304,7 +304,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"serde", "serde",
"syn", "syn 1.0.107",
"zbus", "zbus",
"zbus_names", "zbus_names",
"zvariant", "zvariant",
@ -379,7 +379,7 @@ checksum = "5fe233b960f12f8007e3db2d136e3cb1c291bfd7396e384ee76025fc1a3932b4"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn 1.0.107",
] ]
[[package]] [[package]]
@ -584,12 +584,12 @@ dependencies = [
[[package]] [[package]]
name = "ctor" name = "ctor"
version = "0.1.26" version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" checksum = "dd4056f63fce3b82d852c3da92b08ea59959890813a7f4ce9c0ff85b10cf301b"
dependencies = [ dependencies = [
"quote", "quote",
"syn", "syn 2.0.11",
] ]
[[package]] [[package]]
@ -606,7 +606,7 @@ checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn 1.0.107",
] ]
[[package]] [[package]]
@ -765,7 +765,7 @@ checksum = "f58dc3c5e468259f19f2d46304a6b28f1c3d034442e14b322d2b850e36f6d5ae"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn 1.0.107",
] ]
[[package]] [[package]]
@ -1302,7 +1302,7 @@ dependencies = [
"proc-macro-crate", "proc-macro-crate",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn 1.0.107",
] ]
[[package]] [[package]]
@ -1515,18 +1515,18 @@ dependencies = [
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.49" version = "1.0.54"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5" checksum = "e472a104799c74b514a57226160104aa483546de37e839ec50e3c2e41dd87534"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
[[package]] [[package]]
name = "quote" name = "quote"
version = "1.0.23" version = "1.0.26"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
] ]
@ -1688,7 +1688,7 @@ checksum = "255abe9a125a985c05190d687b320c12f9b1f0b99445e608c21ba0782c719ad8"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn 1.0.107",
] ]
[[package]] [[package]]
@ -1699,7 +1699,7 @@ checksum = "9a5ec9fa74a20ebbe5d9ac23dac1fc96ba0ecfe9f50f2843b52e537b10fbcb4e"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn 1.0.107",
] ]
[[package]] [[package]]
@ -1805,6 +1805,17 @@ dependencies = [
"unicode-ident", "unicode-ident",
] ]
[[package]]
name = "syn"
version = "2.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21e3787bb71465627110e7d87ed4faaa36c1f61042ee67badb9e2ef173accc40"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]] [[package]]
name = "tempfile" name = "tempfile"
version = "3.3.0" version = "3.3.0"
@ -1836,7 +1847,7 @@ checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn 1.0.107",
] ]
[[package]] [[package]]
@ -1908,7 +1919,7 @@ checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn 1.0.107",
] ]
[[package]] [[package]]
@ -2030,7 +2041,7 @@ dependencies = [
"once_cell", "once_cell",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn 1.0.107",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
@ -2064,7 +2075,7 @@ checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn 1.0.107",
"wasm-bindgen-backend", "wasm-bindgen-backend",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
@ -2275,7 +2286,7 @@ checksum = "9539b6bd3eadbd9de66c9666b22d802b833da7e996bc06896142e09854a61767"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn 1.0.107",
] ]
[[package]] [[package]]
@ -2534,7 +2545,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"regex", "regex",
"syn", "syn 1.0.107",
] ]
[[package]] [[package]]
@ -2571,5 +2582,5 @@ dependencies = [
"proc-macro-crate", "proc-macro-crate",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn 1.0.107",
] ]

View File

@ -14,12 +14,10 @@ inherits = "release"
debug = true debug = true
strip = false strip = false
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
poggers = {version = "*", path = "../poggers"}
[workspace] [workspace]
members = [ members = [
"gdke-gui", "gdke-gui",
] ]
[dependencies]
poggers = {version = "*", path = "../poggers"}

View File

@ -69,7 +69,8 @@ impl eframe::App for gdkeApp {
println!("Failed to get key"); println!("Failed to get key");
*last_key = format!("Failed to get key: {}", e); *last_key = format!("Failed to get key: {}", e);
} }
Data::Pid(_) => {unreachable!()} Data::Pid(_) => {unreachable!()},
Data::EXIT => {unreachable!()}
} }
} else{ } else{
ui.centered_and_justified(|ui| { ui.centered_and_justified(|ui| {

View File

@ -6,5 +6,6 @@ pub mod app;
pub enum Data { pub enum Data {
Pid(u32), Pid(u32),
Key(String), Key(String),
Failure(String) Failure(String),
EXIT
} }

View File

@ -31,6 +31,9 @@ fn main() {
} }
} }
} }
Data::EXIT => {
break;
},
_ => {} _ => {}
} }
} }
@ -39,11 +42,13 @@ fn main() {
}); });
let native_options = eframe::NativeOptions::default(); let native_options = eframe::NativeOptions::default();
let ctx2 = ctx.clone();
eframe::run_native( eframe::run_native(
"gdke", "gdke",
native_options, native_options,
Box::new(move |cc| Box::new(gdkeApp::new(cc, srx, ctx))), Box::new(move |cc| Box::new(gdkeApp::new(cc, srx, ctx2))),
); );
ctx.send(Data::EXIT).unwrap();
jh.join(); jh.join();
} }

View File

@ -15,7 +15,9 @@ pub fn get_from_pid(pid:u32) -> Result<String,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 { for sig in &SIGS {
let timer = std::time::Instant::now();
let res = unsafe { bm.scan_virtual(sig) }; let res = unsafe { bm.scan_virtual(sig) };
println!("Scan took: {}ms", timer.elapsed().as_millis());
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 {