This commit is contained in:
opa334 2022-09-04 03:04:09 +02:00
parent b85398e4fa
commit 5bb621c4fe
6 changed files with 51 additions and 44 deletions

View File

@ -1,6 +1,6 @@
Package: com.opa334.trollstoreroothelper Package: com.opa334.trollstoreroothelper
Name: trollstoreroothelper Name: trollstoreroothelper
Version: 1.0.3 Version: 1.0.4
Architecture: iphoneos-arm Architecture: iphoneos-arm
Description: An awesome tool of some sort!! Description: An awesome tool of some sort!!
Maintainer: opa334 Maintainer: opa334

View File

@ -230,6 +230,9 @@ NSDictionary* dumpEntitlements(NSString* binaryPath)
struct mach_header_universal header; struct mach_header_universal header;
fread(&header,sizeof(header),1,machoFile); fread(&header,sizeof(header),1,machoFile);
uint32_t archOffset = 0;
// Get arch offset if FAT binary
if(header.magic == FAT_MAGIC || header.magic == FAT_CIGAM) if(header.magic == FAT_MAGIC || header.magic == FAT_CIGAM)
{ {
fseek(machoFile,0,SEEK_SET); fseek(machoFile,0,SEEK_SET);
@ -250,14 +253,19 @@ NSDictionary* dumpEntitlements(NSString* binaryPath)
continue; continue;
} }
fseek(machoFile,s32(fatArch.offset, swpFat),SEEK_SET); archOffset = s32(fatArch.offset, swpFat);
struct mach_header_universal header; break;
}
}
fseek(machoFile,archOffset,SEEK_SET);
fread(&header,sizeof(header),1,machoFile); fread(&header,sizeof(header),1,machoFile);
if(header.magic == MH_MAGIC_UNIVERSAL || header.magic == MH_CIGAM_UNIVERSAL)
{
BOOL swp = header.magic == MH_CIGAM_UNIVERSAL; BOOL swp = header.magic == MH_CIGAM_UNIVERSAL;
// This code is cursed, don't stare at it too long or it will stare back at you // This code is cursed, don't stare at it too long or it will stare back at you
uint32_t offset = s32(fatArch.offset, swpFat) + sizeof(header); uint32_t offset = archOffset + sizeof(header);
for(int c = 0; c < s32(header.ncmds, swp); c++) for(int c = 0; c < s32(header.ncmds, swp); c++)
{ {
fseek(machoFile,offset,SEEK_SET); fseek(machoFile,offset,SEEK_SET);
@ -269,11 +277,11 @@ NSDictionary* dumpEntitlements(NSString* binaryPath)
struct linkedit_data_command codeSignCommand; struct linkedit_data_command codeSignCommand;
fseek(machoFile,offset,SEEK_SET); fseek(machoFile,offset,SEEK_SET);
fread(&codeSignCommand,sizeof(codeSignCommand),1,machoFile); fread(&codeSignCommand,sizeof(codeSignCommand),1,machoFile);
uint32_t codeSignCmdOffset = s32(fatArch.offset, swpFat) + s32(codeSignCommand.dataoff, swp); uint32_t codeSignCmdOffset = archOffset + s32(codeSignCommand.dataoff, swp);
fseek(machoFile, codeSignCmdOffset, SEEK_SET); fseek(machoFile, codeSignCmdOffset, SEEK_SET);
struct CSSuperBlob superBlob; struct CSSuperBlob superBlob;
fread(&superBlob, sizeof(superBlob), 1, machoFile); fread(&superBlob, sizeof(superBlob), 1, machoFile);
if(SWAP32(superBlob.magic) == CS_MAGIC_EMBEDDED_SIGNATURE) if(SWAP32(superBlob.magic) == CS_MAGIC_EMBEDDED_SIGNATURE) // YES starting here everything is swapped no matter if CIGAM or MAGIC...
{ {
uint32_t itemCount = SWAP32(superBlob.count); uint32_t itemCount = SWAP32(superBlob.count);
for(int i = 0; i < itemCount; i++) for(int i = 0; i < itemCount; i++)
@ -302,7 +310,6 @@ NSDictionary* dumpEntitlements(NSString* binaryPath)
offset += cmd.cmdsize; offset += cmd.cmdsize;
} }
} }
}
fclose(machoFile); fclose(machoFile);

View File

@ -52,7 +52,7 @@
<string>iPhoneOS</string> <string>iPhoneOS</string>
</array> </array>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.0.3</string> <string>1.0.4</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>UIDeviceFamily</key> <key>UIDeviceFamily</key>

View File

@ -1,6 +1,6 @@
Package: com.opa334.trollstorehelper Package: com.opa334.trollstorehelper
Name: TrollStore Helper Name: TrollStore Helper
Version: 1.0.3 Version: 1.0.4
Architecture: iphoneos-arm Architecture: iphoneos-arm
Description: Helper app to install and manage TrollStore! Description: Helper app to install and manage TrollStore!
Maintainer: opa334 Maintainer: opa334

View File

@ -50,7 +50,7 @@
<string>iPhoneOS</string> <string>iPhoneOS</string>
</array> </array>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.0.3</string> <string>1.0.4</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>UIDeviceFamily</key> <key>UIDeviceFamily</key>

View File

@ -1,6 +1,6 @@
Package: com.opa334.trollstore Package: com.opa334.trollstore
Name: TrollStore Name: TrollStore
Version: 1.0.3 Version: 1.0.4
Architecture: iphoneos-arm Architecture: iphoneos-arm
Description: An awesome application! Description: An awesome application!
Maintainer: opa334 Maintainer: opa334