Skip to content

Instantly share code, notes, and snippets.

@FilippoBiga
FilippoBiga / macho-prime.txt
Created August 14, 2019 11:46
A prime number which is also a valid x86-64 Mach-O file on modern macOS
0xcffaedfe0700000103000080020000000300000048010000010000000000000019000000480000005f5f504147455a45524f00000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000019000000480000005f5f544558540000000000000000000000000000010000007e0100000000000000000000000000007e010000000000000700000005000000000000000000000005000000b8000000040000002a000000000000000000000000000000000000000000000000000000000000000000000001000000000000002800000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000068010000010000000000000000000000000000000000000000000000000000000000000000000000ba0b000000b8040000020f054889c7b8010000020f05000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
@FilippoBiga
FilippoBiga / linked_list.ksy
Created January 22, 2018 18:19
Kaitai linked list
meta:
id: linked_list
endian: le
seq:
- id: entries
size: 8
type: entry
repeat: until
repeat-until: _.next == 0
types:
'''
Generate a dot graph of all the packages installed
through Homebrew. Requires pydot.
Usage: python brew-graph.py <outfile.dot>
'''
import pydot
from subprocess import Popen, PIPE
@FilippoBiga
FilippoBiga / entitlements.plist
Created March 15, 2015 19:35
lockdown identity
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.private.lockdown.finegrained-get</key>
<array>
<string>NULL/ActivationInfo</string>
<string>NULL/ActivationPrivateKey</string>
<string>NULL/ActivationRegulatoryVariant</string>
<string>NULL/ActivationState</string>
@FilippoBiga
FilippoBiga / CharGen
Created April 17, 2011 19:33
generat a char[] from a string
#!/bin/sh
# Usage: CharGen.sh charname "string"
cprint() { printf "$charname[$ccount]='$1'; " | sed 's/_/\ /g'; }
string=`echo "$2" | sed 's/ /_/g'`
charname="$1"
ccount=`echo $string | fold -w1 | wc -l | sed 's/\ //g'`
printf "$charname[$ccount];\n"
ccount=0
for character in `echo $string | fold -w1`; do cprint $character; let ccount++; done