This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
int main(int argc, char *argv[]) { | |
@autoreleasepool { | |
NSInteger loc = 0; NSInteger len = -1; NSRange range = NSMakeRange(loc, len); | |
NSLog(@"%@",NSStringFromRange(range)); | |
len = len ^ (0x8 << ((sizeof(len)-1)*4)); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const float speed = 0.2; | |
float timer = 5.0; | |
dispatch_semaphore_t timer_semaphore; | |
-(void)gameaction{ | |
dispatch_sync(dispatch_get_main_queue(), ^{ | |
choice = arc4random() % 2; | |
id button = (choice == 1 ? _LButton : _RButton); | |
BOOL state = (choice == 1 ? TRUE : FALSE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void _AFCHeaderInit(_AFCPacketHeader *header, uint32_t command, uint32_t packet_header_size, uint32_t body_data_size, uint32_t pack_num) { | |
header->signature = 0x4141504c36414643; // 'APPL6AFC' | |
header->headerLen = packet_header_size; | |
header->packetLen = body_data_size+packet_header_size; | |
header->type = command; | |
if (pack_num) { | |
header->pid = pack_num; | |
} else { | |
header->pid = k64BitMask; // but not always? this is really weird | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "Mail" | |
set recip_list to {} | |
set mailbox_contents to messages of mailbox "<MAILBOX NAME>" of account "<ACCOUNT NAME>" | |
repeat with message_item in mailbox_contents | |
set recip_address to address of recipient of message_item | |
if recip_address is not in recip_list then | |
set recip_list to recip_list & recip_address | |
end if | |
end repeat | |
recip_list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSError *err = nil; | |
NSString *file_text = [[NSString alloc] initWithContentsOfFile:path encoding:NSStringEncodingUTF8 error:&err]; | |
NSArray *text_lines = [file_text componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]]; | |
for (NSString *line in text_lines) { | |
NSLog(@"%@",line); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define kDelimiterLength 4 | |
... | |
uint8_t newlineDelimiter[kDelimiterLength] = { 0x0d, 0x0a, 0x0d, 0x0a }; // this is going to be variable, this is \r\n\r\n { 0x0a, 0x0a } would be \n\n | |
NSData *data = [NSData dataWithContentsOfReallyMappedFile:filePath]; | |
NSData *delimiter = [NSData dataWithBytes:&newlineDelimiter length:sizeof(uint8_t)*kDelimiterLength]; | |
NSRange searchRange = NSMakeRange(0, data.length); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function InstallMachIPCServer() { | |
var_56 = *__stack_chk_guard; | |
var_5224 = **__stack_chk_guard; | |
eax = getenv("HOME"); | |
if ((eax != 0x0) && (*(int8_t *)eax != 0x0)) goto loc_22e1c; | |
goto loc_22fae; | |
loc_22e1c: | |
ebx = &var_3176; | |
strncpy(ebx, eax, 0x400); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function SteamStdLib::CCommandLine::AppendParm(int, char const*) { | |
_PIC_register_ = eax; | |
ebx = arg_offset_x0; | |
eax = SteamStdLib::CCommandLine::GetCommandString(ebx, arg_offset_x4); | |
if (eax != 0x0) { | |
esi = arg_offset_x8; | |
var_40 = eax; | |
edi = strlen(eax); | |
if (esi != 0x0) { | |
edi = edi + strlen(esi) + 0x1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch i386 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-receiver-is-weak -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declara |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ((len>pfile_in_zip_read_info->rest_read_uncompressed) && | |
(!(pfile_in_zip_read_info->raw))) | |
pfile_in_zip_read_info->stream.avail_out = | |
(uInt)pfile_in_zip_read_info->rest_read_uncompressed; | |
if ((len>pfile_in_zip_read_info->rest_read_compressed+ | |
pfile_in_zip_read_info->stream.avail_in) && | |
(pfile_in_zip_read_info->raw)) | |
pfile_in_zip_read_info->stream.avail_out = | |
(uInt)pfile_in_zip_read_info->rest_read_compressed+ |