GithubHelp home page GithubHelp logo

ellacrity / windows-native Goto Github PK

View Code? Open in Web Editor NEW

This project forked from niiightmarexd/windows-native

0.0 0.0 0.0 1.64 MB

Rust bindings for the Windows Native API

License: MIT License

Rust 100.00%

windows-native's Introduction

Windows Native โ€ƒ Crates.io GitHub Workflow Status (with event) Crates.io

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.

Features

  • Access undocumented Windows APIs through Rust.
  • Headers sourced mainly from Process Hacker's NT headers.
  • Provides a safer interface compared to raw FFI.
  • Detailed documentation and examples for each API.
  • Easy-to-use functions and types for common Windows tasks.

Installation

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.

Usage

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);

Documentation

Detailed documentation for each API and type can be found here.

Contributing

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.

License

This project is licensed under the MIT License.

Disclaimer

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.

windows-native's People

Contributors

niiightmarexd avatar kgv avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.