Skip to content

Instantly share code, notes, and snippets.

Brian Pak brianairb

Block or report user

Report or block brianairb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@brianairb
brianairb / awkward_exploit.py
Last active May 11, 2018
Reference exploit for awkward from PlaidCTF 2016
View awkward_exploit.py
from pwn import *
import struct
def write_byte(idx, val):
val &= 0xFF
s = []
for i in xrange(8):
if val & (1 << i):
if i == 0:
s.append(chr(256-(idx*8)))
@brianairb
brianairb / get_symbols.py
Created Nov 12, 2015
Fetch symbols for DLLs from Microsoft Symbol Server
View get_symbols.py
#!/usr/bin/python
import sys
# https://github.com/erocarrera/pefile
sys.path.append('./pefile')
import pefile
import struct
import requests
import os
import subprocess
@brianairb
brianairb / gist:11096061
Last active Aug 29, 2015
usbmuxd patch
View gist:11096061
diff --git a/src/device.c b/src/device.c
index e36509e..ea99d63 100644
--- a/src/device.c
+++ b/src/device.c
@@ -441,7 +441,7 @@ void device_client_process(int device_id, struct mux_client *client, short event
memmove(conn->ib_buf, conn->ib_buf + size, conn->ib_size);
}
}
- if(events & POLLIN) {
+ if((events & POLLIN) && conn->sendable > 0) {
@brianairb
brianairb / dump_stack.c
Last active Jan 4, 2016
dump_stack function from picoCTF 2013
View dump_stack.c
#include <stdio.h>
void dump_stack(void **stack, size_t n, void **arg0) {
printf("Stack dump:\n");
while (n-- > 0) {
printf("0x%08x: 0x%08x", &stack[n], stack[n]);
if (n == 0) {
printf(" (beginning of buffer)");
}
if (&stack[n] == arg0 + 1) {
You can’t perform that action at this time.