Skip to content

Instantly share code, notes, and snippets.

# .gitignore for Xcode projects
.DS_Store
.Trashes
*.swp
*.lock
*~.nib
DerivedData/
@acoomans
acoomans / lldb_ios.md
Last active March 29, 2026 01:53
Remote iOS lldb debugging

Remote iOS lldb debugging

http://versprite.com/og/ios-reverse-engineering-part-one-configuring-lldb/

Installing

Find the debug server from the device support disk:

ls -d /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/* | sort | tail -n1
  hdiutil attach /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/8.0\ \(12A365\)/DeveloperDiskImage.dmg
@acoomans
acoomans / pypi.md
Last active September 3, 2015 18:58
Publishing to PyPI

Publishing to PyPI

  1. increment version in setup.py, commit and tag

  2. test

     python setup.py develop
     python setup.py test
    
  3. login on PyPi

@acoomans
acoomans / fastenum.m
Created June 16, 2015 21:16
Modern Fast enumeration
// cfr FastEnumerationSample
// https://developer.apple.com/library/mac/samplecode/FastEnumerationSample/Listings/EnumerableClass_mm.html#//apple_ref/doc/uid/DTS40009411-EnumerableClass_mm-DontLinkElementID_4
#pragma mark - NSFastEnumeration
- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state
objects:(id __unsafe_unretained [])buffer
count:(NSUInteger)len {
@acoomans
acoomans / hd_vm.md
Last active March 29, 2026 01:54
Physical HD in VM

Physical HD in VM

virtualbox:

VBoxManage internalcommands createrawvmdk -filename "</path/to/file>.vmdk" -rawdisk /dev/disk#
VBoxManage storageattach "<vm_name>" --storagectl "IDE" --port 0 --device 0 --type hdd --medium "</path/to/file>.vmdk"
sudo chown arnaud /dev/disk#; sudo chmod 666 /dev/disk#; chmod 666 "</path/to/file>.vmdk"

vmware:

@acoomans
acoomans / break.md
Last active March 29, 2026 01:54
Breakpoint main threat

Breakpoint main threat

breakpoint set --fullname read --condition "((BOOL)[NSThread isMainThread])"

--method
--selector

breakpoint command add -o "command" BRKPTID

@acoomans
acoomans / Makefile
Last active September 3, 2015 16:29
iOS simulator command line executable
sdk = /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk
all: t
%: %.m
clang \
-x objective-c \
-miphoneos-version-min=7.0 \
-arch i386 \
-fobjc-arc \
@acoomans
acoomans / hello.s
Last active August 29, 2015 14:13
x86 asm "hello"
// hello world example
// llvm/gas x86 assembly (AT&T syntax)
//
// http://cs.lmu.edu/~ray/notes/gasexamples/
// http://tigcc.ticalc.org/doc/gnuasm.html
//
// https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/LowLevelABI/Mac_OS_X_ABI_Function_Calls.pdf
//
// syscalls
// http://www.opensource.apple.com/source/xnu/xnu-2782.1.97/bsd/kern/syscalls.master
@acoomans
acoomans / hello.s
Last active August 29, 2015 14:13
ARM asm "hello"
// hello world example
// llvm ARM assembly
//
// https://developer.apple.com/library/ios/documentation/Xcode/Conceptual/iPhoneOSABIReference/iPhoneOSABIReference.pdf
// http://www.opensource.apple.com/source/xnu/xnu-2782.1.97//bsd/kern/syscalls.master
//
// void p();
.data
message:
@acoomans
acoomans / autoexec.cfg
Last active May 23, 2024 14:56
Quake 3 configuration
// for ioquake for mac, this file lives under /Applications/ioquake3/baseq3/
// $ wget https://gist.githubusercontent.com/acoomans/a0de33bc82cbb5bd1024/raw/autoexec.cfg -O $HOME/Library/Application\ Support/Quake3/baseq3/autoexec.cfg
unbindall
bind TAB "+scores"
bind ESCAPE "togglemenu"
bind ` "toggleconsole"
bind ~ "toggleconsole"
bind + "sizeup"