Important information: this site is currently scheduled to go offline indefinitely by end of the year.

[HELP] for some King's Bounty packed files

The Original Forum. Game archives, full of resources. How to open them? Get help here.
Post Reply
vallex
n00b
Posts: 19
Joined: Mon Oct 06, 2014 9:55 pm
Been thanked: 10 times

[HELP] for some King's Bounty packed files

Post by vallex »

I want to extract (decompile) some strg(slcb) files from King's Bounty map editor

The size of the files is very small like this one:

Code: Select all

slcb?...7.. xЪcb``а.вЧ€x_WF.„™Ђ˜$ойг`b. .ЙМIЌOО/Н+r ЧTO
Decompiled looks something like this:

Code: Select all

........TILES........tile_count....
I'm trying to find the algorithm of the compression. If someone want to help me with this I would be very grateful and I am ready to pay

Here is some strg files ..and extracted / decompiled files, taken from RAM memory with Hex editor when editor.exe is started (: :
strg-slcb.rar
You do not have the required permissions to view the files attached to this post.
WRS
ultra-veteran
ultra-veteran
Posts: 603
Joined: Fri Nov 06, 2009 12:13 am
Has thanked: 74 times
Been thanked: 137 times

Re: [HELP] for some King's Bounty packed files

Post by WRS »

its a very common delate algorithm

Code: Select all

idstring slcb
get size long
get zsize long
clog "strg_decompiled" 12 zsize size
Useful tool links:
vallex
n00b
Posts: 19
Joined: Mon Oct 06, 2014 9:55 pm
Been thanked: 10 times

Re: [HELP] for some King's Bounty packed files

Post by vallex »

Wow - very fast answer!
It works!!!!!! Thanks a lot!

I try to use the algorithm in maxscript. Do you help me with this?

Code: Select all

f = fopen file
idstring = readlong file
size = readlong file
zsize = readlong file
...........???........
fclose f
I don't understand how to use [ CLog <filename> <offset> <compressed_size> <uncompressed_size> ] in my script
Last edited by vallex on Mon Dec 01, 2014 12:08 am, edited 1 time in total.
chrrox
Moderator
Posts: 2602
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1422 times

Re: [HELP] for some King's Bounty packed files

Post by chrrox »

its zlib compression.
you will have to make a .net import in your script to extract a zlib file.
you are better off using quickbms
then use max on the already decompressed file.
vallex
n00b
Posts: 19
Joined: Mon Oct 06, 2014 9:55 pm
Been thanked: 10 times

Re: [HELP] for some King's Bounty packed files

Post by vallex »

Yep!
it works with quickbms command line and HiddenDOSCommand !!!!!!!
Thanks so so much!
WRS
ultra-veteran
ultra-veteran
Posts: 603
Joined: Fri Nov 06, 2009 12:13 am
Has thanked: 74 times
Been thanked: 137 times

Re: [HELP] for some King's Bounty packed files

Post by WRS »

as a bonus, the text stuff is xml.

here is a basic parser for it (for 010 editor):

Code: Select all

#include "prelen.bt"

struct Node;
struct Attrib;

enum TypeInfo
{
  NODE_1 = 1,
  NODE_2,
  ATTRIB_3,
  ATTRIB_4,
  ATTRIB_5,
};

struct Node
{
  TypeInfo Info;
  str Name(plen32);
  uint Items;
  TypeInfo InfoHint[Items];
  
  local uint i;
  for(i=0;i<Items;i++)
  {
    switch(InfoHint[i])
    {
      case NODE_1:
      case NODE_2:
        Node child;
        break;
      case ATTRIB_3: // may be different types (int, string, et)
      case ATTRIB_4:
      case ATTRIB_5:
        Attrib attrib;
        break;
      default:
        Exit(-1);
    }
  }
};

struct Attrib
{
  str Key(plen32);
  uint Value;
};

Node root;
prelen.bt from here: https://gist.github.com/x1nixmzeng/3805536
Useful tool links:
vallex
n00b
Posts: 19
Joined: Mon Oct 06, 2014 9:55 pm
Been thanked: 10 times

Re: [HELP] for some King's Bounty packed files

Post by vallex »

You are great!!!!
Thanks again!
I will take advantage of this

I use the editor for easy creation of terrains and landscapes and it's will be very helpful!
The rest of the resources are not compressed and are easy to use. Only this strg file impeded me and had to move texture info by hand in max

PP. Sorry for my bad english
Post Reply