Skip to content

Instantly share code, notes, and snippets.

View DavidBuchanan314's full-sized avatar
🌍
Hack the planet!

David Buchanan DavidBuchanan314

🌍
Hack the planet!
View GitHub Profile
@zachriggle
zachriggle / win.py
Created September 1, 2017 20:35
Example Exploit for ROP Emporium's ret2win Challenge Raw
from pwn import *
# Set up pwntools to work with this binary
elf = context.binary = ELF('ret2win')
# Enable verbose logging so we can see exactly what is being sent.
context.log_level = 'debug'
# Print out the target address
info("%#x target", elf.symbols.ret2win)
@pakt
pakt / rdwr.py
Created August 15, 2015 10:59
Direct read/write access to Python's memory
#
# read/write access to python's memory, using a custom bytearray.
# some code taken from: http://tinyurl.com/q7duzxj
#
# tested on:
# Python 2.7.10, ubuntu 32bit
# Python 2.7.8, win32
#
# example of correct output:
# inspecting int=0x41424344, at 0x0228f898
@jsimmons
jsimmons / link_map.c
Last active February 26, 2023 08:22
Linking The Hard Way

Sometimes you need a 2048-bit RSA keypair for testing various things.

If you, like myself, have a child's sense of humor, I offer the following for your general use:

P = 19
Q = 1696986749729493925354392349339746171297507422986462747526968361144447230710192316397327889522451749459854070558277878297255552508603806832852079596337539247651161831569525505882103311631577368514276343192042634740927726070847704397913856975832811679847928433261678072951551065705680482548543833651752439700272736498378724153330763357721354498194000536297732323628263256733931353143625854828275237159155585342783077681713929284136658773985266864804093157854331138230313706015557050002740810464618031715670281442110238274404626065924786185264268216336867948322976979393032640085259926883014490947373494538254895109731

N = 0xFF69696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696
// Unscaled values for kOpsinAbsorbanceBias
const kB0 = 0.96723368009523958;
const kB1 = kB0;
const kB2 = kB0;
const kScale = 255.0;
const kScaleR = 1.0;
const kScaleG = 1.0;
const kInvScaleR = 1.0;
const kInvScaleG = 1.0;
@DavidBuchanan314
DavidBuchanan314 / life.c
Last active August 9, 2023 23:12
Yet another reformatting of my tiny game of life implementation. Valid ANSI C with no (default) compiler warnings or UB
#define F\
for(i=l;i\
<l*4; i++)
main(){int
i,j,w=512,
n,l=w*w,o[
]={~w,-w,-
w+1,-1,1,w
-1,w,w+1},
b[l*5];F b
@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
@luser
luser / symbols.py
Last active September 9, 2023 04:54
GDB Mozilla symbol server
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
#
# A GDB Python script to fetch debug symbols from the Mozilla symbol server.
#
# To use, run `source /path/to/symbols.py` in GDB 7.9 or newer, or
# put that in your ~/.gdbinit.
from __future__ import print_function
@kirbyUK
kirbyUK / 6502_instructions.json
Created October 17, 2017 15:24
6502 instruction set in JSON
[
{
"bytes" : "2",
"description" : "Add with Carry",
"name" : "ADC",
"opcode" : "$69",
"mode" : "Immediate"
},
{
"opcode" : "$65",
@doughgle
doughgle / gist:e3a8c350dbf2370e69212f8b91fa4c88
Created November 20, 2017 15:26
Linux kernel 4.14 patch to disguise TracerPid in /proc/*/status
commit acc0182c3d3869802bc20c8bf4e04c3464936bcc
Author: Douglas Hellinger <doug.hellinger@hotmail.com>
Date: Sun Nov 19 22:48:46 2017 +0800
Fix tracerPid=0 in /proc
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 6f6fc16..bcf470d 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c