Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There's now a gif in the readme instead of a static image #37

Merged
merged 3 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ step-on-lego = ["oorandom"]
[[bench]]
name = "transmute"
harness = false

[[example]]
name = "segfault"
12 changes: 2 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,7 @@
- **🦀 Built in 100% memory-safe Rust**

## Example
```rs
// With cve-rs, you can crash prod in a 🔥 blazingly fast manner!
pub fn segfault() {
let null: &mut u8 = cve_rs::null_mut::<u8>();
*null = 42;
}
```

![Segfault demo](/assets/segfault-demo.png)
![Segfault demo](/vhs/cassete.gif)

Rust is an amazing language. You can program a lot of useful things while ensuring that your program will stay safe. Unfortunately, safe Rust is quite limiting. For example, you cannot introduce code that could corrupt the program's memory. Now, with **cve-rs**, you can corrupt your program's memory without corrupting your program's memory.

Expand Down Expand Up @@ -97,4 +89,4 @@ This project is licensed under the [GLWTSPL](/LICENSE).

![Good Luck](https://github.com/me-shaon/GLWTPL/raw/master/good-luck.gif)

...and godspeed.
...and godspeed.
5 changes: 5 additions & 0 deletions examples/segfault.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// With cve-rs, you can crash prod in a 🔥 blazingly fast manner!
fn main() {
let null: &mut u8 = cve_rs::null_mut::<u8>();
*null = 42;
}
1 change: 1 addition & 0 deletions src/transmute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ pub fn transmute<A, B>(obj: A) -> B {
// Note that `data` is shared between `DummyEnum::A` and `DummyEnum::B`.
// This should hopefully be more reliable than spamming the stack with a value and hoping the memory
// is placed correctly by the compiler.
#[allow(dead_code)]
enum DummyEnum<A, B> {
A(Option<Box<A>>),
B(Option<Box<B>>),
Expand Down
Binary file added vhs/cassete.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions vhs/cassete.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Set Theme "Catppuccin Mocha"
Set FontFamily "JetBrainsMono Nerd Font"
Set Margin 20
Set MarginFill "#B4BEFE"
Set BorderRadius 10
Set Shell bash
Set TypingSpeed 0
Hide
Type "source vhs/config.bash"
Enter
Show
Set TypingSpeed 0.1
Type "bat examples/segfault.rs"
Enter
Sleep 5s
Type "cargo run --example segfault"
Sleep 5s
Enter
Sleep 3s
3 changes: 3 additions & 0 deletions vhs/config.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
clear
echo "Blazingly 🔥 fast 🚀 memory vulnerabilities, written in 100% safe Rust. 🦀"
export LANGUAGE="en"