 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
GoatSucker
Joined: 08 May 2005 Posts: 6
|
Posted: Sun May 08, 2005 3:17 am Post subject: WipeOut Pure wad dump |
|
|
Hi All. I'm new to the PSPDev community, but I've been taking a look at the WipeOut Pure wad files, and hoepfully my observations may be of use.
All the WipeOut Pure data is held in .wad files, which are just a bunch of files concatenated without any compression / encryption (much like the original Doom .wad files of old!).
There are a few main .wad files containing the tracks, graphics and music, and a seperate .wad file for each of the ships.
What is interesting is that a lot of the data files are XML, which makes understanding them very easy. The ship .wad files each contain 3 other files, the first of which is an XML file containing the ship profile for each league.
The other two files also appear to be archive files, containing vector / texture data for the ship.
Each of the files in the .wad doesn't have a filename, but does have a 32-bit id. At first I thought this is a CRC, but it seems likely that it is instead a filename hash, kind of like a 32 bit MD5.
Anyway, the interesting things that might come out of this:
1. Since WipeOut Pure allows additional ships to be loaded from the memory card, it is possible that the other data files could be loaded also. That would open up scope for custom music (the existing ones are just ac3 files, as far as I can tell), custom textures and even custom tracks.
2. There is already an additional ship/track/theme downloadable data file available for the Japanese version, which has an encrypted .wad file. Since it is likely that the downloadable .wad and internal .wad files are the same format, it could be a way to work out how the downloadable .wad has been encrypted.
I'm happy to post the source to the dump tool if it's not against the rules of the forum. I won't provide dumps of any of the .wad files though, so don't ask!
Cheers,
GoatSucker |
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Sun May 08, 2005 3:47 am Post subject: |
|
|
| While we don't usually focus on modifying games here, its new enough in the PSP's life that this is interesting. Feel free to post the source to the tool. |
|
| Back to top |
|
 |
GoatSucker
Joined: 08 May 2005 Posts: 6
|
Posted: Sun May 08, 2005 6:46 am Post subject: |
|
|
Ok. Code is attached. BTW, I can confirm that the 32-bit id is a filename hash. There are several data files that appear in more than one .wad file with the same hash, which leads to the idea that any file could be patched from the memory stick.
It should be easy to understand the .wad file structure from the code below.
I'd be interested in any links that may help with being able to decrypt the downloadable .wad files, as this may help with being able to decrypt general memory stick files.
Anyway, enjoy.
| Code: |
// wpdump.cpp
//
#include "stdafx.h"
#include <stdlib.h>
struct fileInfo
{
int name;
int start;
int length;
int length2;
};
void DumpFile(char* aFile) {
printf("Dumping:");
printf(aFile);
printf("\n");
FILE* f = fopen(aFile, "r+b");
if (f == NULL) {
printf("Cannot open file\n");
return;
}
int value;
fread(&value, 4, 1, f);
printf("Version = %d\n", value);
int files;
fread(&files, 4, 1, f);
printf("Files = %d\n", files);
fileInfo* fiArray = (fileInfo*)malloc(files * sizeof fileInfo);
fileInfo* fiPtr = fiArray;
for (int i=0; i<files; i++)
{
fread(&(fiPtr->name), 4, 1, f);
fread(&(fiPtr->start), 4, 1, f);
fread(&(fiPtr->length), 4, 1, f);
fread(&(fiPtr->length2), 4, 1, f);
fiPtr++;
}
fiPtr = fiArray;
for (int j=0; j<files; j++)
{
printf("%03d / %03d : 0x%x : Size: %d ", j+1, files, fiPtr->name, fiPtr->length);
fseek(f, fiPtr->start, SEEK_SET);
char* buffer = (char*)malloc(fiPtr->length);
fread(buffer, fiPtr->length, 1, f);
int isXml = 0;
if (fiPtr->length > 5)
{
if (buffer[0] == '<' && buffer[1] == '?' && buffer[2] == 'x' && buffer[3] == 'm' && buffer[4] == 'l')
{
isXml = 1;
}
}
char name[256];
if (isXml) {
sprintf(name,"%03d.%x.xml", j+1, fiPtr->name);
}
else {
sprintf(name,"%03d.%x.dat", j+1, fiPtr->name);
}
printf("Writing:");
printf(name);
printf("\n");
FILE* out = fopen(name, "w+b");
if (out)
{
fwrite(buffer, fiPtr->length, 1, out);
fclose(out);
}
delete buffer;
fiPtr++;
}
delete fiArray;
fclose(f);
}
int main(int argc, char* argv[])
{
printf("WPDUMP [GoatSucker]\n");
if (argc != 2) {
printf("No file specified\n");
return 0;
}
DumpFile(argv[1]);
return 0;
}
|
|
|
| Back to top |
|
 |
annerajb
Joined: 31 Mar 2005 Posts: 40
|
Posted: Sun May 08, 2005 10:25 am Post subject: |
|
|
| wad files can be extracted using dragon unpacker. google it |
|
| Back to top |
|
 |
Herman
Joined: 05 Apr 2005 Posts: 13 Location: Montreal, Canada
|
Posted: Sun May 08, 2005 12:16 pm Post subject: |
|
|
| Dragon Unpacker doesn't work with these wad files. I also compared them to wad files from old Wipeout games and they're not the same type. |
|
| Back to top |
|
 |
ale275
Joined: 28 Dec 2004 Posts: 10
|
Posted: Sun May 08, 2005 6:14 pm Post subject: |
|
|
| anyone tried to (DO SOMETHING NAUGHTY) and see waht happens?? |
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Sun May 08, 2005 6:18 pm Post subject: |
|
|
| ale275: READ THE RULES! |
|
| Back to top |
|
 |
annerajb
Joined: 31 Mar 2005 Posts: 40
|
Posted: Sun May 08, 2005 8:30 pm Post subject: |
|
|
| use the hyper creator and click or file extensions inside the wad files appear png files and at3 files |
|
| Back to top |
|
 |
ale275
Joined: 28 Dec 2004 Posts: 10
|
Posted: Sun May 08, 2005 8:42 pm Post subject: |
|
|
| sorry ooPo :( i didn't wnat ot break rules :( |
|
| Back to top |
|
 |
kagaku
Joined: 09 May 2005 Posts: 2
|
Posted: Mon May 09, 2005 1:42 am Post subject: |
|
|
| You mentioned that the music files are in AC3 format, any chance of a tool to extract them? :) |
|
| Back to top |
|
 |
GoatSucker
Joined: 08 May 2005 Posts: 6
|
Posted: Mon May 09, 2005 2:01 am Post subject: |
|
|
| kagaku - The tool I posted will automatically extract all the files from the given .wad. It doesn't rename the files to ac3 yet, but that should be an easy mod. |
|
| Back to top |
|
 |
annerajb
Joined: 31 Mar 2005 Posts: 40
|
Posted: Mon May 09, 2005 3:13 am Post subject: |
|
|
| dragon unpacker hypercreator does extract them |
|
| Back to top |
|
 |
kagaku
Joined: 09 May 2005 Posts: 2
|
Posted: Mon May 09, 2005 6:42 am Post subject: |
|
|
| GoatSucker wrote: | | kagaku - The tool I posted will automatically extract all the files from the given .wad. It doesn't rename the files to ac3 yet, but that should be an easy mod. |
How do I compile it? I ran it through gcc, but it spit out an error.
| Code: | kagaku@tomiko psp $ make wpdump
g++ wpdump.cpp -o wpdump
wpdump.cpp:4:20: stdafx.h: No such file or directory
wpdump.cpp: In function `void DumpFile(char*)':
wpdump.cpp:17: error: `printf' undeclared (first use this function)
wpdump.cpp:17: error: (Each undeclared identifier is reported only once for
each function it appears in.)
wpdump.cpp:21: error: `FILE' undeclared (first use this function)
wpdump.cpp:21: error: `f' undeclared (first use this function)
wpdump.cpp:21: error: `fopen' undeclared (first use this function)
wpdump.cpp:28: error: `fread' undeclared (first use this function)
wpdump.cpp:34: error: parse error before `)' token
wpdump.cpp:53: error: `SEEK_SET' undeclared (first use this function)
wpdump.cpp:53: error: `fseek' undeclared (first use this function)
wpdump.cpp:67: error: `sprintf' undeclared (first use this function)
wpdump.cpp:77: error: `out' undeclared (first use this function)
wpdump.cpp:80: error: `fwrite' undeclared (first use this function)
wpdump.cpp:81: error: `fclose' undeclared (first use this function)
wpdump.cpp: In function `int main(int, char**)':
wpdump.cpp:96: error: `printf' undeclared (first use this function)
wpdump.cpp:103:2: warning: no newline at end of file
make: *** [wpdump] Error 1
kagaku@tomiko psp $ |
|
|
| Back to top |
|
 |
imk
Joined: 16 Apr 2005 Posts: 8
|
Posted: Mon May 09, 2005 8:42 am Post subject: |
|
|
| kagaku wrote: | | How do I compile it? I ran it through gcc, but it spit out an error. |
wpdump.cpp:4:20: stdafx.h: No such file or directory <-- you're missing stdafx.h |
|
| Back to top |
|
 |
Orion_
Joined: 27 Jan 2005 Posts: 69
|
Posted: Mon May 09, 2005 8:49 am Post subject: |
|
|
stdafx is a windows header
replace stdafx with stdio for FILE things |
|
| Back to top |
|
 |
allthatinny
Joined: 06 May 2005 Posts: 24
|
|
| Back to top |
|
 |
GoatSucker
Joined: 08 May 2005 Posts: 6
|
Posted: Mon May 09, 2005 9:42 pm Post subject: |
|
|
Sorry - should have said the code was for MSDev, but it should work on gcc by changing the header to stdio.h. Haven't verified that myself, though.
Didn't know about the existing tools, but thanks for pointing them out.
Now I just need a tool to make new encrypted wad's for the memory stick - any pointers? |
|
| Back to top |
|
 |
pixel
Joined: 30 Jan 2004 Posts: 791
|
Posted: Mon May 09, 2005 10:17 pm Post subject: |
|
|
| Orion_ wrote: | stdafx is a windows header
replace stdafx with stdio for FILE things | Wrong.... it's an automatic .h file generated by msvc for the project... _________________ pixel: A mischievous magical spirit associated with screen displays. The computer industry has frequently borrowed from mythology. Witness the sprites in computer graphics, the demons in artificial intelligence and the trolls in the marketing department. |
|
| Back to top |
|
 |
ale275
Joined: 28 Dec 2004 Posts: 10
|
Posted: Tue May 10, 2005 12:11 am Post subject: |
|
|
| if is needed i can attach wad_dump.exe complied by me under windows |
|
| Back to top |
|
 |
Awhite
Joined: 23 Feb 2005 Posts: 55
|
Posted: Tue May 10, 2005 1:31 am Post subject: |
|
|
That could be good, btw i used the extractor program and it extracted some .wav files at about 2.5mbs each. I renamed them into .ac3 but they won't work...any ideas? _________________ Ioannis KarAvas |
|
| Back to top |
|
 |
Herman
Joined: 05 Apr 2005 Posts: 13 Location: Montreal, Canada
|
Posted: Tue May 10, 2005 1:37 am Post subject: |
|
|
| I've been looking at them. Their codec type is 0xFFFF, which means it's something specific to Wipeout Pure, but the rest of the header seems to match the AT3 files that go along with saved games and whatnot. I tried patching the codec type to 0xFEFF (atrac3plus, same as the AT3 files) and then copying it over one of the SND0.AT3 files from a saved game, but it didn't work. |
|
| Back to top |
|
 |
CKemu
Joined: 09 May 2005 Posts: 1
|
Posted: Tue May 10, 2005 1:42 am Post subject: |
|
|
They may have the 'RIFF WAVEfmt' header, but the actual header info is completely weird.
Bits per sample is 0, so it won't render, and it has 34 bytes extra after the header.
Normally fffe means it is uncompressed, just has more than 2 channels or more than 16bits per sample, but in this case this means something else. - or thats what I am led to understand.
On a side note 'all' the 383KB files (146 in total) are *.TGA and can be openned in photoshop or any other 'art' application, some really nice images in that lot to :D
 |
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Tue May 10, 2005 1:59 am Post subject: |
|
|
This thread is slowing turning into game hacking rather than homebrew code development...
Please steer back on topic. |
|
| Back to top |
|
 |
GoatSucker
Joined: 08 May 2005 Posts: 6
|
Posted: Tue May 10, 2005 5:10 am Post subject: |
|
|
Ok - trying to steer this back, I've noticed that some of the files in the data.wad file are ELF binaries.
This leads to a couple of things that could help homebrew:
1. If a way can be found to patch .wad files from the memory stick (and this is certainly possible to an extent with the already available download - albeit in an encrypted form) then maybe the ELF files could be patched to run homebrew code instead. That is assuming that the ELF files in the data.wad are actually used, and not there by mistake.
2. The ELF files appear to be very similar to the .prx files, except they are unencrypted. There are lots of plaintext comments about MPEG, HTTP and crypto stuff. There loads of crypto stuff referenced in 197.dc55e1dd.elf, produced by the code below.
Anyway, hope this might be useful to someone. I've attached the latest code below. Note that the sysp, vex and sblk files are just attempts to name the files based on the contents - the contents are still unknown.
| Code: | // wpdump.cpp
//
#include "stdafx.h"
#include <stdlib.h>
#include <string.h>
struct fileInfo
{
int name;
int start;
int length;
int length2;
};
int isFileType(char* aBuffer, char* aID)
{
int length = strlen(aID);
int cnt = 0;
for (int i=0; i<length; i++) {
if (aBuffer[i] == aID[i]) {
cnt++;
}
}
if (cnt == length) {
return 1;
}
return 0;
}
void DumpFile(char* aFile) {
printf("Dumping:");
printf(aFile);
printf("\n");
FILE* f = fopen(aFile, "r+b");
if (f == NULL) {
printf("Cannot open file\n");
return;
}
int value;
fread(&value, 4, 1, f);
printf("Version = %d\n", value);
int files;
fread(&files, 4, 1, f);
printf("Files = %d\n", files);
fileInfo* fiArray = (fileInfo*)malloc(files * sizeof fileInfo);
fileInfo* fiPtr = fiArray;
for (int i=0; i<files; i++)
{
fread(&(fiPtr->name), 4, 1, f);
fread(&(fiPtr->start), 4, 1, f);
fread(&(fiPtr->length), 4, 1, f);
fread(&(fiPtr->length2), 4, 1, f);
fiPtr++;
}
fiPtr = fiArray;
for (int j=0; j<files; j++)
{
printf("%03d / %03d : 0x%x : Size: %d ", j+1, files, fiPtr->name, fiPtr->length);
fseek(f, fiPtr->start, SEEK_SET);
char* buffer = (char*)malloc(fiPtr->length);
fread(buffer, fiPtr->length, 1, f);
char ext[16];
if (isFileType(buffer, "<?xml")) {
strcpy(ext, "xml");
}
else if (isFileType(buffer+2, "<?xml")) {
strcpy(ext, "xml");
}
else if (isFileType(buffer+fiPtr->length-18, "TRUEVISION")) {
strcpy(ext, "tga");
}
else if (isFileType(buffer, "PSMF")) {
strcpy(ext, "pmf");
}
else if (isFileType(buffer, "RIFF")) {
strcpy(ext, "ac3");
}
else if (isFileType(buffer, "SYSP")) {
strcpy(ext, "sysp");
}
else if (isFileType(buffer+1, "ELF")) {
strcpy(ext, "elf");
}
else if (isFileType(buffer+12, "VEXX")) {
strcpy(ext, "vex");
}
else if (isFileType(buffer+24, "SBlk")) {
strcpy(ext, "sblk");
}
else {
strcpy(ext, "dat");
}
char name[256];
sprintf(name,"%03d.%x.%s", j+1, fiPtr->name, ext);
printf("Writing:");
printf(name);
printf("\n");
FILE* out = fopen(name, "w+b");
if (out)
{
fwrite(buffer, fiPtr->length, 1, out);
fclose(out);
}
delete buffer;
fiPtr++;
}
delete fiArray;
fclose(f);
}
int main(int argc, char* argv[])
{
printf("WPDUMP [GoatSucker]\n");
if (argc != 2) {
printf("No file specified\n");
return 0;
}
DumpFile(argv[1]);
return 0;
}
|
|
|
| Back to top |
|
 |
Herman
Joined: 05 Apr 2005 Posts: 13 Location: Montreal, Canada
|
Posted: Tue May 10, 2005 5:41 am Post subject: |
|
|
| The audio files seem to be AT3 (atrack3plus) files, not AC3. |
|
| Back to top |
|
 |
annerajb
Joined: 31 Mar 2005 Posts: 40
|
Posted: Tue May 10, 2005 6:52 am Post subject: |
|
|
| sorry for that |
|
| Back to top |
|
 |
GoatSucker
Joined: 08 May 2005 Posts: 6
|
Posted: Tue May 10, 2005 7:41 am Post subject: |
|
|
| Herman - Yes, I knew they were Atrac3 files. I thought the file extension for these was AC3, but I guess AT3 is correct. Doesn't matter, as they can't be used as is. |
|
| Back to top |
|
 |
mrbrown
Joined: 17 Jan 2004 Posts: 1536
|
Posted: Tue May 24, 2005 4:50 am Post subject: |
|
|
Just doing a simple `strings' on the ELF files show that they are the same modules found in the PRX directory.
My guess is that their wad building tool included their entire tree, and that the PRXs in the Data.wad are never touched. I'm a bit surprised that the source isn't in there too :P. |
|
| Back to top |
|
 |
Vampire
Joined: 12 Apr 2005 Posts: 138
|
Posted: Tue May 24, 2005 7:23 am Post subject: |
|
|
| mrbrown wrote: | | Just doing a simple `strings' on the ELF files show that they are the same modules found in the PRX directory. |
but there are two SceHttp_Library modules in Data.wad:
one is exactly the same as the libhttp_rfc.prx from the PRX directory
and the other is a diffrent, smaller one |
|
| Back to top |
|
 |
urchin
Joined: 02 Jun 2005 Posts: 121
|
Posted: Thu Sep 08, 2005 11:29 pm Post subject: |
|
|
Probably of no help at all, but I attended a lecture at GDCE by the lead programmer of wipeout pure...
He said that the the downloads were encrypted and I also remember that the "vexx" file you mentioned is the file that contains the track data. He demonstrated designing a simple track in Maya, exporting it using their custom plugin and then running it on a PSP emulator on his laptop. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|