Loara228 / deadlock-esp

external cheat for deadlock / внешний чит для дедлок
MIT License
69 stars 14 forks source link

Can't build #8

Closed yuzurushX closed 1 month ago

yuzurushX commented 1 month ago
D:\Games\deadlock-esp-master>cargo build --release
error: failed to parse manifest at `D:\Games\deadlock-esp-master\Cargo.toml`

Caused by:
  dependency (windows) specified without providing a local path, Git repository, version, or workspace dependency to use

got this when tried to build it

Jebkel commented 1 month ago

[dependencies.windows] windows = "0.58.0"

change to

[dependencies.windows] version = "0.58.0"

yuzurushX commented 1 month ago

[dependencies.windows] windows = "0.58.0"

change to

[dependencies.windows] version = "0.58.0"

Thanks, it solved it, but now I got this error :

   Compiling deadlock v0.1.0 (D:\Games\deadlock-esp-master)
error[E0308]: mismatched types
     --> src\memory\mod.rs:73:48
      |
73    | pub static mut PROCESS_HANDLE: HANDLE = HANDLE(0);
      |                                         ------ ^ expected `*mut c_void`, found `usize`
      |                                         |
      |                                         arguments to this struct are incorrect
      |
      = note: expected raw pointer `*mut c_void`
                        found type `usize`
note: tuple struct defined here
     --> C:\Users\ACER PREDATOR\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-0.58.0\src\Windows\Win32\Foundation\mod.rs:10643:12
      |
10643 | pub struct HANDLE(pub *mut core::ffi::c_void);
      |            ^^^^^^
help: if you meant to create a null pointer, use `std::ptr::null_mut()`
      |
73    | pub static mut PROCESS_HANDLE: HANDLE = HANDLE(std::ptr::null_mut());
      |                                                ~~~~~~~~~~~~~~~~~~~~

error[E0308]: mismatched types
     --> src\drawing\overlay.rs:98:26
      |
98    |         self.hwnd = HWND(hwnd.unwrap().get());
      |                     ---- ^^^^^^^^^^^^^^^^^^^ expected `*mut c_void`, found `isize`
      |                     |
      |                     arguments to this struct are incorrect
      |
      = note: expected raw pointer `*mut c_void`
                        found type `isize`
note: tuple struct defined here
     --> C:\Users\ACER PREDATOR\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-0.58.0\src\Windows\Win32\Foundation\mod.rs:10866:12
      |
10866 | pub struct HWND(pub *mut core::ffi::c_void);
      |            ^^^^

error[E0308]: mismatched types
    --> src\drawing\screen.rs:12:38
     |
12   |             GetMonitorInfoA(HMONITOR(PRIMARY_MONITOR as isize), &mut ipmi);
     |                             -------- ^^^^^^^^^^^^^^^^^^^^^^^^ expected `*mut c_void`, found `isize`
     |                             |
     |                             arguments to this struct are incorrect
     |
     = note: expected raw pointer `*mut c_void`
                       found type `isize`
note: tuple struct defined here
    --> C:\Users\ACER PREDATOR\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-0.58.0\src\Windows\Win32\Graphics\Gdi\mod.rs:8710:12
     |
8710 | pub struct HMONITOR(pub *mut core::ffi::c_void);
     |            ^^^^^^^^

For more information about this error, try `rustc --explain E0308`.
error: could not compile `deadlock` (bin "deadlock") due to 3 previous errors
Loara228 commented 1 month ago

isize as *mut c_void

yuzurushX commented 1 month ago
warning: unused import: `AimSettings`
 --> src\settings\mod.rs:4:30
  |
4 | use structs::{AimProperties, AimSettings, BoxType, EspPlayers, GlobalSettings, RadarSettings, TextSettings};
  |                              ^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `borrow::Borrow`
 --> src\settings\mod.rs:8:15
  |
8 |     use std::{borrow::Borrow, fs::{create_dir, read_dir, remove_file, File}, io::{Read, Write}, path::PathBuf};
  |               ^^^^^^^^^^^^^^

error[E0308]: mismatched types
     --> src\memory\mod.rs:73:48
      |
73    | pub static mut PROCESS_HANDLE: HANDLE = HANDLE(0);
      |                                         ------ ^ expected `*mut c_void`, found `usize`
      |                                         |
      |                                         arguments to this struct are incorrect
      |
      = note: expected raw pointer `*mut c_void`
                        found type `usize`
note: tuple struct defined here
     --> C:\Users\ACER PREDATOR\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-0.58.0\src\Windows\Win32\Foundation\mod.rs:10643:12
      |
10643 | pub struct HANDLE(pub *mut core::ffi::c_void);
      |            ^^^^^^
help: if you meant to create a null pointer, use `std::ptr::null_mut()`
      |
73    | pub static mut PROCESS_HANDLE: HANDLE = HANDLE(std::ptr::null_mut());
      |                                                ~~~~~~~~~~~~~~~~~~~~

error[E0308]: mismatched types
  --> src\drawing\overlay.rs:88:13
   |
88 |             FindWindowExA(HWND::default(), HWND::default(), class, window)
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `HWND`, found `Result<HWND, Error>`
   |
   = note: expected struct `HWND`
                found enum `Result<HWND, windows_result::error::Error>`
help: consider using `Result::expect` to unwrap the `Result<HWND, windows_result::error::Error>` value, panicking if the value is a `Result::Err`
   |
88 |             FindWindowExA(HWND::default(), HWND::default(), class, window).expect("REASON")
   |                                                                           +++++++++++++++++

error[E0308]: mismatched types
  --> src\drawing\overlay.rs:90:27
   |
90 |         if self.hwnd.0 == 0
   |            -----------    ^ expected `*mut c_void`, found `usize`
   |            |
   |            expected because this is `*mut c_void`
   |
   = note: expected raw pointer `*mut c_void`
                     found type `usize`
help: if you meant to create a null pointer, use `std::ptr::null_mut()`
   |
90 |         if self.hwnd.0 == std::ptr::null_mut()
   |                           ~~~~~~~~~~~~~~~~~~~~

error[E0308]: mismatched types
     --> src\drawing\screen.rs:11:34
      |
11    |             let hdc = GetDC(HWND(0isize));
      |                             ---- ^^^^^^ expected `*mut c_void`, found `isize`
      |                             |
      |                             arguments to this struct are incorrect
      |
      = note: expected raw pointer `*mut c_void`
                        found type `isize`
note: tuple struct defined here
     --> C:\Users\ACER PREDATOR\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-0.58.0\src\Windows\Win32\Foundation\mod.rs:10866:12
      |
10866 | pub struct HWND(pub *mut core::ffi::c_void);
      |            ^^^^
help: if you meant to create a null pointer, use `std::ptr::null_mut()`
      |
11    |             let hdc = GetDC(HWND(std::ptr::null_mut()));
      |                                  ~~~~~~~~~~~~~~~~~~~~

warning: unused variable: `frame`
  --> src\drawing\overlay.rs:22:47
   |
22 |     fn update(&mut self, ctx: &egui::Context, frame: &mut eframe::Frame)
   |                                               ^^^^^ help: if this is intentional, prefix it with an underscore: `_frame`
   |
   = note: `#[warn(unused_variables)]` on by default

warning: unused variable: `ui`
  --> src\drawing\windows.rs:39:51
   |
39 | fn draw_aim(overlay: &mut Overlay, ctx: &Context, ui: &mut Ui) {
   |                                                   ^^ help: if this is intentional, prefix it with an underscore: `_ui`

warning: unused variable: `id`
   --> src\drawing\windows.rs:291:67
    |
291 |     pub fn aim_element(ui: &mut Ui, settings: &mut AimProperties, id: &str)
    |                                                                   ^^ help: if this is intentional, prefix it with an underscore: `_id`

For more information about this error, try `rustc --explain E0308`.
warning: `deadlock` (bin "deadlock") generated 5 warnings
error: could not compile `deadlock` (bin "deadlock") due to 4 previous errors; 5 warnings emitted

Tried to build newest update and got this @Loara228

yuzurushX commented 1 month ago

Changing Windows dependencies from 0.58.0 to 0.57.0 made it successfully built, but when executing the deadlock.exe I got this :

D:\Games\New folder (2)\deadlock-esp-master\target\release>deadlock.exe
[2024-09-23T21:18:14Z INFO  deadlock] Running...
[2024-09-23T21:18:14Z INFO  deadlock::memory] Process found: HANDLE(1040)
[2024-09-23T21:18:14Z INFO  deadlock::memory] Client: MODULEINFO { lpBaseOfDll: 0x7ffb2aa70000, SizeOfImage: 37261312, EntryPoint: 0x7ffb2be9de80 }
[2024-09-23T21:18:14Z INFO  deadlock::memory] Initialized
[2024-09-23T21:18:14Z INFO  deadlock::drawing::screen] SM_CMONITORS: 1
[2024-09-23T21:18:14Z INFO  deadlock::drawing::screen] Primary: ([0.0 0.0], [1919.0 1199.0])
[2024-09-23T21:18:14Z INFO  deadlock::drawing::overlay] Running native window...
https://github.com/loara228/deadlock-esp
[2024-09-23T21:18:14Z ERROR deadlock::drawing::overlay] Overlay HWND is invalid
thread 'main' panicked at src\drawing\overlay.rs:93:13:
Window handle is invalid
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Jebkel commented 1 month ago

@yuzurushX in last commit this bug fixed