Skip to content

Commit d973401

Browse files
authored
There's now a gif in the readme instead of a static image (#37)
![cassete](https://github.com/Speykious/cve-rs/assets/100917739/ffec1e20-f106-45c2-a822-d1581ecc6b88)
2 parents ab0d48f + ac565c1 commit d973401

File tree

7 files changed

+33
-10
lines changed

7 files changed

+33
-10
lines changed

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,6 @@ step-on-lego = ["oorandom"]
2929
[[bench]]
3030
name = "transmute"
3131
harness = false
32+
33+
[[example]]
34+
name = "segfault"

README.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,7 @@
2424
- **🦀 Built in 100% memory-safe Rust**
2525

2626
## Example
27-
```rs
28-
// With cve-rs, you can crash prod in a 🔥 blazingly fast manner!
29-
pub fn segfault() {
30-
let null: &mut u8 = cve_rs::null_mut::<u8>();
31-
*null = 42;
32-
}
33-
```
34-
35-
![Segfault demo](/assets/segfault-demo.png)
27+
![Segfault demo](/vhs/cassete.gif)
3628

3729
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.
3830

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

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

100-
...and godspeed.
92+
...and godspeed.

examples/segfault.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// With cve-rs, you can crash prod in a 🔥 blazingly fast manner!
2+
fn main() {
3+
let null: &mut u8 = cve_rs::null_mut::<u8>();
4+
*null = 42;
5+
}

src/transmute.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ pub fn transmute<A, B>(obj: A) -> B {
3333
// Note that `data` is shared between `DummyEnum::A` and `DummyEnum::B`.
3434
// This should hopefully be more reliable than spamming the stack with a value and hoping the memory
3535
// is placed correctly by the compiler.
36+
#[allow(dead_code)]
3637
enum DummyEnum<A, B> {
3738
A(Option<Box<A>>),
3839
B(Option<Box<B>>),

vhs/cassete.gif

243 KB
Loading

vhs/cassete.tape

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Set Theme "Catppuccin Mocha"
2+
Set FontFamily "JetBrainsMono Nerd Font"
3+
Set Margin 20
4+
Set MarginFill "#B4BEFE"
5+
Set BorderRadius 10
6+
Set Shell bash
7+
Set TypingSpeed 0
8+
Hide
9+
Type "source vhs/config.bash"
10+
Enter
11+
Show
12+
Set TypingSpeed 0.1
13+
Type "bat examples/segfault.rs"
14+
Enter
15+
Sleep 5s
16+
Type "cargo run --example segfault"
17+
Sleep 5s
18+
Enter
19+
Sleep 3s

vhs/config.bash

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
clear
2+
echo "Blazingly 🔥 fast 🚀 memory vulnerabilities, written in 100% safe Rust. 🦀"
3+
export LANGUAGE="en"

0 commit comments

Comments
 (0)