From eaef238be277a7bcf6e16905daa5003df7083f35 Mon Sep 17 00:00:00 2001 From: aixeria <44528100+pozm@users.noreply.github.com> Date: Wed, 29 Mar 2023 18:51:14 +0100 Subject: [PATCH] fix bug with exit --- .idea/.gitignore | 8 +++++++ Cargo.lock | 57 ++++++++++++++++++++++++++------------------ Cargo.toml | 6 ++--- gdke-gui/src/app.rs | 3 ++- gdke-gui/src/lib.rs | 3 ++- gdke-gui/src/main.rs | 7 +++++- src/lib.rs | 2 ++ 7 files changed, 56 insertions(+), 30 deletions(-) create mode 100644 .idea/.gitignore diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -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 diff --git a/Cargo.lock b/Cargo.lock index aef4cac..fc3cc09 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -252,7 +252,7 @@ checksum = "3b015a331cc64ebd1774ba119538573603427eaace0a1950c423ab971f903796" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -269,7 +269,7 @@ checksum = "1cd7fce9ba8c3c042128ce72d8b2ddbf3a05747efb67ea0313c635e10bda47a2" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -304,7 +304,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn", + "syn 1.0.107", "zbus", "zbus_names", "zvariant", @@ -379,7 +379,7 @@ checksum = "5fe233b960f12f8007e3db2d136e3cb1c291bfd7396e384ee76025fc1a3932b4" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -584,12 +584,12 @@ dependencies = [ [[package]] name = "ctor" -version = "0.1.26" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" +checksum = "dd4056f63fce3b82d852c3da92b08ea59959890813a7f4ce9c0ff85b10cf301b" dependencies = [ "quote", - "syn", + "syn 2.0.11", ] [[package]] @@ -606,7 +606,7 @@ checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -765,7 +765,7 @@ checksum = "f58dc3c5e468259f19f2d46304a6b28f1c3d034442e14b322d2b850e36f6d5ae" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -1302,7 +1302,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -1515,18 +1515,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.49" +version = "1.0.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5" +checksum = "e472a104799c74b514a57226160104aa483546de37e839ec50e3c2e41dd87534" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.23" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" dependencies = [ "proc-macro2", ] @@ -1688,7 +1688,7 @@ checksum = "255abe9a125a985c05190d687b320c12f9b1f0b99445e608c21ba0782c719ad8" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -1699,7 +1699,7 @@ checksum = "9a5ec9fa74a20ebbe5d9ac23dac1fc96ba0ecfe9f50f2843b52e537b10fbcb4e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -1805,6 +1805,17 @@ dependencies = [ "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]] name = "tempfile" version = "3.3.0" @@ -1836,7 +1847,7 @@ checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -1908,7 +1919,7 @@ checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -2030,7 +2041,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn", + "syn 1.0.107", "wasm-bindgen-shared", ] @@ -2064,7 +2075,7 @@ checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2275,7 +2286,7 @@ checksum = "9539b6bd3eadbd9de66c9666b22d802b833da7e996bc06896142e09854a61767" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -2534,7 +2545,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn", + "syn 1.0.107", ] [[package]] @@ -2571,5 +2582,5 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] diff --git a/Cargo.toml b/Cargo.toml index 7264bab..b050216 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,12 +14,10 @@ inherits = "release" debug = true strip = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -poggers = {version = "*", path = "../poggers"} - [workspace] members = [ "gdke-gui", ] +[dependencies] +poggers = {version = "*", path = "../poggers"} diff --git a/gdke-gui/src/app.rs b/gdke-gui/src/app.rs index 4caea34..2c14e61 100644 --- a/gdke-gui/src/app.rs +++ b/gdke-gui/src/app.rs @@ -69,7 +69,8 @@ impl eframe::App for gdkeApp { println!("Failed to get key"); *last_key = format!("Failed to get key: {}", e); } - Data::Pid(_) => {unreachable!()} + Data::Pid(_) => {unreachable!()}, + Data::EXIT => {unreachable!()} } } else{ ui.centered_and_justified(|ui| { diff --git a/gdke-gui/src/lib.rs b/gdke-gui/src/lib.rs index c90be5a..5c2ff40 100644 --- a/gdke-gui/src/lib.rs +++ b/gdke-gui/src/lib.rs @@ -6,5 +6,6 @@ pub mod app; pub enum Data { Pid(u32), Key(String), - Failure(String) + Failure(String), + EXIT } \ No newline at end of file diff --git a/gdke-gui/src/main.rs b/gdke-gui/src/main.rs index 64318c4..3af818c 100644 --- a/gdke-gui/src/main.rs +++ b/gdke-gui/src/main.rs @@ -31,6 +31,9 @@ fn main() { } } } + Data::EXIT => { + break; + }, _ => {} } } @@ -39,11 +42,13 @@ fn main() { }); let native_options = eframe::NativeOptions::default(); + let ctx2 = ctx.clone(); eframe::run_native( "gdke", 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(); } diff --git a/src/lib.rs b/src/lib.rs index 4c30a8c..a1389b7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,7 +15,9 @@ pub fn get_from_pid(pid:u32) -> Result> { let proc = ExProcess::new_from_pid(pid)?; let bm = proc.get_base_module()?; for sig in &SIGS { + let timer = std::time::Instant::now(); let res = unsafe { bm.scan_virtual(sig) }; + println!("Scan took: {}ms", timer.elapsed().as_millis()); if let Some(x) = res { let data = unsafe { bm.resolve_relative_ptr(x + 3, 4) }; if let Ok(x) = data {