Targhan
Colorado
Crystals of Arborea
StarBlade
Metal Mutant
Ishar I
Ishar II
Ishar III
Transarctica (or Artic Baron)
Bunny Bricks
but there are more for sure, i have not checked them all. So discovering the compression algorithm will give us the possibility to decompress game data of a lot of Silmarils games.
The .io files store different kind of data: music, graphics, texts, etc.
Looks like a common file on all of those games is MAIN.IO, also BLANCPC.IO, sure there are others, i have not checked all.
In particular i have investigated Ishar: Legend of the fortress.
GAME DOWNLOAD (french version)
You can download the game from here (if you want to run tests and to investigate executing the game):
https://16bit.pl/download/games/pc/isharlegendofthefortress.zip
NOTE: Use the numeric pad of the keyboard to select the language when prompted.
NOTE2: The spanish version (not the one i posted up here) does not have the language selection screen! The file that displays that is MAIN.IO, so if you take the MAIN.IO from the french version and overwrite it on the spanish, you will get that screen.
COMPARING FRENCH WITH SPANISH VERSION
All files are identical across spanish and original version except:
MAIN.IO (the one from french shows a language selection screen, spanish don't)
MESSAGE.IO (spanish version has this in spanish, and french version in french)
MESSAGED.IO
MESSAGEE.IO
SOS.IO
START.EXE (French version has some little differences like fading out the music on title screen when space bar is pressed, spanish version stops it abruptly)
TEXTIN.IO
I used WinMerge to compare across french and spanish version files:
ABOUT THE GAME EXECUTABLE (PACKED) START.EXE
The exe from Ishar is packed with PACK201 (PACK 2.01). I detected it using SH Archive Identifier (SHAID, Archid):
Then i checked it with PACK 2.01 itself and it detect that it is packed with it:
Them, i used "UUP v1.4 - Universal exe-file UnPacker" with the exe and successfully extracted it (and works if you execute it!):
The packed start.exe file i used for the screenshots are from the Spanish version.
UNPACKED GAME EXECUTABLES
Spanish unpacked START.EXE:
Download:
https://mega.nz/#!xdcwhI5L!jYOnoU1G6Ob9 ... BFHAuPpiyw
Packed EXE MD5:
1CC16F2C49C6CE5751893C02632443C4
French unpacked START.EXE:
Download:
https://mega.nz/#!IZEzhYbB!E-jmfGyfKyWz ... v3g0Ztvd78
Packed EXE MD5:
DE1B671638EC5EC9FC93E2304CE1DF44
Size difference between unpacked EXE versions:
Spanish: 75 KB
French: 88 KB
A note when unpacking the French EXE version is that i get this message (that was not displayed on spanish EXE version) but the unpacked EXE works:
Now we can dissasembly the executable to do reverse engineering, unfortunately i don't know very much x86 assembler.
HOW TO CHECK WHAT FILES ARE USED ON EACH MOMENT
I run the game on Dosbox and i use the freeware tool ProcessActivityView over the Dosbox process to see what files the game access on every moment. You can also use ProcessMonitor that gives even more details: all the offsets on each file the game is accessing.
EXAMPLES OF TWO FULLSCREEN IMAGE FILES
These are good to investigate because we know they have the same kind of data: two images of 320x200 (64.000 pixels), so we can compare each other and take a look at the header bytes to see differences, but unfortunately i have not found what seems to be the bytes that indicate the uncompressed data size.
- Starting the game, after some scenes (Silmarils logo and others) you will see a fullscreen image (320x200) of the game credits, the file used for this is AUTEUR.IO, it's like that:
Copy and pasting random little blocks of bytes from the file itself (AFTER what it looks like it is the header) over itself you can change the background of the image when the game displays it:
As you can see the background has been modified but not the red characters, but if you continue modifying blocks of bytes of the file, you will also modify the red characters (look on the bottom):
So looks like they are stored in two planes.
- When the player is dead, another fullscreen of 320x200 image will be shown:
SWAPING THE IMAGES ON THE GAME
OK. So now, the classic trick... What if we copy AUTEUR.IO file over DEAD.IO? Now supposedly, the credits must be shown when the player is dead but... you get a black screen (although music plays) and you can continue the game when pressing space. But I discovered how to get the image shown!
MAKING THE FULLSCREEN IMAGE SWAP WORK
Comparing the first bytes of AUTEUR.IO and DEAD.IO you will see some little differences on the first bytes.
Looks like the byte on offset 16 (starting by 1 on the file) identifies something like the scene:
- AUTEUR.IO has 0x98 value
- DEAD.IO has 0xC0 value
So writing now the value of 0xC0 (the value that the dead scene file must have) over the 0x98 value to it works and now it displays the AUTEUR image when you're dead.
You can try my modified AUTEUR.IO file to see the dead screen instead of the credits screen (is a modified DEAD.IO file: it is the same except the byte at offset 16 that is taken from AUTEUR.IO to match the value that the game expects, because if it does not match, the image is not shown and you will see a black screen instead):
https://mega.nz/#!MJdnnCZZ!WCzIjDvYxaWn1DaFpfwOqDIZQwjG5WYYYOeoiLv5JOU
STRINGS
The strings are stored on those files. On the french version of the game:
- MESSAGE.IO: strings in french
- MESSAGED.IO: strings in german
- MESSAGEE.IO: strings in english
- MESSAGEI.IO: strings in italian
this is an advantage because they store the same strings but for different languages, so we can compare those files to examine how the bytes on the header are different because the file size differs, but i could not get where the uncompressed size bytes are on those MESSAGEX.io files
On the french MESSAGE.IO file, i found 4 uncompressed strings:
- "CARAC" (in characteristics panel in the game, "CARAC" is used to print the first part of the string "CARACTERISTIQUES :" and the first character "C" to print the first character of "CONSTITUTION : ")
- "TU" (in characteristics panel in the game, "TU" is used to print the characters 7 and 8 in the string "CONSTITUTION : ")
- "PHYS" (used to print "SCHLOUMZ : REGENERATION PHYSIQUE". This is a supposition, i have not checked this because you have to arrive to some part of the game to see that string. In ARAMIR warrior panel there is a string with "PHYSIQUE : " but it does not change if you change "PHYS" to another characters, so looks like it is used to print "SCHLOUMZ : REGENERATION PHYSIQUE")
- "INVUL" (there are 2 strings that contain this string: "CLOPATOS : INVULNERABILITE" and "INVULNERABILITE 6" but i have not checked in the game if they change if i modify "INVUL")
You can change those strings with anothers characters, for example, you can change "CARAC" by "ABCDE" and you will see the changes in the game where they are used.
The "CARAC" and "TU" strings on MESSAGE.IO:
Used to print some word characters on characteristics panel:
Now, if you change "CARAC" and "TU" to "ABCDE" and "FG":
you will see the changes:
Also, "CARAC" string is used to print the competences panel:
so having "CARAC" changed to "ABCDE" you will see the changes:
Also, here are the "PHYS" and "INVUL" strings but i have not checked where they appear on the game:
So, the conclusion relative to compression is that MESSAGE.IO file:
- has some uncompressed string parts: "CARAC", "TU", "PHYS" and "INVUL" (maybe there are more)
- has the most string parts compressed (there are not so many kind of "valid" strings or dictionary words)
- the most important, it use some kind of compression that characters are pointed from other strings to reuse them, as you can see in my examples: "CARAC" is the source string for the ingame strings "CARACTERISTIQUES", "ARMES 1 MAIN", "ARMES 2 MAINS", "ARMES DE JET" AND "COMPETENCES".
I have no compression algorithm knowledge but maybe some of you can help. As i told, discovering the Silmarils compression algorithm would make us having the possibility to decompress lot of game data from the dozens other games they have.
UNCOMPRESSED MESSAGE.IO (french and spanish)
I successfully extracted uncompressed MESSAGE.IO (french and spanish) from memory using the DOSBox debugger, you can download it here:
https://mega.nz/#!1RdDgKZA!R0zED1WQA641WsqLCUGxSFOIS7L5RdhmMxEPyngTfjA
These files are what was written in memory when the file MESSAGE.IO was read, i carefuly executed it step by step with a breakpoint where the destination byte was written.
Anyone want to help?