嗯...前两个已经解决了,
) f8 K7 R% P- b2 B后面两个外国大叔给了code,但是我不会用orz
3 q1 ~) w; Y! d0 e [/ n
7 ~( I) I1 r% b5 H. |8 X8 zWizard Land .PAK files (not fully tested yet):- The whole file is encoded, this is the way to decode it:
- ... read the whole file to the Buffer, and ...
- For I := 0 To FILE_SIZE - 1 Do
- Buffer[I] := Buffer[I] Xor (3*I) Xor 166;
- The (possible) structure of the decoded PAK file:
- -> Header: (8 bytes)
- - ID : DWORD; // $BAC04AC0
- - Zero : DWORD; // 0
- -> Directory:
- REPEAT
- - Flag: Byte;
- if Flag==0
- - FileNameLen : Byte;
- - FileName : Array Of Char; // example: 'images\\backgrounds\\background_01.jpg'
- - FileSize : DWORD;
- - FileTime : TFileTime; // 8 bytes long, Windows _FILETIME format
- else if Flag==$80
- END_OF_THE_DIRECTORY
- endif
- UNTIL END_OF_THE_DIRECTORY
- -> File_Data
复制代码
( x' ~6 j- k* @2 d3 O5 I8 H6 D a D# t5 g
Magic Encyclopedia First Story "magic.vfn" file WORK-IN-PROGRESS- -> Header: (44 bytes = $2c)
- -ID : Array[0..3] Of Char; // 'ASDb'
- -Something : DWORD; // nr of files???
- -DirectoryStartPos : DWORD; // Points to the end of the file
- -Unknown1 : DWORD; // 03 00 31 07
- -Unknown2 : DWORD; // 08 00 44 53
- -Unknown3 : DWORD; // 00 00 34 86
- -Unknown4 : DWORD; // 88 85 B8 3A
- -Unknown5 : DWORD; // E3 40 55 3F
- -Unknown6 : DWORD; // FB 61 E1 2A
- -Unknown7 : DWORD; // CB 6D 29 52
- -Unknown8 : DWORD; // E3 C9 AD F0
- -> SomethingAfterHeader (12 bytes)
- -SomeBytes : Array[0..11] Of Byte; // 40 87 00 00 00 00 00 00 00 00 00 00
- -> FILE_DATA, ZLIB compression???
- -> Directory, for each file:
- -FileNameLen : DWORD;
- -FileName : Array Of Char;
- -RelativeStartPos : DWORD; // relative from the Header's end, so add 44 to this value to get the real filestartpos
复制代码 |