Thread: JJ1 SAVE files
View Single Post
CYBERDEV

JCF Member

Joined: Mar 2024

Posts: 5

CYBERDEV has disabled reputation

Mar 26, 2024, 03:42 PM
CYBERDEV is offline
Reply With Quote
JJ1 SAVE files

Hello!

I was interested in reading/writing SAVE files for JJ1 but did not found
a solution after searching online. So started debugging with DoxBox-X
compiled with HEAVYDEBUG.

It resulted in some code that can read (decipher) and write (cipher) save
game data from SAVE files.

Code: https://codeberg.org/CYBERDEV/JJSave

This is the save file structure that has been found:

Code:
OFFSET  LENGTH  TYPE  DESCRIPTION
------  ------  ----  ------------------------------------------
     0      16    u8  Save name (initial filled with spaces, not zero
                      terminated and when there are less then 16 characters,
                      those left tailing will be spaces (0x20)).
    16       1    u8  Magic (should be 0x1A)
    17       2   u16  Key1 (minutes:hours from DOS get sys time 0x21 AH=2C)
    19       2   u16  Key2 (1/100second:seconds from DOS get sys time)
    21       ?    u8  Garbage byte, the amount of garbage bytes will depend
                      on Key1 and Key1 (calculated after the first full cipher
                      iteration). Garbage bytes are generated by the cipher
                      function.

                      ... GARBAGE BYTES ...

     ?       2   u16  New Key1 (derived after every cycle of garbage byte
                      generation).
 2 + ?       2   u16  New Key2 (also derived after garbage byte generation).
 4 + ?       2   u16  Ciphered level number.
 6 + ?       2   u16  Ciphered planet id.
 8 + ?       2   u16  Ciphered difficulty.
10 + ?       2   u16  Ciphered unknown value 1.
12 + ?       2   u16  Ciphered unknown value 2.
14 + ?       2   u16  Ciphered unknown value 3.
16 + ?       2   u16  Ciphered unknown value 4.
18 + ?       2   u16  Ciphered unknown value 5.
20 + ?       2   u16  Ciphered unknown value 6.

                      ... MORE GARBAGE BYTES ...

                      ... tail, the message from Arjan:
                          "try figure diz out! greetz, arjan\0"

                      EOF