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) | |
{ | |
//dataIndex is 'position' in the data, endLimit is (region_size) - (datatype_size) | |
//dataAlignment is amount to advance dataIndex for each iteration | |
while (dataIndex <= endLimit) | |
{ | |
if (comparisonFunction(searchData, (T *)((int8_t *)bytes + dataIndex), searchValue)) | |
{ | |
P memoryAddress = (P)(address + dataIndex); |
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++) | |
{ |
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
#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
// task_for_pid leak | |
// **IMPORTANT** To reproduce this bug, you have to sign this program with a developer ID -- do not use a self-signed certificate or run as root! | |
// This code will cause taskgated's memory usage to grow (see activity monitor) | |
// Link to Xcode project with included info.plist: http://tinyurl.com/kps28av | |
// Radar 16230826 | |
#include <mach/mach_init.h> | |
#include <mach/task.h> | |
#include <mach/mach_port.h> |
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
#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
#import "ZZGAppDelegate.h" | |
@interface Foo : NSObject | |
@end | |
@implementation Foo | |
- (void)dealloc | |
{ |
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 xman | |
set lookup_name "$argv[-1]" | |
set lookup_section "$argv[1]" | |
set open_string "" | |
set grep_string "" | |
set beginning_pattern "(^|[ \t\r\n\f])" | |
if [ $lookup_name = $lookup_section ]; set open_string "x-man-page://$lookup_name"; set grep_string "$beginning_pattern$lookup_name\\("; end; | |
if [ $lookup_name != $lookup_section ]; set open_string "x-man-page://$lookup_section/$lookup_name"; set grep_string "$beginning_pattern$lookup_name\\($lookup_section\\)"; end; | |
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 |
OlderNewer