Skip to content

Instantly share code, notes, and snippets.

View rofl0r's full-sized avatar

rofl0r

View GitHub Profile
@rofl0r
rofl0r / c99.l
Created January 1, 2018 00:18 — forked from codebrainz/c99.l
C99 Lex/Flex & YACC/Bison Grammars
D [0-9]
L [a-zA-Z_]
H [a-fA-F0-9]
E ([Ee][+-]?{D}+)
P ([Pp][+-]?{D}+)
FS (f|F|l|L)
IS ((u|U)|(u|U)?(l|L|ll|LL)|(l|L|ll|LL)(u|U))
%{
#include <stdio.h>
@rofl0r
rofl0r / af_packet_rx_ring.c
Created October 19, 2017 10:15 — forked from pavel-odintsov/af_packet_rx_ring.c
af_packet_rx_ring_habrahabr.c
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <unistd.h>
#include <boost/thread.hpp>
#include <sys/mman.h>
#include <poll.h>
#include <arpa/inet.h>
@rofl0r
rofl0r / seccomp_x32_bypass.c
Created July 9, 2017 12:19 — forked from thejh/seccomp_x32_bypass.c
PoC for bypassing sloppy seccomp blacklists on X86-64 using X32 syscalls
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <signal.h>
#include <errno.h>
#include <fcntl.h>
#include <stddef.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <sys/stat.h>
@rofl0r
rofl0r / python3_fixes_with_bs4_support.patch
Created June 8, 2017 20:43 — forked from kevinhendricks/python3_fixes_with_bs4_support.patch
google/gumbo-parser patch to allow gumboc.py to work with both python 2 and 3 and add BeautifulSoup4 support for both
diff --git a/python/gumbo/bs4_adapter.py b/python/gumbo/bs4_adapter.py
new file mode 100644
index 0000000..5a8d273
--- /dev/null
+++ b/python/gumbo/bs4_adapter.py
@@ -0,0 +1,183 @@
+# -*- coding: utf-8 -*-
+# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
+
+from __future__ import unicode_literals, print_function
@rofl0r
rofl0r / defconquals2017_sorcerery_solve.py
Created May 3, 2017 14:03 — forked from disconnect3d/defconquals2017_sorcerery_solve.py
Solution for sorcerery crackme2000 task from DefCon Quals CTF
"""
Solution from Disconnect3d [playing in Just Hit the Core]
"""
import os
import angr
import pwn
import subprocess
From 44eac78981c07cf2f73a338d3e34eed685f6309d Mon Sep 17 00:00:00 2001
From: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Date: Mon, 25 Jul 2016 17:42:19 +0300
Subject: [PATCH] OpenRISC support for GCC 5.3.0
This is the difference between dfad8a2635433704c74c70db28c3559867c2e362
from https://github.com/openrisc/or1k-gcc.git and vanilla GCC 5.3.0
---
ChangeLog.or1k | 8 +
config/picflag.m4 | 3 +
@rofl0r
rofl0r / Makefile
Created August 13, 2014 21:31 — forked from o11c/Makefile
.DEFAULT_GOAL := all
.PHONY: ${MAKECMDGOALS}
$(filter-out all,${MAKECMDGOALS}) all: .forward-all ;
.forward-all:
${MAKE} -C build ${MAKECMDGOALS}
${MAKEFILE_LIST}: ;
.SUFFIXES:
@rofl0r
rofl0r / mlxc.sh
Created November 13, 2013 10:30 — forked from noqqe/mlxc.sh
#!/bin/bash
### Binaries
SCREEN=$(which screen)
LXCSTART=$(which lxc-start)
LXCSTOP=$(which lxc-stop)
### Configuration to get lxc directory
LXCCONF="/etc/default/lxc"
ERR=0
/* Copyright (C) 2013, Felix Janda <felix.janda@posteo.de>
Permission to use, copy, modify, and/or distribute this software for
any purpose with or without fee is hereby granted, provided that the
above copyright notice and this permission notice appear in all copies.
SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
@rofl0r
rofl0r / gist:1073739
Created July 9, 2011 16:53 — forked from angavrilov/gist:926972
mmap injection on linux (emulation of VirtualAllocEx)
/* Support for executing system calls in the context of the game process. */
static const int injection_size = 4;
static const char nop_code_bytes[injection_size] = {
/* This is the byte pattern used to pad function
addresses to multiples of 16 bytes. It consists
of RET and a sequence of NOPs. The NOPs are not
supposed to be used, so they can be overwritten. */
0xC3, 0x90, 0x90, 0x90