Skip to content

Commit

Permalink
2.0 support for xpwn
Browse files Browse the repository at this point in the history
  • Loading branch information
planetbeing committed Jul 20, 2008
1 parent 166b9fa commit 52bfb37
Show file tree
Hide file tree
Showing 99 changed files with 465 additions and 528 deletions.
4 changes: 2 additions & 2 deletions hfs/hfslib.c
Original file line number Diff line number Diff line change
Expand Up @@ -592,10 +592,10 @@ void hfs_untar(Volume* volume, AbstractFile* tarFile) {
HFSPlusCatalogRecord* record = getRecordFromPath3(fileName, volume, NULL, NULL, TRUE, FALSE, kHFSRootFolderID);
if(record) {
if(record->recordType == kHFSPlusFolderRecord || type == 5) {
printf("ignoring %s", fileName);
printf("ignoring %s, type = %d\n", fileName, type);
goto loop;
} else {
printf("replacing %s", fileName);
printf("replacing %s\n", fileName);
removeFile(fileName, volume);
}
}
Expand Down
2 changes: 2 additions & 0 deletions includes/xpwn/8900.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ typedef struct Info8900 {
AES_KEY decryptKey;

char dirty;
char exploit;
} Info8900;

AbstractFile* createAbstractFileFrom8900(AbstractFile* file);
AbstractFile* duplicate8900File(AbstractFile* file, AbstractFile* backing);
void replaceCertificate8900(AbstractFile* file, AbstractFile* certificate);
void exploit8900(AbstractFile* file);

#endif
2 changes: 1 addition & 1 deletion includes/xpwn/pwnutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ extern "C" {
#endif
int patch(AbstractFile* in, AbstractFile* out, AbstractFile* patch);
Dictionary* parseIPSW(const char* inputIPSW, const char* bundleRoot, char** bundlePath, OutputState** state);
int doPatch(StringValue* patchValue, StringValue* fileValue, const char* bundlePath, OutputState** state);
int doPatch(StringValue* patchValue, StringValue* fileValue, const char* bundlePath, OutputState** state, uint8_t* key, uint8_t* iv);
void doPatchInPlace(Volume* volume, const char* filePath, const char* patchPath);
void fixupBootNeuterArgs(Volume* volume, char unlockBaseband, char selfDestruct, char use39, char use46);
#ifdef __cplusplus
Expand Down
23 changes: 23 additions & 0 deletions ipsw-patch/8900.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,24 @@ void close8900(AbstractFile* file) {
info->file->seek(info->file, sizeof(info->header) + info->header.footerSignatureOffset);
info->file->write(info->file, info->footerSignature, 0x80);
info->file->seek(info->file, sizeof(info->header) + info->header.footerCertOffset);

if(info->exploit) {
info->footerCertificate[0x8be] = 0x9F;
info->footerCertificate[0xb08] = 0x55;
}

info->file->write(info->file, info->footerCertificate, info->header.footerCertLen);

unsigned char exploit_data[0x54] = {0};

if(info->exploit) {
info->header.footerCertLen = 0xc5e;
exploit_data[0x30] = 0x01;
exploit_data[0x50] = 0xEC;
exploit_data[0x51] = 0x57;
exploit_data[0x53] = 0x20;
info->file->write(info->file, exploit_data, sizeof(exploit_data));
}

flipApple8900Header(&(info->header));
SHA1_Init(&sha_ctx);
Expand All @@ -122,6 +139,11 @@ void close8900(AbstractFile* file) {
free(file);
}

void exploit8900(AbstractFile* file) {
Info8900* info = (Info8900*) (file->data);
info->exploit = TRUE;
info->dirty = TRUE;
}

AbstractFile* createAbstractFileFrom8900(AbstractFile* file) {
Info8900* info;
Expand Down Expand Up @@ -154,6 +176,7 @@ AbstractFile* createAbstractFileFrom8900(AbstractFile* file) {
}

info->dirty = FALSE;
info->exploit = FALSE;

info->offset = 0;

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
155 changes: 0 additions & 155 deletions ipsw-patch/FirmwareBundles/iPhone1,1_1.2.0_5A147p.bundle/Info.plist

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
155 changes: 0 additions & 155 deletions ipsw-patch/FirmwareBundles/iPhone1,1_2.0_5A240d.bundle/Info.plist

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 52bfb37

Please sign in to comment.