Skip to content

Commit

Permalink
only skip coretrust bypass if isPlatformVulnerableToExploitType retur…
Browse files Browse the repository at this point in the history
…ns 0
  • Loading branch information
asdfugil committed Jul 21, 2024
1 parent d747920 commit ee920f1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/universalhooks/trollstorehelper.c
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);
}
}
}

0 comments on commit ee920f1

Please sign in to comment.