[facebook] [skype] [twitter]
[view] softaction-resource.md [raw]
MIME: text/plain Modified: 2017/07/13 @ 11:19:57 File Size: 1.77KB

SoftAction Resource Files

These files are used in some games by Korean publisher SoftAction SDT. More specifically, they are used in SoftAction's Langrisser I&II remakes, where I encountered them. Their extension is .RES.

SoftAction Resource Files are just another package format very similar to Microsoft Fastfile. They were designed to speed up games depending on DirectX 6.0.

The file begins with a long value telling the file count, then loops through a file table based on DOS 8.3 file names.

Surprisingly, despite being used to stream data off the game CD, the files aren't padded out to begin at even sectors.

File Format

The file loop is detailed below. All values are stored in little endian ordering, and strings are padded by 0x00:

File count [4 bytes, long]
(File loop)
  File name [16 bytes, string]
  File offset [4 bytes, long]
  File size [4 bytes, long]
(End loop)
(Data)

Proof of Concept

A proof of method to extract a resource file is shown below:

$fd = fopen('tdat.res', 'rb');
$count = unpack('V*', fread($fd, 4));
$filename = array();
$offset = array();
$size = array();
for($i=0; $i< $count; $i++) {
  $filename[$i] = rtrim(fread($fd, 16));
  $offset[$i] = unpack('V*', fread($fd, 4));
  $size[$i] = unpack('V*', fread($fd, 4));
}
for($i=0; $i<$count; $i++) {
  fseek($fd, $offset[$i], SEEK_SET);
  $fo = fopen($filename[$i], 'w');
  fputs($fo, fread($fd, $size[$i]));
  fcolse($fo);
}
fclose($fd);

Copyright

Copyright (c) 2005 Derrick Sobodash. Some Rights Reserved.

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

[dir] Parent Directory
Directory