Important Message

You are browsing the archived Lancers Reactor forums. You cannot register or login.
The content may be outdated and links may not be functional.


To get the latest in Freelancer news, mods, modding and downloads, go to
The-Starport

Decompiler for Savegame .FL files?

Here you can find the postings on the different editing utilities found for Freelancer

Post Thu May 08, 2003 4:23 pm

Decompiler for Savegame .FL files?

Anyone know of something for these?

.sig/ Ask for the moon, you may yet be surprised.

Post Thu May 08, 2003 6:05 pm

u ever did somethin on ur own?

Post Thu May 08, 2003 6:14 pm

Sure. I also believe firmly in not re-inventing the wheel. If a utility already exists, I will use it rather than tackle yet another project. If not, well then we do what we can.

I'm guessing from your response, though, that you don't have anything for me...


.sig/ A journey of a thousand miles begins with but a single step..

Post Sat May 31, 2003 12:21 am

Captain Flint or someone else, if you have some news about the .FL (FLS1), post it here, plz. I'm on track for that file format, too. Maybe need to open the freelancer.exe and search for something related to savegame & loadgame... just a thought.

Me, myself & the others.

Post Sat May 31, 2003 4:20 pm

FL files are just text files that are scrambled by xoring with a 256-byte long 'key' and prefixing the magic tag "FLS1". Given this information, any script for breaking simple substitution ciphers will recover the key in fractions of a second.

Rather than posting the 256 values I'll give a generation procedure (shorter, less error-prone):
- fill a byte array with the bytes 0 .. 255
- xor this array with the byte 0x80
- xor this array with the text "Gene" (i.e. first byte with 'G', second with 'e' and so on)

The text inside the savegame is a bit trickier because instead of nicknames you'll find a lot of integer identifiers that are actually hashes of the nicknames, i.e. 3088051465 instead of "shield01_mark01_lf".

The hash function is pretty complicated but weak (i.e., prone to collisions); it looks like somebody took the standard software algorithm for CRC16 and applied random changes until the result looked 32-bittish.

Post Sat May 31, 2003 11:13 pm

Wow, all hail the master

------------------------------------
Freelancer Mod Manager: newbies' dreams come true
Belief in Jesus: the only way to Heaven

Post Sun Jun 01, 2003 12:31 am

You are right, I should have taken the time the post a more comprehensive article. Problem is, I use FoxPro for exploring things and so all my FL stuff is written in Fox (the language is an OO xBASE dialect, and Fox itself is a xBASE/SQL hybrid database system). But I don't think Fox is very popular, or even known, around here and so I did not post any code snippets ... What do you guys prefer, C/C++? Pascal/Delphi? Basic?

I had analyzed the savegame format because I wanted to transfer ships including equipment from one savegame to another (i.e., fully equipped Eagle from post-campaign savegame to mission 7 in Leeds). But now mods like Michael Dan's Rebalance offer battleship encounters and so I never made the script into a program with push-buttons etc., because there is no need for it anymore.

BTW, thanks for giving us FLMM. Don't know how I'd do without it.

Post Sun Jun 01, 2003 7:53 pm

Thanks, and thanks for figuring out all that info about the saved game format! There's absolutely no way I'd be able to figure out any of that from scratch; the only file decompiling I did was for the high score file of SW: Ep1 Pod Racer, so that I could find out if I or my brother had the most high scores

I'd personally prefer C++, though C or Java would work fine too.

------------------------------------
Freelancer Mod Manager: newbies' dreams come true
Belief in Jesus: the only way to Heaven

Post Mon Jun 02, 2003 10:52 am

Not alone there, I am learning C++ for bot coding so C++ is preferred for me as well.

Post Mon Jun 02, 2003 7:38 pm

Anyone managed to get a decoder working?

Tried the above and several variants - got garbage out...

Guess something is missing? - Not a chaining cypher is it?

Post Mon Jun 02, 2003 10:44 pm

Sir_Warwick, you just have to strip off the "FLS1" and then xor the remaining data bytes with the array of values created by the procedure I gave.

Here is the source code of my 'reference' version of the en/decoder. It computes the xor values on the fly instead of looking them up in a table but the result is the same. The language is FoxPro.

<pre><font size=1 face=Courier>
* Genesis.prg
* 2003-04-16
*
* "Genesis - In the beginning Yahweh created the heavens and the earth."

lparameters cText, rcResult

local o, c, k
rcResult = ""
for o = 0 to len(m.cText) - 1
c = asc(substr(m.cText, 1 + m.o, 1))
k = (asc(substr("Gene", 1 + m.o % 4, 1)) + m.o) % 256
rcResult = m.rcResult + chr(bitxor(m.c, bitor(0x80, m.k)))
next o

return m.rcResult </font></pre>

Note: the substr() function in Fox uses index 1 to address the first character in a string, and you have to qualify memory variables with "m." if you use them within expressions. Apart from that the code should be pretty self-explanatory.

P.S.: now that I look at the stuff it seems that I misremembered the proper way of generating the lookup table. Sorry.
Shows the value of posting verified code snippets instead of prose, though.

Edited by - Sherlog on 02-06-2003 23:50:41

Post Tue Jun 03, 2003 12:01 am

I don't supose there's a chance anyone will be able to make a win32 executable, like bini, to uncompress these files?

P/-/3@R D@ D@\/\/G F00lZ

Check out what I'm doing for Reynen's Mod @ my website!

Post Tue Jun 03, 2003 3:56 am

Huge thanks - that seems to have done the trick.

This should open up all sort of useful tools for admins - nice one

Jor

Post Tue Jun 10, 2003 6:18 am

Uh, i compiled Sherlog's algorithm into a small c program and
submitted it to the files section here (should show up soon).

It decodes and encodes those .FL FLS1 files with some sanity checks.

Its a console-app written in POSIX-c that compiles on Windows (e.g. with
the free C-Compiler LCC or with a Windows version of the GNU C Compiler).
(http://www.cs.virginia.edu/~lcc-win32/)

For those who cannot wait for it to show up in the downloads section, grab it
at http://jors.net/jor/src/flcodec.c

--
Jor

Post Tue Jun 10, 2003 1:07 pm

I also made a decrypter last night, using C++ and MSVC++ .Net. I'll be releasing it asap, too

------------------------------------
Freelancer Mod Manager: newbies' dreams come true
Belief in Jesus: the only way to Heaven

Return to Freelancer Editing Utilities Forum