+  RHDN Forum Archive
|-+  Romhacking
| |-+  General Romhacking
| | |-+  Can anyone figure out this archive?
Pages: [1]
Author Topic: Can anyone figure out this archive?  (Read 1 times)
Penance
Guest
« on: December 14, 2009, 03:16:44 pm »

It doesn't look like anything unusually difficult, but I know it's exclusive to the game I'm working on.
It's an archive, and it's got the compressed game script inside it (you can make some of it out).

Here's the file:
http://www.yousendit.com/download/MVNlSkhVNXZreEIzZUE9PQ
DarthNemesis
Guest
« Reply #1 on: December 17, 2009, 10:05:09 pm »

Don't know about the compression, but the header is straightforward enough. The number of files is at 0x08, and their lengths are 4 bytes each from 0x10 to 0x44, with the file data beginning at 0x48. Each file is padded with '#' to 4-byte boundary.
Penance
Guest
« Reply #2 on: December 18, 2009, 02:02:44 pm »

Thanks! That will come in handy in building the tool.
Now I need a programmer...
Klarth
Guest
« Reply #3 on: December 18, 2009, 11:14:04 pm »

Just learn to program it yourself.  You only need to know the bare basics (which include file i/o).
Penance
Guest
« Reply #4 on: December 20, 2009, 02:40:45 pm »

Yeah, that's probably something I would have ended up attempting anyway.
I'm learning Pascal at college currently, hopefully that can be put to use.

Could anyone give me some starting pointers or a link to a document for PSP programming (if one should exist)?
« Last Edit: December 20, 2009, 03:05:57 pm by Penance »
creaothceann
Guest
« Reply #5 on: December 20, 2009, 05:20:19 pm »

What Pascal version?

Here's some Delphi code for the command-line window:

Code:
program Test;  {$APPTYPE console}
uses    Classes, SysUtils;


type    DWord           =       Cardinal;


        THeader         =       packed record
                                Signature       :       packed array[0..3] of AnsiChar;
                                unknown         :       DWord;
                                ItemCount       :       DWord;
                                end;


// ------------------------------------------------------------------------------------------------


procedure Show(const Stream : TStream);
var     Header          :       THeader;
        i               :       Integer;
        tmp             :       DWord;
begin
Stream.Read(Header, SizeOf(Header));
WriteLn('Signature = ', Header.Signature);
WriteLn('unknown   = ', Header.unknown  );
WriteLn('ItemCount = ', Header.ItemCount);
WriteLn;
for i := 1 to Header.ItemCount do begin
        Stream.Read(tmp, 4);
        WriteLn(tmp);
end;
end;


// ------------------------------------------------------------------------------------------------


var     Stream          :       TFileStream;


begin
Stream := TFileStream.Create('file004246.scpk', fmOpenRead + fmShareDenyWrite);
try
        Show(Stream);
finally
        Stream.Free;
end;
end.

Output:
Code:
Signature = SCPK
unknown   = 983041
ItemCount = 14

0
232500
24
5000
2376
36596
6176
992
5576
92100
63260
85204
15812
6344
Klarth
Guest
« Reply #6 on: December 21, 2009, 01:25:06 am »

Whoa, didn't know that they still taught Pascal in college.

Anyways, you don't need any specific guide to do this task.  All you need to know is how to read/write binary files along with the traditional program flow structures (conditionals and loops).  It's really that simple if you know the structure of the archive.
Pages: [1]  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC