This repository has been archived by the owner on Nov 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Marco For DYLDCallBack. New Hacking Guide
- Loading branch information
Naville
committed
Mar 7, 2016
1 parent
28ef1cc
commit 6ffdc4f
Showing
118 changed files
with
119 additions
and
20 deletions.
There are no files selected for viewing
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
//Shall We Use Marcos instead of this shit? | ||
#import "../SharedDefine.pch" | ||
#import <mach-o/getsect.h> | ||
#import <dlfcn.h> | ||
extern NSString* RandomString(); | ||
extern void init_DeviceIDFake_hook(){ | ||
for(int i=0;i<_dyld_image_count();i++){ | ||
const char * Nam=_dyld_get_image_name(i); | ||
NSString* curName=[[NSString stringWithUTF8String:Nam] autorelease]; | ||
if([curName containsString:WTFJHTWEAKNAME]){ | ||
intptr_t ASLROffset=_dyld_get_image_vmaddr_slide(i); | ||
//We Found Ourself | ||
#ifndef _____LP64_____ | ||
uint32_t size=0; | ||
const struct mach_header* selfHeader=(const struct mach_header*)_dyld_get_image_header(i); | ||
char * data=getsectdatafromheader(selfHeader,"WTFJH","DeviceIDFake",&size); | ||
|
||
#elif | ||
uint64_t size=0; | ||
const struct mach_header_64* selfHeader=(const struct mach_header_64*)_dyld_get_image_header(i); | ||
char * data=getsectdatafromheader_64(selfHeader,"WTFJH","DeviceIDFake",&size); | ||
#endif | ||
data=ASLROffset+data;//Add ASLR Offset To Pointer And Fix Address | ||
NSData* SDData=[NSData dataWithBytes:data length:size]; | ||
NSString* randomPath=[NSString stringWithFormat:@"%@/Documents/%@",NSHomeDirectory(),RandomString()]; | ||
[SDData writeToFile:randomPath atomically:YES]; | ||
dlopen(randomPath.UTF8String,RTLD_NOW); | ||
//Inform Our Logger | ||
CallTracer *tracer = [[CallTracer alloc] initWithClass:@"WTFJH" andMethod:@"LoadThirdPartyTools"]; | ||
[tracer addArgFromPlistObject:@"dlopen" withKey:@"Type"]; | ||
[tracer addArgFromPlistObject:randomPath withKey:@"Path"]; | ||
[tracer addArgFromPlistObject:@"DeviceIDFake" withKey:@"ModuleName"]; | ||
[traceStorage saveTracedCall: tracer]; | ||
[tracer release]; | ||
//End | ||
|
||
[SDData release]; | ||
break; | ||
} | ||
|
||
|
||
|
||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
//Shall We Use Marcos instead of this shit? | ||
#import "../SharedDefine.pch" | ||
#import <mach-o/getsect.h> | ||
#import <dlfcn.h> | ||
extern NSString* RandomString(); | ||
extern void init_InspectiveC_hook(){ | ||
for(int i=0;i<_dyld_image_count();i++){ | ||
const char * Nam=_dyld_get_image_name(i); | ||
NSString* curName=[[NSString stringWithUTF8String:Nam] autorelease]; | ||
if([curName containsString:WTFJHTWEAKNAME]){ | ||
intptr_t ASLROffset=_dyld_get_image_vmaddr_slide(i); | ||
//We Found Ourself | ||
#ifndef _____LP64_____ | ||
uint32_t size=0; | ||
const struct mach_header* selfHeader=(const struct mach_header*)_dyld_get_image_header(i); | ||
char * data=getsectdatafromheader(selfHeader,"WTFJH","InspectiveC",&size); | ||
|
||
#elif | ||
uint64_t size=0; | ||
const struct mach_header_64* selfHeader=(const struct mach_header_64*)_dyld_get_image_header(i); | ||
char * data=getsectdatafromheader_64(selfHeader,"WTFJH","InspectiveC",&size); | ||
#endif | ||
data=ASLROffset+data;//Add ASLR Offset To Pointer And Fix Address | ||
NSData* SDData=[NSData dataWithBytes:data length:size]; | ||
NSString* randomPath=[NSString stringWithFormat:@"%@/Documents/%@",NSHomeDirectory(),RandomString()]; | ||
[SDData writeToFile:randomPath atomically:YES]; | ||
dlopen(randomPath.UTF8String,RTLD_NOW); | ||
//Inform Our Logger | ||
CallTracer *tracer = [[CallTracer alloc] initWithClass:@"WTFJH" andMethod:@"LoadThirdPartyTools"]; | ||
[tracer addArgFromPlistObject:@"dlopen" withKey:@"Type"]; | ||
[tracer addArgFromPlistObject:randomPath withKey:@"Path"]; | ||
[tracer addArgFromPlistObject:@"InspectiveC" withKey:@"ModuleName"]; | ||
[traceStorage saveTracedCall: tracer]; | ||
[tracer release]; | ||
//End | ||
|
||
[SDData release]; | ||
break; | ||
} | ||
|
||
|
||
|
||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
319 | ||
320 |