Skip to content

Instantly share code, notes, and snippets.

@x56
x56 / find_CFLStrings.py
Created March 19, 2016 04:58
IDAPython script to name and create structs for all CFLString objects
import idaapi
import idc
#import idautils
import sys
#NOTE: may have to run this a few times to get to the end of the IDB, haven't bothered fixing this
def add_struct_to_idb(name):
idc.Til2Idb(-1, name)
@x56
x56 / grab_firmwares.py
Created March 19, 2016 04:53
Script for downloading all available AirPort device firmwares
#!/usr/bin/env python
import errno
import os
import plistlib
import sys
import urllib
def makedirs_if_absent(path):
try:
@x56
x56 / env_test.c
Created December 10, 2015 11:31
env_test.c
#include <stdio.h>
int main(int argc, char *argv[], char *envp[])
{
int i = 0;
char *env = NULL;
while ((env = envp[i++]) != NULL) {
printf("%s\n", env);
}
@x56
x56 / argparse_empty_mutually_exclusive_group_crash.py
Created September 13, 2015 23:29
Python argparse crash PoC
#!/usr/bin/env python
#
# usage: ./argparse_empty_mutually_exclusive_group_crash.py blah
import argparse
parser = argparse.ArgumentParser()
mut_ex_group = parser.add_mutually_exclusive_group()
parser.parse_args()
@x56
x56 / serial_keyboard_init.S
Created July 13, 2015 06:28
serial_keyboard_init()
/* refer to osfmk/console/serial_general.c */
.globl _cereal64
_cereal64:
/* do the important parts of serial_keyboard_init() */
stp x20, x19, [sp, #-0x20]!
stp x29, x30, [sp, #0x10]
add x29, sp, #0x20
sub sp, sp, #0x10
{
"0": {
"comm": "\nSection .text\n\nRange 0x0 - 0x4000 (16384 bytes)\nFile offset 65536 (16384 bytes)\n",
"icom": null,
"name": "BOOTROM_BASE",
"seg": 0
},
"148": {
"comm": null,
"icom": null,
@x56
x56 / pp_res_deobfuscate.py
Last active August 29, 2015 14:14
PPAlgorithm encodeResource
#!/usr/bin/env python
#
# public domain
import sys
if len(sys.argv) != 3:
print "pp_res_deobfuscate.py [input file] [output file]"
sys.exit(1)
@x56
x56 / silly.grc
Created December 8, 2014 23:20
GRC sound effects generator
<?xml version='1.0' encoding='ASCII'?>
<?grc format='1' created='3.7.6'?>
<flow_graph>
<timestamp>Sun Dec 7 22:19:00 2014</timestamp>
<block>
<key>options</key>
<param>
<key>id</key>
<value>top_block</value>
</param>
@x56
x56 / gist:6801541
Created October 2, 2013 22:38
Arduino sketch to go with pyCraft fork
int incomingByte = 0;
void setup() {
pinMode(2, OUTPUT);
pinMode(13, OUTPUT);
Serial.begin(9600);
}
void loop() {
if (Serial.available() > 0) {