Skip to content

Instantly share code, notes, and snippets.

@brianairb
brianairb / dump_stack.c
Last active January 4, 2016 10:39
dump_stack function from picoCTF 2013
#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) {
@brianairb
brianairb / gist:11096061
Last active August 29, 2015 14:00
usbmuxd patch
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 / get_symbols.py
Created November 12, 2015 03:24
Fetch symbols for DLLs from Microsoft Symbol Server
#!/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 / awkward_exploit.py
Last active May 11, 2018 10:33
Reference exploit for awkward from PlaidCTF 2016
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 / headers.txt
Last active February 15, 2021 17:31
Clubhouse HTTP Headers
CH-Languages: en-US
CH-UserID: 1234567890
CH-Locale: en_US
CH-AppBuild: 297
CH-AppVersion: 0.1.27
CH-DeviceId: 7CAF8200-EC2B-4392-A62B-62D41AFB7648
User-Agent: clubhouse/297 (iPhone; iOS 14.4; Scale/2.00)
Authorization: Token ef1f1be31620226ea1dee33edfc6e3feecc5036f
@brianairb
brianairb / api_list.txt
Created February 15, 2021 17:36
Clubhouse API list
record_action_trails
start_phone_number_auth
call_phone_number_auth
resend_phone_number_auth
complete_phone_number_auth
check_waitlist_status
get_release_notes
get_all_topics
get_topic
get_clubs_for_topic