Skip to content

Instantly share code, notes, and snippets.

View steventroughtonsmith's full-sized avatar

Steven Troughton-Smith steventroughtonsmith

View GitHub Profile
@steventroughtonsmith
steventroughtonsmith / Demangle Swift.py
Created January 31, 2015 09:14
Hopper Swift demangler
import subprocess
def looksLikeBeginning(doc,seg,adr):
if doc.is64Bits() and seg.readByte(adr) == 0x55 and seg.readByte(adr + 1) == 0x48 and seg.readByte(adr + 2) == 0x89 and seg.readByte(adr + 3) == 0xE5:
return True
if not doc.is64Bits() and seg.readByte(adr) == 0x55 and seg.readByte(adr + 1) == 0x89 and seg.readByte(adr + 2) == 0xE5:
return True
return False
doc = Document.getCurrentDocument()
@steventroughtonsmith
steventroughtonsmith / Makefile
Created January 19, 2015 01:42
Pascal:Mac Linker Error
#
# Requires https://github.com/ksherlock/mpw and an
# install of MPW in the emulator's root (~/mpw)
# Uses modern (Xcode) version of Rez
#
# Location of your mpw binary
MPW=~/bin/mpw
RINCLUDES=/Applications/MPW-GM/Interfaces\&Libraries/Interfaces/RIncludes
@steventroughtonsmith
steventroughtonsmith / DAHeader.c
Created January 16, 2015 09:22
MPW PascalIIGS
/*
* Copyright Apple Computer, Inc. 1986, 1987
* All Rights Reserved
*/
extern int OpenDA();
extern int CloseDA();
extern int ActionDA();
extern int InitDA();
@steventroughtonsmith
steventroughtonsmith / DAEntry.a
Created January 16, 2015 02:08
MPW Link Out Of Memory
***************************************************************************
****
**** DESK ACCESSORY and DEVICE DRIVER Entry Code/Data
****
***************************************************************************
STRING PASCAL
INCLUDE 'Events.a'
INCLUDE 'Devices.a'
@steventroughtonsmith
steventroughtonsmith / Makefile
Created January 16, 2015 00:30
MPW Rez OS error -1421; "make -i"
RINCLUDES=/Applications/MPW-GM/Interfaces\&Libraries/Interfaces/RIncludes
SymOptions = -sym Full
SymOpt = $(SymOptions)
COptions = -w 17 -proto strict $(SymOpt) -D OLDROUTINELOCATIONS=0
MrCOptions = $(SymOpt) -D OLDROUTINELOCATIONS=0
all : Sample NativeRezSample
%.o: %.c
mpw SC $< -o $@ $(COptions)
@steventroughtonsmith
steventroughtonsmith / Example.c
Created January 15, 2015 19:53
MPW --ram Bug
#include <stdio.h>
int main()
{
printf("Example\n");
}
@steventroughtonsmith
steventroughtonsmith / NanoCompanion.m
Last active September 19, 2015 17:00
Load the Apple Watch Companion Settings Bundles into an app
//
// AppDelegate.m
// NanoCompanion
//
// Created by Steven Troughton-Smith on 13/01/2015.
// Copyright (c) 2015 High Caffeine Content. All rights reserved.
//
#import "AppDelegate.h"
@interface UIWindow (resize)
-(void)_adjustSizeClassesAndResizeWindowToFrame:(CGRect)frame;
@end
typedef enum _UICustomRes
{
UICustomResiPadTwoThirds,
UICustomResiPadHalf,
UICustomResiPadOneThird,
UICustomResiPhone47,
[mcp] Activating mod mcp
[FML] Activating mod FML
[Forge] Activating mod Forge
[CodeChickenCore] Activating mod CodeChickenCore
[Micdoodlecore] Activating mod Micdoodlecore
[MobiusCore] Activating mod MobiusCore
[NotEnoughItems] Activating mod NotEnoughItems
[PowerCrystalsCore] Activating mod PowerCrystalsCore
[TConstruct-Preloader] Activating mod TConstruct-Preloader
[AppliedEnergistics-Core] Activating mod AppliedEnergistics-Core
@steventroughtonsmith
steventroughtonsmith / modlist
Last active August 29, 2015 14:01
HCC2 1.0.8
mods:
AM2_1.1.2b.zip
AdditionalPipes2.6.0-BC4.2.1.jar
AdvancedMachines_1.6.4.zip
AdvancedPowerManagement-1.2.85-IC2-1.118.jar
AnimationAPI v1.1.2 mc1.6.4.zip
ArchimedesShips.zip
Atomic-Science-1.1.0.49-core.jar
BetterDungeons207.zip