Crates.io | windows-native |
lib.rs | windows-native |
version | 1.0.40 |
source | src |
created_at | 2023-08-22 17:44:42.415401 |
updated_at | 2023-08-25 17:42:14.115049 |
description | Windows Native Undocumented API for Rust Language 🔥 |
homepage | |
repository | https://github.com/NiiightmareXD/windows-native |
max_upload_size | |
id | 951214 |
size | 1,553,165 |
The Windows-Native Rust library provides a convenient and safe way to access the native Windows undocumented APIs using the Rust programming language. These APIs are mostly exported from the Process Hacker native API headers (phnt), enabling you to interact with Windows internals in a reliable and efficient manner.
Please note that using undocumented APIs can be risky, as they might change without notice in different Windows versions and can potentially cause system instability. Use this library with caution and ensure you have a good understanding of the implications of using undocumented APIs.
Add this library to your Cargo.toml
:
[dependencies]
windows-native = "1.0.40"
or run this command
cargo add windows-native
this crate works with windows-rs so you have to install that too.
use std::{thread, time::Duration};
use windows_native::ntpsapi::{NtResumeProcess, NtSuspendProcess};
use windows::Win32::System::Threading::{OpenProcess, PROCESS_ALL_ACCESS};
let handle = unsafe { OpenProcess(PROCESS_ALL_ACCESS, false, 69420).unwrap() };
let result = unsafe { NtSuspendProcess(handle) };
println!("Result {:?}", result);
thread::sleep(Duration::from_secs(3));
let result = unsafe { NtResumeProcess(handle) };
println!("Result {:?}", result);
Detailed documentation for each API and type can be found here.
Contributions are welcome! If you find a bug or want to add new features to the library, please open an issue or submit a pull request.
This project is licensed under the MIT License.
Windows-Native is provided as-is and does not guarantee compatibility with future Windows versions. Using undocumented APIs can have unintended consequences, including system instability and security vulnerabilities. Use at your own risk.