Skip to content

Instantly share code, notes, and snippets.

View samdmarshall's full-sized avatar
💭
I will be slow to respond.

Samantha Demi samdmarshall

💭
I will be slow to respond.
View GitHub Profile
//
// bundle.c
// Daodan
//
// Created by Sam Marshall on 2/16/14.
// Copyright (c) 2014 Sam Marshall. All rights reserved.
//
#ifndef Daodan_bundle_c
#define Daodan_bundle_c
@implementation NSView(Additions)
- (void)addSubviewAndUpdateConstraints:(NSView *)view {
[self addSubview:view];
view.translatesAutoresizingMaskIntoConstraints = NO;
for (NSString *string in @[@"H:|[view]|", @"V:|[view]|"]) {
NSArray *constraints = [NSLayoutConstraint constraintsWithVisualFormat:string options:0 metrics:nil views:NSDictionaryOfVariableBindings(view)];
[view.superview addConstraints:constraints];
}
}
echo "${ACTION}"
if [ "${ACTION}" = "clean" ]; then
echo "Cleaning Libraries..."
rm -fd "${BUILD_DIR}/Universal/*"
fi
if [ "${ACTION}" = "build" ]; then
cd ${BUILD_DIR}/Universal
lipo -create libcapstone-64.a libcapstone-32.a -o libcapstone.a
#define DYLD_INTERPOSE(_replacement,_replacee) \
__attribute__((used)) static struct{ const void* replacement; const void* replacee; } _interpose_##_replacee \
__attribute__ ((section ("__DATA,__interpose"))) = { (const void*)(unsigned long)&_replacement, (const void*)(unsigned long)&_replacee };
DYLD_INTERPOSE(my_function_replacement, original_function);
int original_function() {
return 5;
}
uint64_t offset = section->offset;
struct segment_64 *text_segment = (struct segment_64 *)text_segment_pointer;
uint64_t addr_offset = section->addr - text_segment->vm_addr;
if (section->offset != addr_offset) {
offset = addr_offset;
}
uint64_t offset = section->offset;
struct segment_32 *text_segment = (struct segment_32 *)text_segment_pointer;
uint64_t addr_offset = section->addr - text_segment->vm_addr;
00000000 6A00 push byte +0x0
00000002 48 dec ax
00000003 89E5 mov bp,sp
00000005 48 dec ax
00000006 83E4F0 and sp,byte -0x10
00000009 48 dec ax
0000000A 8B7D08 mov di,[di+0x8]
0000000D 48 dec ax
0000000E 8D7510 lea si,[di+0x10]
00000011 89FA mov dx,di
command alias reveal_load_sim expr (void*)dlopen("/Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries/libReveal.dylib", 0x2);
command alias reveal_load_dev expr (void*)dlopen([(NSString*)[(NSBundle*)[NSBundle mainBundle] pathForResource:@"libReveal" ofType:@"dylib"] cStringUsingEncoding:0x4], 0x2);
command alias reveal_start expr (void)[(NSNotificationCenter*)[NSNotificationCenter defaultCenter] postNotificationName:@"IBARevealRequestStart" object:nil];
command alias reveal_stop expr (void)[(NSNotificationCenter*)[NSNotificationCenter defaultCenter] postNotificationName:@"IBARevealRequestStop" object:nil];
Class definitions in the Objective-C 2 runtime have a "base protocols" list which lists a number of protocol definitions, each of those defintions have another protocol list, which in turn defines another set of protocols.
I'm wondering if there is any restriction on how deep this "recursive" list behavior can go.
Also if the way this works is if class Foo conforms to protocol FooDelegate, and FooDelegate definition conforms to BazProtocol and BarProtocol, if they are defined as follows:
Class Foo:
...
protocol list -> (count: 1) [ FooDelegate ]
...
[22:50] <RasAlGhul> let's hack Israel to save the world!
[22:52] <soot> lolwut
[22:55] <RasAlGhul> Israel is a threat to the world. If we hack Israel, we save the world. Let's do this!!!
[22:55] <dirkg> HACK THE PLANET
[22:55] <RasAlGhul> I am a member of Anonymous currently engaged in hacking Israeli targets, who will join us?
[22:55] <dirkg> loooool
[23:00] <richinseattle> RasAlGhul: what are you targeting?
[23:01] <RasAlGhul> The Dimona nuclear weapons facility
[23:01] dirkg grabs the popcorn
[23:01] <dirkg> i love anon-kiddies
[23:43] <nocsi> RasAlGhul I wrote a virus to make the brightness of their monitor blind them. will sell
[23:43] <dirkg> nocsi but does it airgap
[23:43] <nocsi> It's really gradual though for some reason
[23:43] <nocsi> yes it exploits a weakness in the light sensor on macs
[23:43] <dirkg> oh shit
[23:44] <dirkg> that is like what
[23:44] <dirkg> 500k
[23:44] <nocsi> I give student discount
[23:44] <nocsi> so 469k
[23:44] <dirkg> very reasonable