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> | |
// Useful references: | |
// -[SMProcess webKitActiveURLs] implementation used in Activity Monitor on 10.9 (search for it using Hopper) | |
// http://opensource.apple.com/source/WebKit2/WebKit2-7537.71/WebProcess/mac/WebProcessMac.mm | |
// https://github.com/rodionovd/RDProcess/blob/master/RDProcess.m | |
const CFStringRef kLSActivePageUserVisibleOriginsKey = CFSTR("LSActivePageUserVisibleOriginsKey"); | |
const int kLSMagicConstant = -1; |
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
#include <mach/task.h> | |
#include <mach/mach_init.h> | |
#include <stdbool.h> | |
static bool amIAnInferior(void) | |
{ | |
mach_msg_type_number_t count = 0; | |
exception_mask_t masks[EXC_TYPES_COUNT]; | |
mach_port_t ports[EXC_TYPES_COUNT]; | |
exception_behavior_t behaviors[EXC_TYPES_COUNT]; |
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
#Game Speed Hack | |
#Increase x86-64 game by 2x by overriding mach_absolute_time | |
#May not work on games that call gettimeofday or something else instead | |
#May not work on games that don't call a time function at all (these areee badddd) | |
#May also not work if the function is referenced in more than one executable image (eg, local library) | |
#This is not very robust | |
from bitslicer import VirtualMemoryError, DebuggerError | |
import vmprot | |
SPEED_MULTIPLIER = 2.0 |
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
%default total | |
Prefix : Type | |
Prefix = String | |
data Format = Number Prefix Format | Str Prefix Format | End Prefix | |
parse : List Char -> String -> Format | |
parse [] prefix_acc = End prefix_acc | |
parse ('%' :: 'd' :: xs) prefix_acc = Number prefix_acc (parse xs "") |
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
Unable to run UI Tests because Xcode Helper does not have permission to use Accessibility. | |
To enable UI testing, go to the Security & Privacy pane in System Preferences, select the Privacy tab, | |
then select Accessibility, and add Xcode Helper to the list of applications allowed to use Accessibility. |
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
// I'm not using the passed editRange and delta because I've found them to be quite misleading... | |
// This happens to be a new API (macOS 10.11) so maybe it's not really battle tested or I don't know what I'm doing | |
// Either way I'd like to support older systems so for portability sake it's easier to not use these parameters | |
- (void)textStorage:(NSTextStorage *)textStorage didProcessEditing:(NSTextStorageEditActions)editedMask range:(NSRange)editedRange changeInLength:(NSInteger)__unused delta | |
{ | |
if ((editedMask & NSTextStorageEditedCharacters) != 0) | |
{ | |
//[self updateTextProcessingForTextStorage:textStorage]; | |
//NSLog(@"Edited range: %lu, %lu", editedRange.location, editedRange.length); | |
[textStorage removeAttribute:NSBackgroundColorAttributeName range:NSMakeRange(0, textStorage.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
// This uses a legacy version of swift | |
import Foundation | |
class Model: NSObject, NSSecureCoding { | |
let bar: String | |
init(bar: String) { | |
self.bar = bar | |
} | |
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 "ZGAppDelegate.h" | |
@interface ZGAppDelegate () | |
@property (nonatomic) NSTimer *timer; | |
@property (assign) IBOutlet NSProgressIndicator *progressIndicator; | |
@end | |
@implementation ZGAppDelegate |
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
template <typename T, typename P> | |
void ZGSearchWithFunctionHelperRegular(T *searchValue, bool (*comparisonFunction)(ZGSearchData *, T *, T *), ZGSearchData * __unsafe_unretained searchData, ZGMemorySize dataIndex, ZGMemorySize dataAlignment, ZGMemorySize endLimit, P pointerSize, NSMutableData * __unsafe_unretained resultSet, ZGMemoryAddress address, void *bytes) | |
{ | |
const ZGMemorySize maxSteps = 4096; | |
while (dataIndex <= endLimit) | |
{ | |
ZGMemorySize numberOfVariablesFound = 0; | |
P memoryAddresses[maxSteps]; | |
ZGMemorySize numberOfStepsToTake = MIN(maxSteps, (endLimit + dataAlignment - dataIndex) / dataAlignment); |
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
template <typename T, typename P> | |
void ZGSearchWithFunctionHelperDirect(T *searchValue, bool (*comparisonFunction)(ZGSearchData *, T *, T *), ZGSearchData * __unsafe_unretained searchData, ZGMemorySize dataIndex, ZGMemorySize dataSize, ZGMemorySize dataAlignment, ZGMemorySize endLimit, P pointerSize, NSMutableData * __unsafe_unretained resultSet, ZGMemoryAddress address, void *bytes) | |
{ | |
ZGMemorySize maxSteps = 4096; | |
while (dataIndex <= endLimit) | |
{ | |
ZGMemorySize numberOfVariablesFound = 0; | |
P memoryAddresses[maxSteps]; | |
for (ZGMemorySize stepIndex = 0; stepIndex < maxSteps && dataIndex <= endLimit; stepIndex++) | |
{ |
NewerOlder