Skip to content

Instantly share code, notes, and snippets.

View rpetrich's full-sized avatar
Out with time lord dragon

Ryan Petrich rpetrich

Out with time lord dragon
View GitHub Profile
@rpetrich
rpetrich / BioLockdown.h
Created August 2, 2015 21:22
BioLockdown API
#import <Foundation/Foundation.h>
#import <AddressBook/AddressBook.h>
@class SBApplication, CKConversation;
__attribute__((visibility("hidden")))
@interface BioLockdownController : NSObject
+ (BioLockdownController *)sharedController;
@rpetrich
rpetrich / Rename Hook Procedures.py
Created July 21, 2015 20:34
Annotate hook procedure names in Hopper by parsing Objective C runtime calls
print "--"
print "Renaming Hooks for Current Procedure..."
print "Message from rpetrich: Please use this for good and not evil"
print "--"
doc = Document.getCurrentDocument()
def procedure_end(seg, proc):
addr = proc.getEntryPoint()
currentIndex = seg.getProcedureIndexAtAddress(addr)
@rpetrich
rpetrich / symbolicate
Created April 12, 2015 18:00
Symbolicate script for iOS
#!/bin/sh
if [[ $# == 0 ]]; then
ssh tunnel "bash -c \"symbolicate /var/mobile/Library/Logs/CrashReporter/LatestCrash.*\""
else
if [[ $1 == /* ]]; then
ssh tunnel "symbolicate '$1'"
else
ssh tunnel "bash -c \"symbolicate /var/mobile/Library/Logs/CrashReporter/LatestCrash-$1.*\""
fi
fi
@rpetrich
rpetrich / BioLockdown.h
Created January 23, 2015 23:07
BioLockdown API header
#import <Foundation/Foundation.h>
#import <AddressBook/AddressBook.h>
@class SBApplication;
__attribute__((visibility("hidden")))
@interface BioLockdownController : NSObject
+ (BioLockdownController *)sharedController;
@rpetrich
rpetrich / springboard-crash-help.sh
Created November 9, 2013 08:03
Basic crash debugging script
#!/bin/bash
# Basic iOS Crash Debugging Helper Script by rpetrich
apt-get install jp.ashikase.symbolicate grep curl coreutils coreutils-bin > /dev/null
if [ $? -ne 0 ]; then
echo "Unable to install debug script dependencies!" >&2
echo "Run script as root and make sure you have exited Cydia." >&2
exit 1
fi
IFS='|' read -r code url < <(
(
#!/bin/bash
(
for ARG in "$@"
do
tail -n+6 "$ARG" | awk '{print $2}'
done
) | sort | uniq -c | egrep ^\\s+$# | awk '{print $2}'
#!/bin/sh
# git-ticket-show by Ryan Petrich
if [ -e $1 ] ; then
echo "usage: git ticket-show <ticket>"
else
BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
REVLIST=`git rev-list HEAD`
echo "Merge status of ticket $1 relative to $BRANCH:"
git log --all --no-merges --format=%H --grep="$1[:+]" | \
while read commit
@rpetrich
rpetrich / make_char_array.rb
Created April 21, 2013 07:44
Convert binaries to character arrays
#!/usr/bin/env ruby
ARGV.each do |filename|
puts "// #{filename}"
myfile = File.open(filename, "r")
result = ""
myfile.each_byte { |byte| result = result + "," + byte.to_s }
myfile.close
safename = filename.gsub(".", "_").gsub("/","$").gsub("@","$")
puts "static const char #{safename}[] = { " + result[1..-1] +" };";
# puts "const size_t #{safename}_size = sizeof(#{safename});";
#!/bin/sh
if [[ $# == 0 ]]; then
SYM_PATH="/var/mobile/Library/Logs/CrashReporter/LatestCrash.plist"
else
if [[ $1 == /* ]]; then
SYM_PATH="$1"
else
SYM_PATH="/var/mobile/Library/Logs/CrashReporter/LatestCrash-$1.plist"
fi
fi
function makePair(left, right) {
return { left: left, right: right };
}
window["add"] = function(a, b) {
var pair = makePair(a, b);
return t.left + t.right;
}