Skip to content

Instantly share code, notes, and snippets.

@allanlw
allanlw / Dockerfile
Created November 21, 2014 21:04
BAP 0.8 Dockerfile for ubuntu 12.04
FROM ubuntu:12.04
RUN apt-get update && apt-get -y --no-install-recommends install \
automake \
binutils-dev \
bison \
build-essential \
ca-certificates \
camlidl \
camlp4-extra \
@allanlw
allanlw / rc4.cpp
Created December 14, 2014 05:59
RC4 PRNG unrolled with C++ templates
#include <cstdint>
#include <cstddef>
#include <cstdio>
#include <cstring>
struct RC4State {
uint8_t i, j;
uint8_t S[256];
RC4State(uint8_t *key, size_t key_len) : i(0), j(0) {
@allanlw
allanlw / triage.sh
Created January 22, 2015 19:06
Triage
#!/bin/bash
# Force libc to output fatal errors to stderr instead of
# writing to the terminal directly
export LIBC_FATAL_STDERR_=1
# Should be set as the path to the exploitable binary
EXPLOITABLE=~/exploitable/exploitable/exploitable/exploitable.py
# Ghetto script so -d has to be first
@allanlw
allanlw / aos.sh
Created February 22, 2015 17:20
build and run an android aos automagically on Ubuntu 14.04
#!/bin/bash
# Configurable options
REPO_TAG=android-4.4.3_r1.1
LUNCH_TARGET=aosp_arm-eng
CCACHE_SIZE=10G
WORKDIR=aos_workdir
# Below this is just all the script crap
set -e # abort after first error
@allanlw
allanlw / cut_gimp.py
Created June 4, 2016 14:11
Gimp Magicwand cut script
# This file contains a function for cutting a subject out of an image.
# Right now it just uses the top left corner, and gimp's magic wand. Could do something.
import gimpfu
import os
# if debug==True, we place on a green background
def convert(filename, new_name, debug=False):
img = pdb.gimp_file_load(filename, filename)
layer = pdb.gimp_image_merge_visible_layers(img, 1)
@allanlw
allanlw / blender_obj_to_blend_flipped_v.py
Created September 11, 2016 00:28
A blender script to flip import an obj with borked UVs!
# invoke like blender --background --python belnder_obj_to_blend_flipped_v.py -- input.obj output.blend
import bpy
import sys
argv = sys.argv
argv = argv[argv.index("--") + 1:] # get all args after "--"
obj_out = argv[0]
@allanlw
allanlw / Dockerfile
Created January 6, 2017 15:34
Secretgrind Dockerfile
FROM ubuntu:14.04
# Ubuntu 14.04 is used instead of 16.04, because 16.04 has too new a version of GCC
# and valgrind configure complains
# automake is needed for aclocal to build the valgrind code
# wget and git for fetching source
# python is required for building capstone
RUN apt-get update && apt-get -y install \
build-essential \
@allanlw
allanlw / index.html
Created January 21, 2017 01:10
Human Sort
<!DOCTYPE html>
<!--
This is a simple script to manually heap sort images.
It loads images from a relative file filelist.txt, which is a list of image (really page) URIs
separate by new lines.
It will prompt the user for comparisons. Press the A key for left image or F key for the right image.
When it's done it logs to console.log.
@allanlw
allanlw / solver.py
Created February 27, 2017 02:13
combined.space solution
#!/usr/bin/python
import urllib2
import string
import random
import urllib
import cgi
l = list(string.ascii_letters)
random.shuffle(l)
@allanlw
allanlw / http2.py
Last active December 30, 2023 22:08
Generate an HTTP2 Request for piping to netcat
#!/usr/bin/env python
from __future__ import print_function
import struct
HTTP2_HDR="PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"
# Does the thing for a frame
def frame(ty, flags, streamid, payload):
return struct.pack(">L", len(payload))[1:4] + struct.pack(">BBL", ty, flags, streamid) + payload