Questions about sminstcab.bms

Doubts, help and support about QuickBMS and other game research tools
crushedice2000
Posts: 32
Joined: Sun Nov 08, 2015 8:37 pm

Questions about sminstcab.bms

Post by crushedice2000 »

Hi! I want to ask two questions about sminstcab.bms:

1. Is there any way to keep the folder structure when extracting Smart Install Maker setup files?
2. Why are two cabinets as output? (Setup_Disk1.cab and Setup_Disk2.cab)
3. Why Windows can open the cabinet but not extract it? (It prompts me for a cab file called

Code: Select all

""
)
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Questions about sminstcab.bms

Post by aluigi »

1 and 2)
I guess this information is not available in the installer but I'm not sure because I don't remember all the details of this format (it's a very long script).
The header of the script gives some additional information: "compressed installers (default) are converted in CAB archives while the uncompressed ones are extracted directly".
I guess your 2 questions are just related to the third one.

3)
Try 7-zip or cabextract or any other cab tool.
The CAB archives contain all the original filenames.
crushedice2000
Posts: 32
Joined: Sun Nov 08, 2015 8:37 pm

Re: Questions about sminstcab.bms

Post by crushedice2000 »

aluigi wrote:1 and 2)
I guess this information is not available in the installer but I'm not sure because I don't remember all the details of this format (it's a very long script).
The header of the script gives some additional information: "compressed installers (default) are converted in CAB archives while the uncompressed ones are extracted directly".
I guess your 2 questions are just related to the third one.

3)
Try 7-zip or cabextract or any other cab tool.
The CAB archives contain all the original filenames.


1 and 2)

The installer works perfectly, so I think that the cab should be good (no corruption).

Also the directory structure is present in the installer (see example at the bottom of my post)

3)
I've used cabextract with no luck.

=================================================================


Example of installer.config file (partial hexdump):

Code: Select all

0000350: 6d6c 0032 0031 0040 2426 2530 345c 7264  ml.2.1.@$&%04\rd
0000360: 742e 6261 7400 3200 3100 4024 2625 3034  t.bat.2.1.@$&%04
0000370: 5c72 6476 702e 646c 6c00 3200 3100 4024  \rdvp.dll.2.1.@$
0000380: 2625 3034 5c52 4456 7072 696e 742e 6578  &%04\RDVprint.ex
0000390: 6500 3200 3100 4024 2625 3034 5c6d 6663  e.2.1.@$&%04\mfc
00003a0: 3130 302e 646c 6c00 3200 3100 4024 2625  100.dll.2.1.@$&%
00003b0: 3034 5c6d 6663 3130 3064 2e64 6c6c 0032  04\mfc100d.dll.2
00003c0: 0031 0040 2426 2530 345c 6d66 6331 3030  .1.@$&%04\mfc100
00003d0: 752e 646c 6c00 3200 3100 4024 2625 3034  u.dll.2.1.@$&%04
00003e0: 5c6d 6663 3130 3075 642e 646c 6c00 3200  \mfc100ud.dll.2.
00003f0: 3100 3100 4024 2625 3033 5c72 6454 656d  1.1.@$&%03\rdTem
0000400: 7064 5c45 7844 7261 772e 646c 6c00 3200  pd\ExDraw.dll.2.
0000410: 3100 4024 2625 3033 5c72 6454 656d 7064  1.@$&%03\rdTempd
0000420: 5c45 7846 696c 654d 6772 2e64 6c6c 0032  \ExFileMgr.dll.2
0000430: 0031 0040 6165 6161 3033 5c72 6454 656d  .1.@aeaa03\rdTem
0000440: 7064 5c45 784c 6f61 6465 722e 646c 6c00  pd\ExLoader.dll.
0000450: 3200 3100 4024 2625 3033 5c72 6454 656d  2.1.@$&%03\rdTem
0000460: 7064 5c45 784d 6174 682e 646c 6c00 3200  pd\ExMath.dll.2.
0000470: 3100 4024 2625 3033 5c72 6454 656d 7064  1.@$&%03\rdTempd
0000480: 5c45 7854 6578 742e 646c 6c00 3200 3100  \ExText.dll.2.1.
0000490: 4024 2625 3033 5c72 6454 656d 7064 5c46  @$&%03\rdTempd\F
00004a0: 6f6e 7473 5c42 4947 2e53 4858 0032 0031  onts\BIG.SHX.2.1
00004b0: 0040 2426 2530 335c 7264 5465 6d70 645c  .@$&%03\rdTempd\
00004c0: 466f 6e74 735c 434f 4d50 4c45 582e 5348  Fonts\COMPLEX.SH
00004d0: 5800 3200 3100 4024 2625 3033 5c72 6454  X.2.1.@$&%03\rdT
00004e0: 656d 7064 5c46 6f6e 7473 5c43 5952 494c  empd\Fonts\CYRIL
00004f0: 4c49 432e 5348 5800 3200 3100 4024 2625  LIC.SHX.2.1.@$&%
0000500: 3033 5c72 6454 656d 7064 5c46 6f6e 7473  03\rdTempd\Fonts
0000510: 5c43 5952 494c 544c 432e 5348 5800 3200  \CYRILTLC.SHX.2.
0000520: 3100 4024 2625 3033 5c72 6454 656d 7064  1.@$&%03\rdTempd
0000530: 5c46 6f6e 7473 5c46 732e 5348 5800 3200  \Fonts\Fs.SHX.2.
0000540: 3100 4024 2625 3033 5c72 6454 656d 7064  1.@$&%03\rdTempd
0000550: 5c46 6f6e 7473 5c67 6263 6269 672e 7368  \Fonts\gbcbig.sh
0000560: 7800 3200 3100 4024 2625 3033 5c72 6454  x.2.1.@$&%03\rd


So the files prefixed with @$&%03 will be copied to system32 and files prefixed with @$&%04 will be copied to Program Files\{program folder}

@$&%03\rdTempd\ExFileMgr.dll means that ExFileMgr.dll will be extracted into C:\WINDOWS\system32\rdTempd\

I expect to be clear enough (I'm a total n00b on reverse engineering practices)
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Questions about sminstcab.bms

Post by aluigi »

Can you provide this installer?
crushedice2000
Posts: 32
Joined: Sun Nov 08, 2015 8:37 pm

Re: Questions about sminstcab.bms

Post by crushedice2000 »

aluigi wrote:Can you provide this installer?


I'm sorry. I forgot to add attachments.

I also attach SIM unpacker (a ugly and bad unpacker that I've found searching on google). However, a good thing is that this unpacker dumps the "raw" contents of the installer (without filenames).

MEGA link (because the forum uploader is really weird): https://mega.nz/#!aksiGYAS!POsSFPE6rOIg ... dXdfK9_e24
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Questions about sminstcab.bms

Post by aluigi »

The extracted CAB are perfect with all the full filenames.
I suggested you to use 7-zip, try it.

Do you have the full list of "@$&%0" paths?
Like @$&%01, 2, 5 and so on.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Questions about sminstcab.bms

Post by aluigi »

In the meantime I check if I can make the CAB compatible with cabextract.
crushedice2000
Posts: 32
Joined: Sun Nov 08, 2015 8:37 pm

Re: Questions about sminstcab.bms

Post by crushedice2000 »

Sorry. I didn't tried 7-zip.

I would very happy if the cab files were compatible with cabextract :)

I don't have a full list of @$&%0 paths, but I'll try to make one for you ;)
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Questions about sminstcab.bms

Post by aluigi »

I bet it's the following starting from @$&%01:
%PROGRAMFILES%
%WINDOWSDIR%
%SYSTEMDIR%
%INSTALLPATH%
%TEMPDIR%
%DESKTOP%
%QUICKLAUNCH%
%PROGRAMSDIR%
%STARTMENU%
%MYDOCUMENTS%
%FAVORITES%
%SENDTO%
%USERPROFILE%
%STARTUP%
%FONTDIR%
%COMMONFILES%
%SYSTEMDRIVE%
%CURRENTDIR%
crushedice2000
Posts: 32
Joined: Sun Nov 08, 2015 8:37 pm

Re: Questions about sminstcab.bms

Post by crushedice2000 »

Yes. I've downloaded a free copy of Smart Install Maker. Now I'll send you a struct definition (In QuickBMS -as I'm very happy with this discovery-) of installer.config.

P. D.: How can I get fields splitted by \0 on QuickBMS?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Questions about sminstcab.bms

Post by aluigi »

If you mean something like a list that can be parsed as an array later... it's not a good idea :)
Currently in my (not public yet) code I'm using:

Code: Select all

    string NAME R= @$&%01 "%PROGRAMFILES%"
    string NAME R= @$&%02 "%WINDOWSDIR%"
    string NAME R= @$&%03 "%SYSTEMDIR%"
    string NAME R= @$&%04 "" #"%INSTALLPATH%"
    string NAME R= @$&%05 "%TEMPDIR%"
    string NAME R= @$&%06 "%DESKTOP%"
    string NAME R= @$&%07 "%QUICKLAUNCH%"
    string NAME R= @$&%08 "%PROGRAMSDIR%"
    string NAME R= @$&%09 "%STARTMENU%"
    string NAME R= @$&%10 "%MYDOCUMENTS%"
    string NAME R= @$&%11 "%FAVORITES%"
    string NAME R= @$&%12 "%SENDTO%"
    string NAME R= @$&%13 "%USERPROFILE%"
    string NAME R= @$&%14 "%STARTUP%"
    string NAME R= @$&%15 "%FONTDIR%"
    string NAME R= @$&%16 "%COMMONFILES%"
    string NAME R= @$&%17 "%SYSTEMDRIVE%"
    string NAME R= @$&%18 "%CURRENTDIR%"
crushedice2000
Posts: 32
Joined: Sun Nov 08, 2015 8:37 pm

Re: Questions about sminstcab.bms

Post by crushedice2000 »

The installer.config contains a list of fields split with 0x00 or 0x0D 0x0A 0x0D 0x0A. How can I do a list to say you "The first \0 separated field is that"?
crushedice2000
Posts: 32
Joined: Sun Nov 08, 2015 8:37 pm

Re: Questions about sminstcab.bms

Post by crushedice2000 »

What I want to do is a hard task. I've only done a bit:

Code: Select all

Field 1  {Version}:   Smart Install Maker v. 5.04
Field 2  {Unknown}:   0
Field 3  {Unknown}:   0
Field 4  {Unknown}:   1
Field 5  {Unknown}:   16744576
Field 6  {Unknown}:   0
Field 7  {Unknown}:   0
Field 8  {Unknown}:   0
Field 9  {Welcome}:   Welcome to installer {Product name}
Field 10 {Copyright}: Copyright © 2015, {Company}
Field 11 {Unknown}:   -37
Field 12 {Font???}:   Tahoma
Field 13 {Unknown}:   16777215
Field 14 {Unknown}:   1
Field 15 {Unknown}:   2
Field 16 {Unknown}:   0
Field 17 {Unknown}:   16777215
Field 18 {Unknown}:   1
Field 19 {Unknown}:   -11
Field 20 {Font???}:   Tahoma
Field 21 {Unknown}:   0
Field 22 {Filename pattern}:   disk@$&%19.pak
Field 23 {Unknown}:   0
Field 18 {Product}:   {Product name}



Also I want to say you that @$&%19 is the same as %i%
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Questions about sminstcab.bms

Post by aluigi »

Yeah that's already handled correctly.

I have released the script 0.3 that supports all the folders I have listed before, it's compatible with cabextract and works correctly because the previous one returned wrong folders with the installer you provided. It has also a variable at its beginning that dumps the original cabs without filenames replacing if set to 1:
http://aluigi.org/bms/sminstcab.bms
crushedice2000
Posts: 32
Joined: Sun Nov 08, 2015 8:37 pm

Re: Questions about sminstcab.bms

Post by crushedice2000 »

I have QuickBMS 0.6.5 so I changed quickbmsver "0.6.6" into quickbmsver "0.6.5"

However, when it runs, the output is this:

Code: Select all

QuickBMS generic files extractor and reimporter 0.6.5
by Luigi Auriemma
e-mail: me@aluigi.org
web:    aluigi.org
        (Jul  8 2015 - 12:15:00)

                  http://quickbms.aluigi.org
               http://twitter.com/luigi_auriemma
                       http://zenhax.com

- GUI mode activated, remember that the tool works also from command-line
  where are available various options like folder scanning, filters and so on

- select the BMS script or plugin to use
- select the input archives/files to extract, type * or "" for whole folder and
subfolders
- select the output folder where extracting the files
- open input file C:\Documents and Settings\Windows XP\Escritorio\Setup.exe
- open script Z:\Descargas\sminstcab.bms
- set output folder C:\Documents and Settings\Windows XP\Escritorio\Setup\outbms


  offset   filesize   filename
--------------------------------------
- SCRIPT's MESSAGE:
  PAK_SIZE      99840
  MULTI_PATTERN disk@$&%19.pak
  ONE_VOLUME    0
  FILES         1
  CAB_SIZE      49786

- enter in folder C:\Documents and Settings\Windows XP\Escritorio
- open input file C:\Documents and Settings\Windows XP\Escritorio\disk2.pak

- error in src\file.c line 237: fdnum_open()
Error: No such file or directory

Last script line before the error or that produced the error:
  119 open FDSE TMP 1

Press RETURN to quit
crushedice2000
Posts: 32
Joined: Sun Nov 08, 2015 8:37 pm

Re: Questions about sminstcab.bms

Post by crushedice2000 »

Is a bit hard for me to understand QuickBMS code, but I begin to understand it. It seems to be a very powerful language.

What about to implement if not?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Questions about sminstcab.bms

Post by aluigi »

It's looking for the other parts of the installer because it's a splitted installation (@$&%19).

I guess I have understood where is the problem, can you recheck the bms link and download the 0.3a version?
crushedice2000
Posts: 32
Joined: Sun Nov 08, 2015 8:37 pm

Re: Questions about sminstcab.bms

Post by crushedice2000 »

AFAIK it is not a multipart setup.

0.3a does the same as 0.3.

In the above MEGA link you have the setup. Can you extract it in your computer? If not, then the problem is of the script. How are you determining if it's a multipart setup?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Questions about sminstcab.bms

Post by aluigi »

What link?
The only link I see is the one containing "RDVPriterSetup English.exe" and my script works perfectly with it.
crushedice2000
Posts: 32
Joined: Sun Nov 08, 2015 8:37 pm

Re: Questions about sminstcab.bms

Post by crushedice2000 »

Yes, I refer to "RDVPriterSetup English.exe"
But it doesn't work on my computer. The fail can be that I have 0.6.5 and you 0.6.6?