cregister - read as 'see register' - is a C library that exposes functions to read values from x86 GPRs (General Purpose Registers) at run time (the pun is absolutely intended xD) with safe bindings for Rust.
cregister/
|- c/
|- lib/ #
|- cregister.h # main header file, whould be included if you want to use it.
|- obj/ # Where the transitive dependencies are placed.
|- src/ # Where the implementation lives.
|- Makefile # The build file.
|- libcregister.a # The eventualy generated archive file.
|- rust/
|- src/
|- bindings.rs # The file generated by the bindgen build script
|- lib.rs # Where the safe interfaces are exported
|- target/
|- Cargo.lock
|- Cargo.toml
|- build.rs # The build script with the bindgen implementation
|- README.md # This file xD.The lib currently supports reading values from the following registers:
The build system used is GNU's Makefile for the C part and the
bindgen lib
for the rust part.
Just run make lib under the c subfolder and it'll generate an archive file
that you can then link your executable to!
If you want the Rust bindings, use link lib paired with link search on your build.rs, include the lib locally with path dependencies and youre good to go!
The current available rules are:
- help Prints help for targets with comments
- lib Creates the archive file (the .a)
- test Create the test executable
- clean Deletes the transitive dependencies (the .o files and any test binaries)
- fclean Deletes the transitive dependencies and the archive file (.o and .a)
This project is licensed under the MIT License. See LICENSE for details.