Release SCETOOL source converted for Windows

jo3tomas

Active member
Developer
seems to not working, like you said becouse i can't do anything

get info - tool crash
decrypt - tool crash
 

Rip Cord

Administrator
Staff member
Developer
no scetool won't work on that at all. You have to use readself or readself 2 and unself.
The file you uploaded, audiof_original.elf is zero filled at 12A70 and 12FC4. Here is a file with those parts. You can see the difference in dissembly or hexeditor. I will take at look at what scetool is doing to the self as soon as I have a chance.
 

Attachments

  • audiof_u.zip
    54.1 KB · Views: 3

Rip Cord

Administrator
Staff member
Developer
here is the audiof.self re-encrypted for 3.55
Let me know if it works or not; there are a couple of others things I could try patching.
 

Attachments

  • audiof_355.zip
    77.8 KB · Views: 9

jo3tomas

Active member
Developer
could you resign audiof.self again, but with keys 3.60+ becouse i'm on CFW 4.30 now

if you have time resign this spu self files too for 3.60+ (npdrm spu self from far cry classic psn):
Code:
http://www8.zippyshare.com/v/21874424/file.html

i have these two games so i can check

regards
 

Rip Cord

Administrator
Staff member
Developer
Oh, so you can't test the audio.self now. Okay, but just so you know it's not strictly compliant with self requirements. I don't know which checks are patched in cfw for game files.

Which key revision should the selfs be signed with?
 

Rip Cord

Administrator
Staff member
Developer
here is audiof.self using key revision 10 for 3.60. if that's the wrong one let me know. I would appreciate if you could test it. It could be a waste of your time since the remaining checks may not be patched out in cfw.

This is very interesting, but I am an unlikely helper without any experience playing games with resigned files.
 

Attachments

  • audiof_360.zip
    77.8 KB · Views: 5

Rip Cord

Administrator
Staff member
Developer
re-uploaded the source for scetool; fixed links in the first post. Thanks for the heads up about the dead links.
 

jo3tomas

Active member
Developer
hi

sorry it took so long.

i tested self from post above 3.60 (audiof_360) and game working fine on rogero 4.30
i tested self 3.55 (audiof_355) and game working fine too on rogero 4.30

could you resign these spu self files from psn far cry classic to 3.60
Code:
http://www8.zippyshare.com/v/21874424/file.html

regards
 

Rip Cord

Administrator
Staff member
Developer
jo3thomas, if you have more of the same type of self that are non npdrm, could you try resigning them with this command line app.

command: reself game.self resigned.self 360

where 360 is the firmware version for the resigned self or put the firmware version you want to use.

adapted from self_rebuilder
It uses the keys files like fail overflow ps3 tools.
It will look in userprofile\.ps3 or userprofile\ps3keys or, as stormshadow reminded me, if you have the environment variable for ps3keys set, then it will look in that folder.
It is only for this type of extra game self.
not for npdrm self.
It was compiled with mgw, so I include the 2 msys dll's it needs, in case anyone doesn't have those.

About the error messages:
1. it scans the key folder and reports the incomplete key sets.
for example if there is in the key folder app-ctype-374, app-key-374, app-iv-374, and app-pub-374 but no app-priv-374, it will say something like <ERROR> no app-priv-374. This error can be ignored if you are not signing with the 374 private keys. This message is part of original the failoverflow code in the tools file that the app is linked with and can be removed if necessary.

2. after it signs the self, it checks the signature of the header to make sure it is correct. there should be a message saying STATUS: OK
that's when resigning the self to firmware 3.55 or below.
when signing a self to higher version firmwares it will report STATUS: Fail
the message can be ignored in that case for using with cfw

I am still looking at those npdrm files you asked about.
Thanks.

UPDATE: there is a newer version of reself in this thread:
http://techbliss.org/threads/resign-game-spu-selfs-with-reself.511/
 

Attachments

  • reself.zip
    479.2 KB · Views: 9

jo3tomas

Active member
Developer
keys load only from userprofile\ps3keys, not working from .ps3, later i will try to find more spu self

regards
 

Rip Cord

Administrator
Staff member
Developer
yea, I have both .ps3 and ps3keys, and it loads them from ps3keys. If y0u don't have any more games with spu self, would you consider resigning the original audiof.self with the reself tool and trying it? But don't do it if it might mess up your game progress or whatever. The self signed with reself checks out ok, but I don't have that type of game to test.

Thanks.
 

Rip Cord

Administrator
Staff member
Developer
oh, maybe I should mention that the 2 audiof.self that I uploaded (3.55 and 3.60) which you tested and worked ok--I resigned those 2 manually with openssl. Reself makes the self more compliant.
 

jo3tomas

Active member
Developer
i check audiof.self resigned by reself tommorow, becouse today i have work to do. i have 120-130 games so probably i should find more spu self

oh, maybe I should mention that the 2 audiof.self that I uploaded (3.55 and 3.60) which you tested and worked ok--I resigned those 2 manually with openssl. That app does one more step to make the self more compliant.

i tested both 3.55 and 3.60 and both working fine on CFW 4.30

regards
 

Rip Cord

Administrator
Staff member
Developer
I don't have npdrm private keys for 360. Here are the 2 far cry files signed for 355. If I find the 360 private keys, I will resign for 360.
 

Attachments

  • fc355.zip
    106.3 KB · Views: 4

Rip Cord

Administrator
Staff member
Developer
not sure about this 360 key, but here are far cry spu files resigned for 360 if you want to give it a shot.
 

Attachments

  • fc360.zip
    106.3 KB · Views: 6

Rip Cord

Administrator
Staff member
Developer
here's the source code for scetool converted to compile with visual c++ and including some minor updates to scetool. this uses native c++ only (compiled exe does NOT require .NET framework, cygwin.dll's, mingw.dll's or zlib.dll.
includes:

1. fixed print out of meta info keys. the meta info keys are used to encrypt/decrypt the self metadata. official scetool displays the meta info keys after they have been incremented. The original keys are needed by anyone who wants to use the same meta info keys as the original self to encrypt the meta data. Use of the incremented keys would not give the same result.
in sce.cpp add 2 global variables for the key and iv after the includes:
C:
static u8 mik_key[0x10];
static u8 mik_iv[0x10];
and after this line (approx line #842):
C:
aes_crypt_cbc(&aes_ctxt, AES_DECRYPT, sizeof(metadata_info_t), iv, (u8 *)ctxt->metai, (u8 *)ctxt->metai);
add :
C:
		memcpy(mik_key, (u8 *)ctxt->metai->key, 0x10);
		memcpy(mik_iv, (u8 *)ctxt->metai->iv, 0x10);
and in _print_metadata_info change:
C:
	_hexdump(fp, " Key", 0, mi->key, METADATA_INFO_KEY_LEN, FALSE);
	_hexdump(fp, " IV ", 0, mi->iv, METADATA_INFO_IV_LEN, FALSE);
to:
C:
	_hexdump(fp, " Key", 0, mik_key, METADATA_INFO_KEY_LEN, FALSE);
	_hexdump(fp, " IV ", 0, mik_iv, METADATA_INFO_IV_LEN, FALSE);
2. added firmware version written to self header for disc games (not only NPDRM) in self.cpp:
C:
		if(self_type == SELF_TYPE_NPDRM)
			cid->fw_version = sce_hexver_to_decver(sconf->fw_version);
		else
			cid->fw_version = 0;
to:
C:
		if(self_type == SELF_TYPE_NPDRM)
			cid->fw_version = sce_hexver_to_decver(sconf->fw_version);
		else if(self_type == SELF_TYPE_APP)
			cid->fw_version = sce_hexver_to_decver(sconf->fw_version);
		else
			cid->fw_version = 0;

3. switch build from public to private to skip placement of watermarks in resigned files
in config.h uncomment line 13:
C:
/*! Private build. */
//#define CONFIG_PRIVATE_BUILD
#define BUILD_FOR "naehrwert"
to:
C:
/*! Private build. */
#define CONFIG_PRIVATE_BUILD
//#define BUILD_FOR "naehrwert"
and line 22:
C:
/*! scetool version. */
#ifdef CONFIG_PRIVATE_BUILD
	#ifdef BUILD_FOR
		#define SCETOOL_VERSION SCETOOL_VERSION_BASE " <PRIVATE BUILD:" BUILD_FOR ">"
	#else
		#error Specify a name in BUILD_FOR.
to something like:
C:
/*! scetool version. */
#ifdef CONFIG_PRIVATE_BUILD
	#ifdef BUILD_FOR
		#define SCETOOL_VERSION SCETOOL_VERSION_BASE " <PRIVATE BUILD:" BUILD_FOR ">"
	#else
		//#error Specify a name in BUILD_FOR.
		#define SCETOOL_VERSION SCETOOL_VERSION_BASE " <Public Private Build>"

4. custom versions should display a separate version number in addition to the official version build number that they are based on (2.9). main.cpp line 147:
C:
static void print_version()
{
	printf("scetool " SCETOOL_VERSION " (C) 2011-2013 by naehrwert\n");
	printf("NP local license handling (C) 2012 by flatz\n");
	//printf("[Build Date/Time: %s/%s]\n", __DATE__, __TIME__);
}
to something like:
C:
static void print_version()
{
	printf("\nFUNCTION: print_version\n");
	printf("scetool " SCETOOL_VERSION " (C) 2011-2013 by naehrwert\n");
	printf("NP local license handling (C) 2012 by flatz\n");
	printf("minor update 0.0.1 <Public Build> 2014 by someone\n");
	//printf("[Build Date/Time: %s/%s]\n", __DATE__, __TIME__);
}
 

Attachments

  • scetool_with_updates.zip
    307.7 KB · Views: 20
Last edited by a moderator:

Rip Cord

Administrator
Staff member
Developer
that source code also has added to types.h: #pragma warning(disable : 4996)
to get rid of all those compile warnings about fopen, etc. being unsafe

jo3tomas pointed out that the default capablility flags for disc self should be 3B, not 7B, and unknown 7 should be 0x40000, not 0x20000; this can be changed in self.cpp about line 780

for the Release version make sure these configuration options are set:
for portability of the compiled exe in Project-> properties-> C++-> Code Generation-> Runtime Libary should be set to Multithreaded (instead of Multithreaded dll)
and Project-> Properties-> Linker-> Debugging-> Generate Debug Info
set to No
 
Last edited by a moderator:
Top