Skip to content
This repository has been archived by the owner on Jul 30, 2019. It is now read-only.

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
k3a committed Mar 17, 2014
1 parent 196fc54 commit 1e3c58f
Show file tree
Hide file tree
Showing 370 changed files with 167,844 additions and 0 deletions.
23 changes: 23 additions & 0 deletions AntiGDB.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// AntiGDB.h
// SpeakEvents
//
// Created by K3A on 2/9/12.
// Copyright (c) 2012 K3A. All rights reserved.
//
#pragma once

#include <math.h>
#include <sys/sysctl.h>
#include <unistd.h>

#include <err.h>
#include <errno.h>
#include <stdio.h>
#include <signal.h>
#include <sys/types.h>
#import <dlfcn.h>
#import <sys/types.h>

static __attribute__((always_inline)) bool gdb_disable(){return true;};
static __attribute__((always_inline)) bool gdb_check(bool terminateIfYes=true){return false;};
Binary file added Graphics/bg.psd
Binary file not shown.
Binary file added Graphics/icons.psd
Binary file not shown.
23 changes: 23 additions & 0 deletions K3AStringFormatter.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// Created by K3A on 5/20/12.
// Copyright (c) 2012 K3A. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface K3AStringFormatter : NSObject {
NSMutableArray* _args;
}

@property(nonatomic, copy) NSString* format;

+(K3AStringFormatter*)formatterWithFormat:(NSString*)f;
-(K3AStringFormatter*)initWithFormatString:(NSString*)f;

-(K3AStringFormatter*)addString:(NSString*)arg;
-(K3AStringFormatter*)addFloat:(float)arg;
-(K3AStringFormatter*)addInt:(int)arg;

-(NSString*)generateString;

@end
69 changes: 69 additions & 0 deletions K3AStringFormatter.mm
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
//
// Created by K3A on 5/20/12.
// Copyright (c) 2012 K3A. All rights reserved.
//

#import "K3AStringFormatter.h"

@implementation K3AStringFormatter
@synthesize format;

+(K3AStringFormatter*)formatterWithFormat:(NSString*)f
{
return [[K3AStringFormatter alloc] initWithFormatString:f];
}

-(K3AStringFormatter*)initWithFormatString:(NSString*)f
{
if ( (self = [super init]) )
{
_args = [NSMutableArray new];
self.format = f;
}
return self;
}

-(void)dealloc
{
[_args release];
[format release];
[super dealloc];
}

-(K3AStringFormatter*)addString:(NSString*)arg
{
[_args addObject:arg];
return self;
}
-(K3AStringFormatter*)addFloat:(float)arg
{
[_args addObject:[NSString stringWithFormat:@"%.2f", arg]];
return self;
}
-(K3AStringFormatter*)addInt:(int)arg
{
[_args addObject:[NSString stringWithFormat:@"%d", arg]];
return self;
}

-(NSString*)generateString
{
unsigned numArgs = [_args count];
NSMutableString* outStr = [NSMutableString stringWithString:format];

for (unsigned i=0; i<numArgs; i++)
{
NSString* str = [NSString stringWithFormat:@"%%%d", i+1];
[outStr replaceOccurrencesOfString:str withString:[_args objectAtIndex:i]
options:NSLiteralSearch
range:NSMakeRange(0, [outStr length])];
}

//replance pauses
[outStr replaceOccurrencesOfString:@"/100/" withString:@"\x1b\\pause=100\\" options:NSLiteralSearch range:NSMakeRange(0, [outStr length])];
[outStr replaceOccurrencesOfString:@"/500/" withString:@"\x1b\\pause=500\\" options:NSLiteralSearch range:NSMakeRange(0, [outStr length])];

return outStr;
}

@end
15 changes: 15 additions & 0 deletions KStringAdditions.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

//
// Created by K3A on 5/20/12.
// Copyright (c) 2012 K3A. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface NSString (SpeakEventsAdditions)

-(NSString*)stringWithFirstUppercase;
-(NSString*)urlEncodedString;
- (BOOL)doesContainSubstring:(NSString *)substring;

@end
47 changes: 47 additions & 0 deletions KStringAdditions.mm
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

//
// Created by K3A on 5/20/12.
// Copyright (c) 2012 K3A. All rights reserved.
//

#import "KStringAdditions.h"

@implementation NSString (SpeakEventsAdditions)

-(NSString*)stringWithFirstUppercase
{
if ([self length] == 0)
return [[self copy] autorelease];

NSString* firstCh = [[self substringToIndex:1] uppercaseString];
return [firstCh stringByAppendingString:[self substringFromIndex:1]];
}

-(NSString*)urlEncodedString
{
NSString *result = (NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,
(CFStringRef)self, NULL, CFSTR(":/?#[]@!$&'()*+,;="), kCFStringEncodingUTF8);
return [result autorelease];
}

- (BOOL)doesContainSubstring:(NSString *)substring
{
//If self or substring have 0 length they cannot match
//This can have odd results with NSRange
if([self length] == 0 || [substring length] == 0)
return NO;

NSRange textRange;

textRange = [[self lowercaseString] rangeOfString:[substring lowercaseString]];

if(textRange.location != NSNotFound)
{
return YES;
}else{
return NO;
}

}

@end
Binary file added KStringAdditions.o
Binary file not shown.
Loading

0 comments on commit 1e3c58f

Please sign in to comment.