Skip to content

Instantly share code, notes, and snippets.

View vext01's full-sized avatar
🏠
Working from home

Edd Barrett vext01

🏠
Working from home
View GitHub Profile
mov eax, 1
@vext01
vext01 / mapx64.s
Created June 30, 2011 10:22
Register Map Test for x64
.intel_syntax
.text
.globl main
.type main, @function
main:
xor %ah, %ah
xor %al, %al
xor %bh, %bh
xor %bl, %bl
@vext01
vext01 / linux_radare_syscalls.py
Created July 7, 2011 13:30
Radare Linux System Call Table Helper Script
#!/usr/bin/env python
"""
Use this script to generate radare2 system call maps
from the systrace static arrays. Run this is the linux/
subdir of the systrace sources and a linux.c will
be generated.
Note, if the maps comes out empty for an arch, open the
relevent syscallent.h and you will probably find that another
arches syscallnt.h is included. In such a case, copy the def
@vext01
vext01 / radare-linux.c
Created July 7, 2011 14:06
Sample output from Radare Linux Syscall Helper
#include "r_syscall.h"
RSyscallItem syscalls_linux_alpha[] = {
{"osf_syscall", 0x80, 0, 6},
{"exit", 0x80, 1, 1},
{"fork", 0x80, 2, 0},
{"read", 0x80, 3, 3},
{"write", 0x80, 4, 3},
{"osf_old_open", 0x80, 5, 5},
{"close", 0x80, 6, 1},
@vext01
vext01 / 2hex.c
Created July 9, 2011 15:34
Dump a file to a C hex array
#include <stdio.h>
int
main(void)
{
FILE *f, *out;
uint8_t buf;
unsigned long i = 0;
if ((f = fopen("silence.ogg", "r")) == NULL)
@vext01
vext01 / syscallargs.py
Created July 12, 2011 16:14
Hacky way to get syscall args from an openbsd syscallargs.h
#!/usr/bin/env python2.7
import re;
def r2_type(typ, name):
typ = typ.replace(" ", "");
# anything which is size dependent upon arch is a 'p'
if typ.endswith("char*"):
return "z"
@vext01
vext01 / gist:1177194
Created August 28, 2011 20:40
double free in hfd
edd-i386% `pwd`/hgd-playd -Bx2
[info - 00001418 cfg.c:hgd_load_config():32]
Trying to read config from - /home/edd/.config/hgd/hgd.rc
hgd-playd in free(): error: bogus pointer (double free?) 0x511f9c
zsh: abort (core dumped) `pwd`/hgd-playd -Bx2
edd-i386% gdb /home/edd/source/hgd/hgd-playd
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
@vext01
vext01 / magic.py
Created October 10, 2011 01:03
Parse /etc/magic in Python
#!/usr/bin/env python2.7
import sys
class node:
def __init__(self, level, descr):
self.children = []
self.level = level
self.mime = None
self.parent = None
edd-i386% hgdc np
[ #0001 queued by 'edd' ]
Filename: '01 Red Sky Intro_128.mp3'
Artist: <unknown>
Title: <unknown>
Album: <unknown>
Genre: 'Blues'
Year: <unknown>
Audio: 974s 44100hz 128kbps 2 channels
Votes needed to skip: 3
@vext01
vext01 / gist:1431210
Created December 4, 2011 20:38
freemat-4.1 build error
[ 32%] Building CXX object libs/libGraphics/CMakeFiles/Graphics.dir/GLRenderEngine.cpp.o
cd /usr/ports/pobj/freemat-4.1/build-i386/libs/libGraphics && /usr/bin/c++ -DFREEMAT_VERSION=\"4.1\" -DRESOURCEDIR=\"/usr/local/share/FreeMat
-4.1\" -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DHAVE_PCRE -DHAVE_FFTW -DHAVE_FFTWF -DHAVE_ZLIB -DHAVE_UMFPACK -DHAVE_AMD -DHAVE_PORTAUD
IO19 -DHAVE_BOOST -DHAVE_LLVM -DDYN_BLAS -O2 -pipe -I/usr/local/include -I/usr/ports/pobj/freemat-4.1/FreeMat-4.1-Source/libs/thirdparty/UMFP
ACK/Include -I/usr/ports/pobj/freemat-4.1/FreeMat-4.1-Source/libs/thirdparty/UFconfig -I/usr/ports/pobj/freemat-4.1/FreeMat-4.1-Source/libs/thi
rdparty/AMD/Include -I/usr/ports/pobj/freemat-4.1/FreeMat-4.1-Source/libs/thirdparty/UFConfig -I/usr/ports/pobj/freemat-4.1/FreeMat-4.1-Source/
libs/libFreeMat -I/usr/ports/pobj/freemat-4.1/FreeMat-4.1-Source/libs/libGraphics -I/usr/ports/pobj/freemat-4.1/FreeMat-4.1-Source/libs/libMex
-I/usr/ports/pobj/freemat-4.1/FreeMat-4.1-Source/libs/libXP -I/usr/port