POP1 Music extraction thread
byte number 7 is checksum, byte number 8 is 02 allways.
checksum works like that: the sum of all the bytes modulo 256 must be the same (Tammo Jan said this value was 0).
If the sum is not the same value as before, then you must change the checksum character to do that. The two bytes before MThd are header bytes too, so the first is the checksum of the next file and the second is allways 02.
checksum works like that: the sum of all the bytes modulo 256 must be the same (Tammo Jan said this value was 0).
If the sum is not the same value as before, then you must change the checksum character to do that. The two bytes before MThd are header bytes too, so the first is the checksum of the next file and the second is allways 02.
[quote]You are ignoring the first 8 bytes in the file, they are very important, and the validation is there.
The first 2 bytes are a dword value x
The second 2 bytes are allways 0
The third group of 2 bytes in a dword value y
where x+y=size of the file!!!![/quote]
I haven't seen it anywhere, but I think you all know this already:
x is the offset of the header
y is the length of the header
the header gives information about the filesize and offset of all the midis (and other filetypes) in the file and something else that I don't know yet.
At least, this goes for my PC version of Prince of Persia v1.3 (cheat parameter is improved in this version).
-- Frenkel
The first 2 bytes are a dword value x
The second 2 bytes are allways 0
The third group of 2 bytes in a dword value y
where x+y=size of the file!!!![/quote]
I haven't seen it anywhere, but I think you all know this already:
x is the offset of the header
y is the length of the header
the header gives information about the filesize and offset of all the midis (and other filetypes) in the file and something else that I don't know yet.
At least, this goes for my PC version of Prince of Persia v1.3 (cheat parameter is improved in this version).
-- Frenkel
I've discovered the whole sound (midi and wave) and graphics .dat file structure.
All Prince of Persia Dat files are indexed, even levels.dat.
I'll make an extractor for all the formats now I know how the index works.
XX XX is the offset of the index. YY YY is 8*a+2, where a is the number of files in the file. in the index there is AA AA that is the number a, the 8 bytes for each file, those bytes are: QQ QQ WW WW 00 00 EE EE, where QQ QQ is the id, WW WW is the file offset and EE EE is the file size. That explains the wasted bytes in PG, the problem with the headers in wave files and the deterministic bytes at the end of levels.dat.
All Prince of Persia Dat files are indexed, even levels.dat.
I'll make an extractor for all the formats now I know how the index works.
XX XX is the offset of the index. YY YY is 8*a+2, where a is the number of files in the file. in the index there is AA AA that is the number a, the 8 bytes for each file, those bytes are: QQ QQ WW WW 00 00 EE EE, where QQ QQ is the id, WW WW is the file offset and EE EE is the file size. That explains the wasted bytes in PG, the problem with the headers in wave files and the deterministic bytes at the end of levels.dat.
Ohhh sorry I didn't get what you tried to say
well, I need the mail explaining how to crack the digisnd, or the wav specifications digisnd is using, or at least a wav file extracted from the game (so I can see the wav spefications).
[quote]Oh, maybe I should have mentioned this earlier: I got a mail, stating how to crack the "digisnd.dat". It is at least readable as raw data (for example in coolplayer). It shouldn't be too hard to crack this one too [/quote]
Please resend this mail. The extractor goes very good, now it can read any pop1 dat file and determine whatever there is inside. Extracts bitmaps, palettes, midis, raw waves, levels, and lots of things we don't know yet what are they used for (game scripts suggested ChrML, and I hope he is right, but I'm afraid prince.exe was detected as an image file).
well, I need the mail explaining how to crack the digisnd, or the wav specifications digisnd is using, or at least a wav file extracted from the game (so I can see the wav spefications).
[quote]Oh, maybe I should have mentioned this earlier: I got a mail, stating how to crack the "digisnd.dat". It is at least readable as raw data (for example in coolplayer). It shouldn't be too hard to crack this one too [/quote]
Please resend this mail. The extractor goes very good, now it can read any pop1 dat file and determine whatever there is inside. Extracts bitmaps, palettes, midis, raw waves, levels, and lots of things we don't know yet what are they used for (game scripts suggested ChrML, and I hope he is right, but I'm afraid prince.exe was detected as an image file).
Well, PR (PG & PS) now extracts wav files, in wav format, so you can play prince of persia sounds in winamp! The same with midis.
But the best of all: The resource compiler works!!! My friend Pi (who helped in wav header figuring out) played a melody in his electronic organ and then exported it as midi, after that I compiled a new digisnd2.dat using PR with the new melody. And it worked!!!!
<a href="http://www.cnu.net.ar/~ecalot/princed/d ... 2.dat">See here the new midisnd2.dat we made</a>
[Editado el 9/6/2003 por poirot]
But the best of all: The resource compiler works!!! My friend Pi (who helped in wav header figuring out) played a melody in his electronic organ and then exported it as midi, after that I compiled a new digisnd2.dat using PR with the new melody. And it worked!!!!
<a href="http://www.cnu.net.ar/~ecalot/princed/d ... 2.dat">See here the new midisnd2.dat we made</a>
[Editado el 9/6/2003 por poirot]
Well... PS is 100% figured out, PR does extract and compress midi and wav, so let's move to the <a href=http://www.cnu.net.ar/modules.php?name= ... &tid=42>PR development & testing thread</a>.
[Editado el 13/6/2003 por poirot]
[Editado el 13/6/2003 por poirot]
[quote]I'm ChrML, only that I couldn't get logged into this forum.
Finally (after 30 min more researching) I got the midi files in MIDISND1.DAT extracted. Actually, it was really simple. Getting them back into the file is not hard either. Just paste it back over the file in a hex editor, and change the filesize DWORD on the top to the new size. Here are all midi files in MIDISND1.DAT:
[url]http:\\www.thps3cu.com\files\MIDISND1.zip[/url]
I'll create an editor for it later. Enjoy these files in the mean time. [/quote]
Actually there are 16 files in midisnd1 so you are missing one in your zip-file. You are missing de file after "Shadow.mff" this is the 8th file in midisnd1.
Finally (after 30 min more researching) I got the midi files in MIDISND1.DAT extracted. Actually, it was really simple. Getting them back into the file is not hard either. Just paste it back over the file in a hex editor, and change the filesize DWORD on the top to the new size. Here are all midi files in MIDISND1.DAT:
[url]http:\\www.thps3cu.com\files\MIDISND1.zip[/url]
I'll create an editor for it later. Enjoy these files in the mean time. [/quote]
Actually there are 16 files in midisnd1 so you are missing one in your zip-file. You are missing de file after "Shadow.mff" this is the 8th file in midisnd1.