Skip to content

Instantly share code, notes, and snippets.

View mvanotti's full-sized avatar
🐦
Nobody knows anything about horses

Marco Vanotti mvanotti

🐦
Nobody knows anything about horses
View GitHub Profile
#!/bin/sh
#
# Example script for configuring and compiling Bochs on Linux for Windows.
#
CC="x86_64-w64-mingw32-gcc"
CXX="x86_64-w64-mingw32-g++"
CFLAGS="-O3 -Wall -Wno-format -mno-ms-bitfields"
CXXFLAGS="$CFLAGS"
WINDRES="x86_64-w64-mingw32-windres"
@mvanotti
mvanotti / minimizer.rs
Created June 3, 2021 06:05
Quick and Dirty crash minimizer
// Quick and Dirty Crash Minimizer.
// Usage: minimize input output -- program_invocation program_flags FILE
// The program has to crash with either SIGSEGV or SIGABRT.
use log::{debug, info};
use nix::sys::ptrace;
use nix::sys::signal::Signal;
use nix::sys::wait::{waitpid, WaitStatus};
use nix::unistd::Pid;
use rand::prelude::SliceRandom;
use std::collections::HashSet;
@mvanotti
mvanotti / checker.sh
Created November 13, 2022 21:02
Solver for SECCON Quals 2022, txtchecker misc challenge
#!/bin/bash
read -p "Input a file path: " filepath
file $filepath 2>/dev/null | grep -q "ASCII text" 2>/dev/null
# TODO: print the result the above command.
# $? == 0 -> It's a text file.
# $? != 0 -> It's not a text file.
exit 0
#include <assert.h>
#include <limits.h>
#include <signal.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
uint64_t g_addr;
@mvanotti
mvanotti / wxjail.c
Last active January 27, 2025 21:20
Check for Write | Exec permissions in mmap (x86_64)
#include <err.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/mman.h>
#include <unistd.h>
#include "seccomp-bpf.h"