|
|
#271 | |
|
Apprentice
![]() Join Date: Nov 2011
Posts: 28
Likes: 2
Liked 34 Times in 16 Posts
Mentioned: 23 Post(s)
Tagged: 0 Thread(s)
|
Here is the code if you are interested, I am sure it could be optimized more, but I just knocked it up very quickly. Code:
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <conio.h>
#include <time.h>
#include "windows.h"
//#define FALSE (1 == 0)
//#define TRUE (!FALSE)
#define KEY_LENGTH 16
static int hexKey(char *hexString, const unsigned char *key)
{
int i;
int ok = FALSE;
for (i = 0; i < KEY_LENGTH; i++)
{
if (*key != 0)
{
ok = TRUE;
}
sprintf(hexString, "%02x", *key++);
hexString +=2;
}
return ok;
}
int main(int argc, char* argv[])
{
char *pElfFilename;
char *pSelfFilename;
char elfTestFilename[512];
unsigned char keystr[(KEY_LENGTH * 2) + 1] ="01020304050607080910111213141516";
char command[1024];
FILE *pElfFile;
char * buffer;
int found = FALSE;
size_t startOffset = 0;
size_t endOffset;
size_t i = 0;
size_t fileLength;
size_t length;
HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE);
time_t startTime;
double diff;
double rate = 10;
int display;
int remaining;
COORD coord;
coord.X = 0;
coord.Y = 0;
if (argc >= 3 && argc <= 5)
{
pElfFilename = argv[1];
pSelfFilename = argv[2];
if (argc >= 4)
{
startOffset = atol(argv[3]);
}
sprintf(elfTestFilename, "%s.elf", pSelfFilename);
pElfFile = fopen(pElfFilename, "rb");
if (pElfFile == NULL)
{
exit(0);
}
fseek(pElfFile, 0L, SEEK_END);
fileLength = ftell(pElfFile);
fseek(pElfFile, startOffset, SEEK_SET);
if (argc == 5)
{
endOffset = atol(argv[4]);
if (endOffset > fileLength - 1)
{
printf("End offset to large\n");
exit(0);
}
}
else
{
endOffset = fileLength - 1;
}
length = endOffset - startOffset;
buffer = (char*)malloc(length);
if (buffer == NULL)
{
printf("Can not allocate %d: try smaller chunk\n", length);
exit(0);
}
if (fread(buffer, 1, length, pElfFile) != length)
{
printf("Read failed\n");
fclose(pElfFile);
exit(0);
}
fclose(pElfFile);
if (length < KEY_LENGTH)
{
printf("Search range too small\n");
exit(0);
}
length -= KEY_LENGTH;
startTime = time(0);
system("cls");
for (i = 0; !found && i < length; i++)
{
/* 0.5 second updates */
if (((int)rate) < 2 || (i % (((int)rate) / 2)) == 0)
{
display = TRUE;
}
else
{
display = FALSE;
}
if (display)
{
SetConsoleCursorPosition(h, coord);
diff = difftime(time(0), startTime);
rate = i / diff;
if (rate == 0)
{
rate = 1;
}
remaining = (int)((length - i) / rate);
}
if (hexKey(keystr, buffer + i))
{
if (display)
{
printf("%03.03f %02d:%02d:%02d %06x: %02d%%: %s \n", rate, remaining / 3600, (remaining % 3600) / 60, remaining % 60, startOffset + i, (i * 100) / length, keystr);
sprintf(command, "scetool -l %s -d %s %s", keystr, pSelfFilename, elfTestFilename);
}
else
{
sprintf(command, "scetool -l %s -d %s %s > nul", keystr, pSelfFilename, elfTestFilename);
}
if (system(command) != 0)
{
printf("ERROR at offset 0x%x in %s: key:%s \n", startOffset + i, pElfFilename, keystr);
system("pause");
system("cls");
}
if (fopen(elfTestFilename, "rb") != NULL)
{
printf("Found it at offset 0x%x in %s: key:%s \n", startOffset + i, pElfFilename, keystr);
found = TRUE;
}
}
else
{
if (display)
{
printf("%03.03f %02d:%02d:%02d %06x: %02d%%: Skip\n", rate, remaining / 3600, (remaining % 3600) / 60, remaining % 60, startOffset + i, (i * 100) / length);
}
i+=7;
}
}
if (!found)
{
printf("Not Found it between 0x%x and 0x%x in %s\n", startOffset, endOffset, pElfFilename);
}
}
else
{
printf("brute elfFile selfFile optionalStartOffset optionalEndOffset\n");
}
free(buffer);
system("pause");
return 0;
}
Last edited by oakhead69; 08-12-2012 at 02:23 PM. |
|
|
|
|
|
Likes: (1) |
|
|
#272 |
|
Member
![]() Join Date: Sep 2010
Posts: 31
Likes: 15
Liked 3 Times in 3 Posts
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
|
how do we encrypt elf with the same klic we decrypted?
i saw that this method was used from EXEtrimALL. EDIT: nevermind i found it :P --np-klicensee= Last edited by christos; 08-12-2012 at 05:11 AM. |
|
|
|
|
|
#273 |
|
Apprentice
Join Date: Aug 2012
Posts: 9
Likes: 0
Liked 1 Time in 1 Post
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
|
This one I use to Encrypt the .self files? Can you show me a script for it?
|
|
|
|
|
|
#274 |
|
Homebrew Developer
![]() Join Date: Sep 2010
Location: Puerto Rico, U.S.
Posts: 906
Likes: 1,066
Liked 2,021 Times in 512 Posts
Mentioned: 347 Post(s)
Tagged: 0 Thread(s)
|
Just for reference to those who are experimenting, here is my personal CMD / BAT / Script file to decrypt and fix Call of Duty Modern Warfare 3 (BLES-01428)
Usage: Save this file as "decrypt_360_fix_341_EP0002-BLES01428.cmd" into the root of SceTool directory (im using SceTool v0.2.8 with the latest "data" / keys / etc). This could be easily modified for other games as well, I have many scripts for personal use already . I just don't have a PS3 to test them right now LOL xDEDIT: I've attached SceTool v0.2.8 + script. ![]() Note 1: This was not ripped from any other place, this is my own 'test' script. Note 2: I know this file can be much simpler, but I was lazy when I did it xD. Note 3: The "SELF_KEY" (klic) was obtained by using @aldostools brute-force application, it is not explained here to keep the post simple. Code:
@Echo OFF ECHO ----------------------------------------------- ECHO CALL OF DUTY: MODERN WARFARE 3 (BLES01428) ECHO ----------------------------------------------- ECHO BATCH BY: CaptainCPS-X ECHO . PAUSE ECHO . :: ------------------------------------------------- :: PREPARE MAIN VARIABLES :: ------------------------------------------------- SET DIR_NAME="EP0002-BLES01428" SET CONTENT_ID="EP0002-BLES01428_00-MW3P000000000010" SET SELF_KEY=496E66696E697479576172644B657900 :: ------------------------------------------------- :: VERIFY REQUIRED FILES :: ------------------------------------------------- IF NOT EXIST "EBOOT.BIN" ( GOTO ERROR_NO_F ) IF NOT EXIST "default.self" ( GOTO ERROR_NO_F ) IF NOT EXIST "default_mp.self" ( GOTO ERROR_NO_F ) :: ------------------------------------------------- :: PREPARE OUTPUT DIRECTORIES :: ------------------------------------------------- IF NOT EXIST "EBOOTS" ( MD "EBOOTS" MD "EBOOTS/%DIR_NAME%" MD "EBOOTS/%DIR_NAME%/DECRYPTED" MD "EBOOTS/%DIR_NAME%/FIXED" ) IF NOT EXIST "EBOOTS/%DIR_NAME%" ( MD "EBOOTS/%DIR_NAME%" MD "EBOOTS/%DIR_NAME%/DECRYPTED" MD "EBOOTS/%DIR_NAME%/FIXED" ) IF NOT EXIST "EBOOTS/%DIR_NAME%/DECRYPTED" ( MD "EBOOTS/%DIR_NAME%/DECRYPTED" ) IF NOT EXIST "EBOOTS/%DIR_NAME%/FIXED" ( MD "EBOOTS/%DIR_NAME%/FIXED" ) :: ------------------------------------------------- :: EBOOT.BIN :: ------------------------------------------------- SET ENC_EBOOT="EBOOT.BIN" SET DEC_EBOOT="EBOOTS/%DIR_NAME%/DECRYPTED/EBOOT.ELF" SET FIX_EBOOT="EBOOTS/%DIR_NAME%/FIXED/EBOOT.BIN" ECHO ----------------------------------------------- ECHO Decrypting [EBOOT.BIN]... ECHO ----------------------------------------------- ECHO . scetool.exe --verbose --decrypt %ENC_EBOOT% %DEC_EBOOT% ECHO . ECHO ----------------------------------------------- ECHO Fixing [EBOOT.BIN]... ECHO ----------------------------------------------- ECHO . scetool.exe --sce-type=SELF --compress-data=FALSE --skip-sections=TRUE --key-revision=0001 --self-auth-id=1010000001000003 --self-vendor-id=01000002 --self-type=NPDRM --self-fw-version=0003004100000000 --np-license-type=FREE --np-content-id=%CONTENT_ID% --np-app-type=EXEC --np-real-fname=EBOOT.BIN --encrypt %DEC_EBOOT% %FIX_EBOOT% ECHO . :: ------------------------------------------------- :: default.self :: ------------------------------------------------- SET ENC_SELF="default.self" SET DEC_SELF="EBOOTS/%DIR_NAME%/DECRYPTED/default.elf" SET FIX_SELF="EBOOTS/%DIR_NAME%/FIXED/default.self" SET SELF_NAME=default.self ECHO ----------------------------------------------- ECHO Decrypting [%SELF_NAME%]... ECHO ----------------------------------------------- ECHO . scetool.exe --verbose --np-klicensee %SELF_KEY% --decrypt %ENC_SELF% %DEC_SELF% ECHO . ECHO ----------------------------------------------- ECHO Fixing [%SELF_NAME%]... ECHO ----------------------------------------------- ECHO . scetool.exe --sce-type=SELF --compress-data=FALSE --skip-sections=TRUE --key-revision=0001 --self-auth-id=1010000001000003 --self-vendor-id=01000002 --self-type=NPDRM --self-fw-version=0003004100000000 --np-license-type=FREE --np-content-id=%CONTENT_ID% --np-app-type=EXEC --np-real-fname=%SELF_NAME% --encrypt %DEC_SELF% %FIX_SELF% ECHO . :: ------------------------------------------------- :: default_mp.self :: ------------------------------------------------- SET ENC_SELF="default_mp.self" SET DEC_SELF="EBOOTS/%DIR_NAME%/DECRYPTED/default_mp.elf" SET FIX_SELF="EBOOTS/%DIR_NAME%/FIXED/default_mp.self" SET SELF_NAME=default_mp.self ECHO ----------------------------------------------- ECHO Fixing [%SELF_NAME%]... ECHO ----------------------------------------------- ECHO . scetool.exe --verbose --np-klicensee %SELF_KEY% --decrypt %ENC_SELF% %DEC_SELF% ECHO . ECHO ----------------------------------------------- ECHO Fixing [%SELF_NAME%]... ECHO ----------------------------------------------- ECHO . scetool.exe --sce-type=SELF --compress-data=FALSE --skip-sections=TRUE --key-revision=0001 --self-auth-id=1010000001000003 --self-vendor-id=01000002 --self-type=NPDRM --self-fw-version=0003004100000000 --np-license-type=FREE --np-content-id=%CONTENT_ID% --np-app-type=EXEC --np-real-fname=%SELF_NAME% --encrypt %DEC_SELF% %FIX_SELF% ECHO . explorer ".\EBOOTS\%DIR_NAME%\FIXED" PAUSE EXIT :ERROR_NO_F ECHO ----------------------------------------------- ECHO "Cannot find required file(s): [EBOOT.BIN], [default.self], and [default_mp.self]" ECHO ----------------------------------------------- ECHO . PAUSE EXIT Hope this helps some! ![]() EDIT: Here you have the script log when it is run... Code:
CALL OF DUTY: MODERN WARFARE 3 (BLES01428) ----------------------------------------------- BATCH BY: CaptainCPS-X . Press any key to continue . . . . ----------------------------------------------- Decrypting [EBOOT.BIN]... ----------------------------------------------- . scetool 0.2.8 <public build> (C) 2011-2012 by naehrwert NP local license handling (C) 2012 by flatz [ * ] Loaded keysets. [ * ] Loaded loader curves. [ * ] Loaded vsh curves. [ * ] Using keyset [appldr 0x0010 03.60] [ * ] Header decrypted. [ * ] Data decrypted. [ * ] ELF written to EBOOTS/EP0002-BLES01428/DECRYPTED/EBOOT.ELF. . ----------------------------------------------- Fixing [EBOOT.BIN]... ----------------------------------------------- . scetool 0.2.8 <public build> (C) 2011-2012 by naehrwert NP local license handling (C) 2012 by flatz [ * ] SELF built. [ * ] Data encrypted. [ * ] EBOOTS/EP0002-BLES01428/FIXED/EBOOT.BIN written. . ----------------------------------------------- Decrypting [default.self]... ----------------------------------------------- . scetool 0.2.8 <public build> (C) 2011-2012 by naehrwert NP local license handling (C) 2012 by flatz [ * ] Loaded keysets. [ * ] Loaded loader curves. [ * ] Loaded vsh curves. [ * ] Using keyset [appldr 0x0010 03.60] [ * ] Header decrypted. [ * ] Data decrypted. [ * ] ELF written to EBOOTS/EP0002-BLES01428/DECRYPTED/default.elf. . ----------------------------------------------- Fixing [default.self]... ----------------------------------------------- . scetool 0.2.8 <public build> (C) 2011-2012 by naehrwert NP local license handling (C) 2012 by flatz [ * ] SELF built. [ * ] Data encrypted. [ * ] EBOOTS/EP0002-BLES01428/FIXED/default.self written. . ----------------------------------------------- Fixing [default_mp.self]... ----------------------------------------------- . scetool 0.2.8 <public build> (C) 2011-2012 by naehrwert NP local license handling (C) 2012 by flatz [ * ] Loaded keysets. [ * ] Loaded loader curves. [ * ] Loaded vsh curves. [ * ] Using keyset [appldr 0x0010 03.60] [ * ] Header decrypted. [ * ] Data decrypted. [ * ] ELF written to EBOOTS/EP0002-BLES01428/DECRYPTED/default_mp.elf. . ----------------------------------------------- Fixing [default_mp.self]... ----------------------------------------------- . scetool 0.2.8 <public build> (C) 2011-2012 by naehrwert NP local license handling (C) 2012 by flatz [ * ] SELF built. [ * ] Data encrypted. [ * ] EBOOTS/EP0002-BLES01428/FIXED/default_mp.self written.
__________________
gamePKG / FB Alpha RL - [ https://github.com/CaptainCPS ]
FB ALPHA DEV TEAM - [ http://neosource.1emu.net ] [ http://www.barryharris.me.uk/ ] PS3 - [CECH-2501A][NOR][160GB HDD][REBUG CFW 4.41.2 LITE] Last edited by CaptainCPS-X; 08-12-2012 at 11:52 AM. |
|
|
|
|
Likes: (2) |
|
|
#275 | |
|
Apprentice
Join Date: Feb 2011
Posts: 1
Likes: 0
Liked 0 Times in 0 Posts
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
|
|
|
|
|
|
|
|
#276 |
|
Senior Member
![]() Join Date: Jul 2011
Location: Salford, UK
Posts: 1,263
Likes: 578
Liked 780 Times in 494 Posts
Mentioned: 166 Post(s)
Tagged: 0 Thread(s)
|
@Asure
,
The required version is stored in the "dev_hdd0/mms/db/metadata_db_hdd" file and can be edited post install along with the SFO. Once both are edited, restart the PS3 and then it should work. But I do agree that ANYONE making fixes should edit the SFO correctly. |
|
|
|
|
|
#277 |
|
Apprentice
![]() Join Date: Sep 2010
Posts: 16
Likes: 0
Liked 0 Times in 0 Posts
Mentioned: 2 Post(s)
Tagged: 0 Thread(s)
|
hi, here are batch scripts to simplify the cracking (resigning) of applications and npdrm applications, which include the support for cracking the klicense, or using the default klicense (for eboot), unpacking pkg, creating pkg and patching param.sfo :
http://www.ps3-infos.fr/forum/applic...ila-t3343.html |
|
|
|
|
|
#278 | |||
|
Senior Member
![]() Join Date: Sep 2010
Posts: 1,175
Likes: 603
Liked 625 Times in 376 Posts
Mentioned: 138 Post(s)
Tagged: 0 Thread(s)
|
CONFIRMED *WORKING* ON RESISTANCE 3 BLES PATCH 1.05.
http://www.mediafire.com/?bct9cc98kx8h75j Here's what I did... 1. Take your patch pkg, (latest version of patch to be installed) 2. Drag on top of "extract_pkg.bat" 3. A folder with extracted pkg will be created, get the eboot.bin and param.sfo from the extracted pkg folder and put in the Attila... folder 4. drag eboot.bin onto "eboot_self_sprx_decrypter_recrypter.bat" 5. drag param.sfo onto "patch_paramsfo.bat" 6. put fixed eboot.bin and param.sfo back where you copied them from in the created pkg folder from step 3. 7. drag the folder created in step 3. onto "create_pkg.bat" And here's a google translate of the steps on the site since my steps only work if your game DOESN'T have any sprx files that need sorting out....
I had to do some extra bits as the SFO fixer wasn't working rename your PARAM.SFO to tempparam.sfo and change the "patch_paramsfo.bat" to the following...
...Maybe you won't need to do that, try it out first. ************* [ - Post Merged - ] ************* Does anyone know if it's possible to keep the game rip clean though? Like Portal 2 for example, the update has some sprx files that need decrypting but not all that are in main game are in update so I assume the ones from the game folder are still used therefore need decrypting too. This will make the rip not clean. Is there a way to incorporate the sprx from the game and put them in the update along with the updated ones? Will the game automatically use them if I just package them in with the game update (unlikely I know, not sure how things work in that way). Cheers. Last edited by baargle; 08-12-2012 at 08:18 PM. |
|||
|
|
|
|
Likes: (1) |
|
|
#279 |
|
Apprentice
![]() Join Date: Nov 2010
Posts: 18
Likes: 0
Liked 2 Times in 2 Posts
Mentioned: 1 Post(s)
Tagged: 0 Thread(s)
|
Thankyou baargle, lolilolz, JonahUK, Otkon and CaptainCPS-X. There is a lot of useful info there. (CaptainCPS-X did you miss the step of patching sys_proc_param before you re-encrypt your .selfs?)
I am messing about in my spare time with the 105 patch for SOCOM 4. I've managed to get the eboot, self and sprx fixed now (although i did it by converting the self and sprx to retail, but that is another story). Unfortunately the update also contains an .sdat file (tpps.sparc.sdat). I've just started doing some research on this file. Seems it is an psarc archive that is signed with a static key. Anyone have info on decrypting/encrypting it? Without modifying the .sdat or its contents there is still a version check not fixed. I'm pretty sure it is in the .sdat file. To test I replaced the .sdat with one from an earlier 3.50 patch v1.01 and it viola worked! Version check gone. I'm certain there are other patches out there that have .sdats so any info would be a big help. Thanks
|
|
|
|
|
|
#280 | |
|
Homebrew Developer
![]() Join Date: Sep 2010
Location: Puerto Rico, U.S.
Posts: 906
Likes: 1,066
Liked 2,021 Times in 512 Posts
Mentioned: 347 Post(s)
Tagged: 0 Thread(s)
|
. Until I get my hands on my E3 Flasher to downgrade my slim I cant start experimenting with original game backups, so probably somewhere around this week I will be able to mess around with some new patches of my own =P.SeeYa!
__________________
gamePKG / FB Alpha RL - [ https://github.com/CaptainCPS ]
FB ALPHA DEV TEAM - [ http://neosource.1emu.net ] [ http://www.barryharris.me.uk/ ] PS3 - [CECH-2501A][NOR][160GB HDD][REBUG CFW 4.41.2 LITE] |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|