-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
only skip coretrust bypass if isPlatformVulnerableToExploitType retur…
…ns 0
- Loading branch information
Showing
1 changed file
with
9 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,19 @@ | ||
#include <substrate.h> | ||
#include <limits.h> | ||
#include <stdint.h> | ||
|
||
int apply_coretrust_bypass_hook(__unused char* binaryPath) { | ||
return 0; | ||
} | ||
|
||
void trollstorehelperInit(char* executablePath) { | ||
MSImageRef trollstorehelper = MSGetImageByName(executablePath); | ||
void* apply_coretrust_bypass = MSFindSymbol(trollstorehelper, "_apply_coretrust_bypass"); | ||
if (apply_coretrust_bypass) { | ||
MSHookFunction(apply_coretrust_bypass, apply_coretrust_bypass_hook, NULL); | ||
bool (*isPlatformVulnerableToExploitType)(uint32_t) = MSFindSymbol(trollstorehelper, "_isPlatformVulnerableToExploitType"); | ||
|
||
if (isPlatformVulnerableToExploitType && apply_coretrust_bypass) { | ||
if (!isPlatformVulnerableToExploitType(UINT32_MAX)) { | ||
MSHookFunction(apply_coretrust_bypass, apply_coretrust_bypass_hook, NULL); | ||
} | ||
} | ||
} |