From 0cf7c4f6c0831505963e8c3c23b5bce6f051c1a0 Mon Sep 17 00:00:00 2001 From: amelia <44528100+char-ptr@users.noreply.github.com> Date: Sat, 31 Aug 2024 14:31:00 +0100 Subject: [PATCH] feat: done with gui --- Cargo.lock | 2 +- Cargo.toml | 3 +- gdke-gui/bun.lockb | Bin 92981 -> 104927 bytes gdke-gui/package.json | 2 + gdke-gui/src-tauri/Cargo.toml | 3 +- gdke-gui/src-tauri/capabilities/default.json | 7 +- gdke-gui/src-tauri/src/lib.rs | 21 ++- gdke-gui/src-tauri/tauri.conf.json | 4 +- gdke-gui/src/App.css | 2 +- gdke-gui/src/App.tsx | 140 +++++++++++++++++-- gdke-gui/src/components/ui/dialog.tsx | 120 ++++++++++++++++ gdke-gui/src/components/ui/label.tsx | 24 ++++ src/lib.rs | 6 +- 13 files changed, 311 insertions(+), 23 deletions(-) mode change 100644 => 100755 gdke-gui/bun.lockb create mode 100644 gdke-gui/src/components/ui/dialog.tsx create mode 100644 gdke-gui/src/components/ui/label.tsx diff --git a/Cargo.lock b/Cargo.lock index 3d0cfdc..cb9d8c1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1373,7 +1373,6 @@ dependencies = [ "dll-syringe", "poggers 1.2.1 (git+https://github.com/pozm/poggers.git)", "rust-embed", - "tauri-plugin-dialog", "thiserror", "windows 0.56.0", ] @@ -1382,6 +1381,7 @@ dependencies = [ name = "gdke-gui" version = "0.1.0" dependencies = [ + "anyhow", "serde", "serde_json", "tauri", diff --git a/Cargo.toml b/Cargo.toml index 4a208a8..95eeffc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,4 @@ -workspace = { members = ["gdkeinj","gdke-gui/src-tauri"] } +workspace = { members = ["gdkeinj", "gdke-gui/src-tauri"] } [package] name = "gdke" version = "0.2.2" @@ -42,4 +42,3 @@ windows = { features = [ ], version = "0.56" } dll-syringe = "*" poggers = { version = "*", git = "https://github.com/pozm/poggers.git" } -tauri-plugin-dialog = "2.0.0-rc.2" diff --git a/gdke-gui/bun.lockb b/gdke-gui/bun.lockb old mode 100644 new mode 100755 index ed14a5ab26bdddfcae4c8bbfa1957490b44a3126..dcd918782becbd65dff29ec6bff844c5b3cc2d23 GIT binary patch delta 22275 zcmeHvcU)9Q_xHU^T@~qN0mWWWkS0Z77Zg!MB#MffSZFGWfD{!hyJ})dG?r1Xz4sC! z#)8IfEV0MLu2J*YjV+o8Mt#5MmSt^Ee$V^)ecpfG=jwOPoS8Fc&YUT?EHj(WTKu}n za;mSl*G0|H11WzW`Mr40tfdE>U2C(vsf`D!#~d9{&}2`+$dJT2JV%!`KdoC$eSZsy z1T-%rKPPKQ1~<);tz z+ZgG3igZ9gmOCSX_zMWg;?%s9w2XX?`vh7jeHJJgatD<1tIG093(Mg-N*|Pw*DoW0 zD`X61pthiwm|Eqf{sK{|t_|~7x#~0R zrPk$U=A{(CszJrnW{zv?Ahoife?~Sb^^^H==KVw)1Xri-dlipAVrAT3JN4#Ck|FQvNrZdI;80K+=(}oi98?=tfTAixF$SY62Df1Phd0(nLH2N`5KG&&o_io=+pm(5*-(hc5+%0>j|O zl7anY`W4ct-ClC}@&+7-|Aq(N99IkUIv6r=TN93}O&xI*2~=?zC`OrKAt*U)3@BNe z0*b~PPWo_M9ncW)=zK#vP^xH1W&w>XE+ap+Ff%Ki)A>v3jX_DTqfB4Ka6qybNrShFZ;eW~qMgmpj0ZOi~4oZ`05Zp?Ws4FN9x*Ji_pgIRiW8)|&rGG2a znk^+4V?|HNN=eVK2TyulMN1wAD|*^4MoNF(>J!N|FOfifxdoIIo^LIsZvmwi%mXFE zZX%!h^rTGpfl>u$TX7u5r(s1aHo($X9~&nX4*|7BGOboAS@~QenJ;TAtztXkrLmmW zKP77*Y)fb_*{1`gNr`)ePv5MReji&SeuN%7$PJM0VVpbkqnzIG5*g&!T8Wa~=Ah)@ zi%6%jtgLcHDOp*W`2}1W{6Ia@QTE4j$kF8L1d4UaP=fYhxElgsBvpvG=qHaPsUf&y z78K=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gui/package.json +++ b/gdke-gui/package.json @@ -10,6 +10,8 @@ "tauri": "tauri" }, "dependencies": { + "@radix-ui/react-dialog": "^1.1.1", + "@radix-ui/react-label": "^2.1.0", "@radix-ui/react-slot": "^1.1.0", "@tauri-apps/api": ">=2.0.0-rc.0", "@tauri-apps/plugin-dialog": "^2.0.0-rc.0", diff --git a/gdke-gui/src-tauri/Cargo.toml b/gdke-gui/src-tauri/Cargo.toml index 3944fe9..4721efa 100644 --- a/gdke-gui/src-tauri/Cargo.toml +++ b/gdke-gui/src-tauri/Cargo.toml @@ -20,4 +20,5 @@ tauri-plugin-shell = "2.0.0-rc" serde = { version = "1", features = ["derive"] } serde_json = "1" tauri-plugin-dialog = "2.0.0-rc" - +anyhow = "*" +# gdke = { path = "../.." } diff --git a/gdke-gui/src-tauri/capabilities/default.json b/gdke-gui/src-tauri/capabilities/default.json index 3bb4cc4..7c37008 100644 --- a/gdke-gui/src-tauri/capabilities/default.json +++ b/gdke-gui/src-tauri/capabilities/default.json @@ -2,9 +2,12 @@ "$schema": "../gen/schemas/desktop-schema.json", "identifier": "default", "description": "Capability for the main window", - "windows": ["main"], + "windows": [ + "main" + ], "permissions": [ "core:default", - "shell:allow-open" + "shell:allow-open", + "dialog:allow-open" ] } diff --git a/gdke-gui/src-tauri/src/lib.rs b/gdke-gui/src-tauri/src/lib.rs index 56d8e27..bd343a1 100644 --- a/gdke-gui/src-tauri/src/lib.rs +++ b/gdke-gui/src-tauri/src/lib.rs @@ -1,7 +1,22 @@ +use std::{ffi::OsStr, path::Path}; + // Learn more about Tauri commands at https://tauri.app/v1/guides/features/command #[tauri::command] -fn greet(name: &str) -> String { - format!("Hello, {}! You've been greeted from Rust!", name) +fn get_secret(program: &Path, sig: &str) -> Result { + spawn_and_inject_sig(program, sig) + .map_err(|e| e.to_string()) + .map(|val| { + let mut hex_str = "0x".to_string(); + for char in val { + hex_str.push_str(&format!("{char:02X}")) + } + hex_str + }) + // String::new() +} +fn spawn_and_inject_sig>(proc: T, sig: &str) -> anyhow::Result<[u8; 32]> { + Ok([62; 32]) + // Err(()) } #[cfg_attr(mobile, tauri::mobile_entry_point)] @@ -9,7 +24,7 @@ pub fn run() { tauri::Builder::default() .plugin(tauri_plugin_shell::init()) .plugin(tauri_plugin_dialog::init()) - .invoke_handler(tauri::generate_handler![greet]) + .invoke_handler(tauri::generate_handler![get_secret]) .run(tauri::generate_context!()) .expect("error while running tauri application"); } diff --git a/gdke-gui/src-tauri/tauri.conf.json b/gdke-gui/src-tauri/tauri.conf.json index e9a0dcf..1546eed 100644 --- a/gdke-gui/src-tauri/tauri.conf.json +++ b/gdke-gui/src-tauri/tauri.conf.json @@ -1,4 +1,5 @@ { + "$schema": "https://github.com/tauri-apps/tauri/releases/download/tauri-build-v2.0.0-beta.13/schema.json", "productName": "gdke-gui", "version": "0.1.0", "identifier": "one.meli.gdke-gui", @@ -30,5 +31,6 @@ "icons/icon.icns", "icons/icon.ico" ] - } + }, + "plugins": {} } diff --git a/gdke-gui/src/App.css b/gdke-gui/src/App.css index c78c8f0..e57a729 100644 --- a/gdke-gui/src/App.css +++ b/gdke-gui/src/App.css @@ -3,5 +3,5 @@ @tailwind utilities; body { - @apply dark:bg-black dark:text-white + @apply dark:bg-black dark:text-white; } diff --git a/gdke-gui/src/App.tsx b/gdke-gui/src/App.tsx index 7d63968..2082585 100644 --- a/gdke-gui/src/App.tsx +++ b/gdke-gui/src/App.tsx @@ -1,23 +1,145 @@ -import { useState } from "react"; -import reactLogo from "./assets/react.svg"; -import { invoke } from "@tauri-apps/api/core"; +import { useEffect, useState } from "react"; import "./App.css"; -import { Input } from "./components/ui/input"; import { open } from "@tauri-apps/plugin-dialog"; +import { event } from "@tauri-apps/api"; +import { invoke } from "@tauri-apps/api/core"; +import { + Dialog, + DialogContent, + DialogTitle, + DialogDescription, + DialogHeader, +} from "./components/ui/dialog"; +import { Label } from "./components/ui/label"; +import { Input } from "./components/ui/input"; +import { Button } from "./components/ui/button"; function App() { - const [greetMsg, setGreetMsg] = useState(""); - const [name, setName] = useState(""); - function get_file() { - open({ + const [drag_over, set_drag_over] = useState(false); + const [show_pre_run, set_show_pre_run] = useState(false); + const [signature, set_signature] = useState(""); + const [program, set_program] = useState(""); + const [loading, set_loading] = useState(false); + const [outcome, set_outcome] = useState( + null, + ); + async function get_file() { + const outcome = await open({ title: "File picker", filters: [{ name: "Applications", extensions: ["exe"] }], directory: false, }); + if (!outcome) return; + ask_for_sig(outcome.path); } + const run_program = () => { + set_loading(true); + invoke("get_secret", { sig: signature, program }).then( + (out) => { + set_outcome([true, out as string]); + set_loading(false); + }, + (e) => { + set_loading(false); + set_outcome([false]); + }, + ); + }; + const ask_for_sig = async (path: string) => { + set_outcome(null); + set_signature(""); + set_show_pre_run(true); + set_program(path); + }; + useEffect(() => { + const listeners: Promise[] = []; + listeners.push( + event.listen<{ paths: string[] }>(event.TauriEvent.DRAG_DROP, (evt) => { + set_drag_over(false); + console.log(evt); + ask_for_sig(evt.payload.paths[0]); + }), + ); + listeners.push( + event.listen(event.TauriEvent.DRAG_LEAVE, (evt) => { + set_drag_over(false); + console.log(evt); + }), + ); + listeners.push( + event.listen(event.TauriEvent.DRAG_ENTER, (evt) => { + set_drag_over(true); + console.log(evt); + }), + ); + return () => { + (async () => { + for await (const off_fn of listeners) { + off_fn(); + } + })(); + }; + }, []); return ( -

+
+ set_show_pre_run(e)}> + + + Extract Secret Key + {outcome === null && !loading && ( + + After entering a sig we will try our hardest to search for the + key with that signature. + + )} + +
+ {outcome === null || loading ? ( +
+ + set_signature(e.currentTarget.value)} + placeholder="59 48 29 ?? 92 47 ?? .." + /> +
+ ) : loading ? ( +
Loading just give us a sec
+ ) : outcome?.[0] === true ? ( + <> +

+ Successfully got Key! +

{" "} + {" "} + + + ) : ( +
failure
+ )} +
+ {outcome?.[0] && ( + + )} + +
+
+
+

👋 Welcome to Gdke

To get started drop your program below: diff --git a/gdke-gui/src/components/ui/dialog.tsx b/gdke-gui/src/components/ui/dialog.tsx new file mode 100644 index 0000000..306cfc3 --- /dev/null +++ b/gdke-gui/src/components/ui/dialog.tsx @@ -0,0 +1,120 @@ +import * as React from "react" +import * as DialogPrimitive from "@radix-ui/react-dialog" +import { X } from "lucide-react" + +import { cn } from "@/lib/utils" + +const Dialog = DialogPrimitive.Root + +const DialogTrigger = DialogPrimitive.Trigger + +const DialogPortal = DialogPrimitive.Portal + +const DialogClose = DialogPrimitive.Close + +const DialogOverlay = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +DialogOverlay.displayName = DialogPrimitive.Overlay.displayName + +const DialogContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + + + + {children} + + + Close + + + +)) +DialogContent.displayName = DialogPrimitive.Content.displayName + +const DialogHeader = ({ + className, + ...props +}: React.HTMLAttributes) => ( +

+) +DialogHeader.displayName = "DialogHeader" + +const DialogFooter = ({ + className, + ...props +}: React.HTMLAttributes) => ( +
+) +DialogFooter.displayName = "DialogFooter" + +const DialogTitle = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +DialogTitle.displayName = DialogPrimitive.Title.displayName + +const DialogDescription = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +DialogDescription.displayName = DialogPrimitive.Description.displayName + +export { + Dialog, + DialogPortal, + DialogOverlay, + DialogClose, + DialogTrigger, + DialogContent, + DialogHeader, + DialogFooter, + DialogTitle, + DialogDescription, +} diff --git a/gdke-gui/src/components/ui/label.tsx b/gdke-gui/src/components/ui/label.tsx new file mode 100644 index 0000000..683faa7 --- /dev/null +++ b/gdke-gui/src/components/ui/label.tsx @@ -0,0 +1,24 @@ +import * as React from "react" +import * as LabelPrimitive from "@radix-ui/react-label" +import { cva, type VariantProps } from "class-variance-authority" + +import { cn } from "@/lib/utils" + +const labelVariants = cva( + "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" +) + +const Label = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef & + VariantProps +>(({ className, ...props }, ref) => ( + +)) +Label.displayName = LabelPrimitive.Root.displayName + +export { Label } diff --git a/src/lib.rs b/src/lib.rs index 055ceeb..88b3e78 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,6 @@ pub mod versioning; use std::{ - ffi::{c_void, CStr, CString}, + ffi::{c_void, CStr, CString, OsStr}, io::{Read, Write}, mem::{size_of, transmute}, net::UdpSocket, @@ -61,8 +61,8 @@ impl Drop for ProcKiller { } } } -pub unsafe fn spawn_and_inject(proc: &str, sig: &str) -> anyhow::Result<[u8; 32]> { - let pth = Path::new(proc); +pub unsafe fn spawn_and_inject>(proc: T, sig: &str) -> anyhow::Result<[u8; 32]> { + let pth = Path::new(&proc); if !pth.is_file() { panic!("file does not exist"); }