Skip to content

Instantly share code, notes, and snippets.

@bsmt
bsmt / Armory
Last active December 14, 2015 18:38
Package Armory into an app bundle for OS X.
#!/bin/bash
cd "${0%/*}"
export DYLD_LIBRARY_PATH=../Dependencies/QtCore.framework/Versions/Current:../Dependencies/QtGui.framework/Versions/Current:../Dependencies:$DYLD_LIBRARY_PATH
bin/python armorybuild/ArmoryQt.py &
@bsmt
bsmt / blah.py
Last active December 20, 2015 01:49
Demonstrate how to scrape ciphertext from http://homebrew.herokuapp.com/
# python blah.py my plaintext here
# F3C3ECD09B3238CB8060C2AF55BFC31451FF8C8DA0B6A0FC876FFA54D6D72B9BE3CAD927F8
# http://homebrew.herokuapp.com/?plaintext=my+plaintext+here
import requests
from HTMLParser import HTMLParser
from urllib import quote
import sys
@bsmt
bsmt / nsdataliteral.py
Created January 1, 2014 06:18
Dirty run script for xcode that allows NSData objects containing binary data (hex strings) to be declared using literal statements.
#!/usr/bin/env python
'''
The problem: Making NSData objects from byte strings is a pain.
To convert 0xb801000000c3 to NSData I have to make an escaped C string somehow,
which is either going to be annoying hardcoding or unnecessary categories.
Most basic foundation classes have literals (@1, @"string", etc.). Why not NSData?
This fixes that.
Simply do: NSData *data = @<b801000000c3>;
#!/usr/bin/env bash
# Create an OS X Mavericks vagrant box (for VMWare)
# Assumes you have /Applications/Install OS X Mavericks.app, brew, and of course vagrant
# http://grahamgilbert.com/blog/2013/08/23/creating-an-os-x-base-box-for-vagrant-with-packer/
EDITOR="mate -w"
WORKDIR=/tmp/osxvagrant
mkdir -p $WORKDIR
cd $WORKDIR
@bsmt
bsmt / autoexec.cfg
Last active August 29, 2015 14:04
DotA2 autoexec
// my autoexec.cfg
// along with setting up an autoexec, i add -novideo to arguments
// I also use dota2-clarity (https://github.com/iheartdisraptor/dota2-clarity)
// comment the next line if you don't use it.
//exec clarity/use_tutorials_and_aliases.cfg
say "hi"
///////// bindings
@bsmt
bsmt / meh.py
Last active August 29, 2015 14:04
'''Demonstrates communicating with the Wunderlist 3 websocket API.
This example just sends a ping request of sorts.
First, you must add your client id, device id, and access token to this script.
An easy way to do that is to load Wunderlist in lldb and do this:
[lldb]$breakpoint set -n '-[SRWebSocket initWithURLRequest:]'
[lldb]$r
Process 602 stopped
-> 0x10039b82f: pushq %rbp
@bsmt
bsmt / _.c
Created October 3, 2014 09:44
Probably the easiest but worst way to detect lldb.
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
char *underscore = getenv("_");
if (!strcmp(underscore, "/usr/bin/lldb"))
{
printf("lldb detected.\n");
@bsmt
bsmt / infest.cy
Last active August 29, 2015 14:11
Dirty hack to enable using skype as a shell with something like "/echo testing"
//sudo cycript -p Skype
@import com.saurik.substrate.MS
var get = function(name)
{
func_ = dlsym(RTLD_DEFAULT, name)
func = function() { var types = 'v', args = [], count = arguments.length; for (var i = 0; i != count; ++i) { types += '@'; args.push(arguments[i]); } new Functor(func_, types).apply(null, args); };
return func
}
NSLog = get("NSLog");
@bsmt
bsmt / Simplify3D.desktop
Created August 5, 2017 05:12
Simplify3D XDG Desktop file
#!/usr/bin/env xdg-open
[Desktop Entry]
Type=Application
Version=4.0
Name=Simplify3D
Comment=3D Printer Slicer
Icon=/opt/Simplify3D-4.0.0/icon.png
Exec=/opt/Simplify3D-4.0.0/LaunchScript.sh
Terminal=False
Path=/opt/Simplify3D-4.0.0
@bsmt
bsmt / cxnepo.py
Created August 21, 2017 04:02
dump CAN message data from OpenXC VI firmware binaries.
import argparse
import struct
from capstone import *
from capstone.arm import *
dis = Cs(CS_ARCH_ARM, CS_MODE_LITTLE_ENDIAN + CS_MODE_THUMB + CS_MODE_MCLASS)
dis.detail = True
BASE = 0x10000