Skip to content

Commit

Permalink
There's now a gif in the readme instead of a static image (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
Creative0708 authored Apr 16, 2024
2 parents ab0d48f + ac565c1 commit d973401
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 10 deletions.
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"

0 comments on commit d973401

Please sign in to comment.