Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / 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 / 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 / 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 \