Rust fixme 3

Published: April 2, 2025Updated: December 9, 2025

Description

The final Rust warm-up simply asks you to call an unsafe helper correctly by wrapping the FFI-style function in an `unsafe` block so the compiler agrees to execute it.

Extract the archive, enter the project directory, and run `cargo run` to see the compiler warning about unsafe code.

Open `src/main.rs` to inspect the commented hints around the unsafe block.

tar -xvf fixme3.tar.gz && cd fixme3
cargo run

Solution

  1. Step 1Wrap the unsafe call
    Uncomment the `unsafe { ... }` block (lines 22 and 34) so the compiler allows the call into the unsafe helper. No other code changes are needed.
  2. Step 2Rebuild and run
    Re-run `cargo run` and the binary now prints the picoCTF flag immediately.

Flag

picoCTF{n0w_y0uv3_f1x3d_1h3m_...}

Rust requires explicit `unsafe` blocks around code that might violate safety guarantees, even when the code was provided by the challenge.