Crates.io | pointerguard |
lib.rs | pointerguard |
version | 0.1.1 |
source | src |
created_at | 2025-04-13 16:14:49.567255+00 |
updated_at | 2025-04-13 16:16:31.844018+00 |
description | Pointer encryption library in rust. |
homepage | https://github.com/item-self/pointerguard |
repository | https://github.com/item-self/pointerguard |
max_upload_size | |
id | 1631944 |
size | 133,569 |
Pointer encryption library in rust.
/// Example player struct.
struct Player {
health: u32,
}
// turn box into encrypted pointer.
let player: EncryptedPtr<_> = Box::new(Player { health: 100 }).into();
assert_eq!(player.health, 100);
You can replace Box<T>
with EncryptedPtr<T>
, for example, to encrypt the reference to T.
EncryptedPtr
instantiation, making it harder to reverse engineer.EncryptedPtr
goes out of scope.
As you can see in this image, we can pointer scan (manually or automatically) to find the 'link' to the player's health:
World -> people -> Person
.
To fix this just change Box<Person>
to EncryptedPtr<Person>
.
Now, just like that, the chain is "broken".