Skip to content

Instantly share code, notes, and snippets.

package main
import (
"bytes"
"go/ast"
"go/format"
"go/parser"
"go/token"
"io/ioutil"
"strings"
@ccbrown
ccbrown / class.stream.php
Created April 19, 2016 01:49 — forked from jas-/class.stream.php
PHP stream handler w/ support for multiple files over PUT
<?php
/**
* stream - Handle raw input stream
*
* LICENSE: This source file is subject to version 3.01 of the GPL license
* that is available through the world-wide-web at the following URI:
* http://www.gnu.org/licenses/gpl.html. If you did not receive a copy of
* the GPL License and are unable to obtain it through the web, please
*
@ccbrown
ccbrown / extract_palindromes.cpp
Last active February 13, 2016 05:39
extract_palindromes.cpp
#include <gsl.h>
#include <omp.h>
#include <thread>
#include <vector>
#include <sys/stat.h>
using namespace std::literals;
@ccbrown
ccbrown / rop-osx.cpp
Last active September 20, 2015 23:19
An example ROP payload for OSX.
#include <cstdint>
#include <cstdio>
#include <cstring>
#include <string>
// the address that /usr/lib/system/libdyld.dylib is loaded to
// this is randomized on bootup and can be read from lldb via `image list`
// you can set it here or you can pass it as an argument
uint64_t gDyldDylibAddress = 0;
@ccbrown
ccbrown / DumpHex.c
Last active March 27, 2024 17:32
Compact C Hex Dump Function w/ASCII
#include <stdio.h>
void DumpHex(const void* data, size_t size) {
char ascii[17];
size_t i, j;
ascii[16] = '\0';
for (i = 0; i < size; ++i) {
printf("%02X ", ((unsigned char*)data)[i]);
if (((unsigned char*)data)[i] >= ' ' && ((unsigned char*)data)[i] <= '~') {
ascii[i % 16] = ((unsigned char*)data)[i];