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
Name: trollstoreroothelper
Version: 1.0.3
Version: 1.0.4
Architecture: iphoneos-arm
Description: An awesome tool of some sort!!
Maintainer: opa334

View File

@ -230,6 +230,9 @@ NSDictionary* dumpEntitlements(NSString* binaryPath)
struct mach_header_universal header;
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)
{
fseek(machoFile,0,SEEK_SET);
@ -250,14 +253,19 @@ NSDictionary* dumpEntitlements(NSString* binaryPath)
continue;
}
fseek(machoFile,s32(fatArch.offset, swpFat),SEEK_SET);
struct mach_header_universal header;
archOffset = s32(fatArch.offset, swpFat);
break;
}
}
fseek(machoFile,archOffset,SEEK_SET);
fread(&header,sizeof(header),1,machoFile);
if(header.magic == MH_MAGIC_UNIVERSAL || 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
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++)
{
fseek(machoFile,offset,SEEK_SET);
@ -269,11 +277,11 @@ NSDictionary* dumpEntitlements(NSString* binaryPath)
struct linkedit_data_command codeSignCommand;
fseek(machoFile,offset,SEEK_SET);
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);
struct CSSuperBlob superBlob;
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);
for(int i = 0; i < itemCount; i++)
@ -302,7 +310,6 @@ NSDictionary* dumpEntitlements(NSString* binaryPath)
offset += cmd.cmdsize;
}
}
}
fclose(machoFile);

View File

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

View File

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

View File

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

View File

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