Whitecat18 / Rust-for-Malware-Development

This repository contains my complete resources and coding practices for malware development using Rust 🦀.
1.23k stars 147 forks source link

Facing this issue when trying to compile injector from dll_injection #4

Closed And329 closed 4 months ago

And329 commented 4 months ago

Here's compiler issue error[E0433]: failed to resolve: use of undeclared crate or modulewindows --> src/main.rs:21:5 | 21 | use windows::Win32::System::Threading::INFINITE; | ^^^^^^^ use of undeclared crate or modulewindows`

For more information about this error, try rustc --explain E0433. error: could not compile injector (bin "injector") due to 1 previous error`

Here's my Cargo.toml `[package] name = "injector" version = "0.1.0" edition = "2021"

[dependencies] winapi = { version = "0.3.9", features = ["winuser","setupapi","winnls","fileapi","sysinfoapi" ,"debugapi","winerror", "wininet" , "winhttp" ,"synchapi","securitybaseapi","wincrypt","psapi", "tlhelp32", "heapapi","shellapi", "memoryapi", "processthreadsapi", "errhandlingapi", "winbase", "handleapi", "synchapi"] }

ntapi = "0.4.1" user32-sys = "0.2.0"`

Whitecat18 commented 4 months ago

I Imported the windows-rs function insted of winapi. i have fixed it . it may work now .

Code : https://github.com/Whitecat18/Rust-for-Malware-Development/blob/main/dll_injection/injector.rs