It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
Hi folks,

I purchased the game some days ago to run Airline Tycoon also on Linux. I already have the "Evolution" on Windows and as the game for Linux was very cheap I took the opportunity to get the "Deluxe" version.

I noticed that the deluxe edition comes with additional airports and thus also has more routes to offer. However, I am not too satisfied with having a city like "Atlantis" as new option and thought of removing it somehow. Looking in the game data files I found that the cities seem to be stored in city.csv file in the data directory. Unfortunately this file is not a real comma separated value file, it is kind of encrypted.

To check the encryption I took a look into the game sources but it seems as the read/write code is somehow done within TeakLib which not part of sources zip (making compilation of the game impossible afaik). So I did a test and copied the city.csv and routen.csv from my Evolution installation which causes the Deluxe version to use Evolution cities and routes.

I became curious on how the csv is encrypted. First of all I thought of a disguised archive (zip, gz, ...) but looking at the csv sizes this did not seem to be the case. After that I started to count the bytes of the csv file and found out that 1 byte is used very offen here. As "builds.csv" is a plain csv file which uses ";" as a delimiter I thought that the most used byte in a csv file should somehow match ";" being either rotated or XORed. After XORing each byte of city.csv and routen.csv with 165 i got a rather readable version of the data files. German umlauts are available as soon as I use the correct code page in the editor. There are still some bytes in the beginning (most likely some TeakLib specific file headers) and in some lines (if two equals chars follow directly like in "Dallas" -> "Da??-as") of the file but at least most of the information is readable.

I will continue to look for decryption of these files but I am not sure how fast I can make progress here. Maybe some of you with a bit of programming skills can give a hint on how to proceed. I would like to see a possibility for editing the cities, routes, names and planes of Airline Tycoon and from what I can see it seems to be just about changing the CSV files.

I thought sharing my findings may give someone other a rather simple start in proceeding here. Maybe we find a way to decrypt the csv files so that cities, routes, planes, etc. can be customized.

Best regards,
Felix
No posts in this topic were marked as the solution yet. If you can help, add your reply
Hey, if you want to decrypt the csv files, take a look at that code: karlchenofhell . org / kram/ xtRLE_dec. c

I take no credit what so ever.

It succesfully decrypts my csv files.

If you want to decrypt/unzip the graphic files take a look at my repository: github. com/WizzardMaker/OpenATDeluxe under OpenATDeluxe\GFXLib.cpp

All sound files can be opened in Audacity. They are 16bit Mono, at 22050Hz
Post edited January 28, 2018 by WizzardMaker
Thanks for the hint. I tried the code and it actually worked well. However, I did not fully understand why it uses a decompress and a decrypt step the way it does. Therefore I checked the csv files again and finally found out how the encoding works.

The files I checked were all made up like this:
- 10 bytes header ("xtrle" + 2, 1, 0 ,0) {not clear whether these header bytes actually mean anything}
- 4 bytes unsigned int storing the size of the decoded data
- x bytes encoded data in two kind of blocks:
+ RLE block: 1st byte holding the length, 1 byte holding the char to be used multiple time
+ Encoded block: 1st byte holding the length, x bytes holding the data XORed with 0xA5

Length for blocks is stored in the 1st byte of a block as "bytevalue AND 0x7F".
Encoded blocks are marked with the highest bit in 1st byte as "bytevalue AND 0x80".

So the algorithm for encoding and decoding should be rather simple.
Well, you don't have to encode the files again. Airline Tycoon can use the plain text files as well.
Hello everyone. I don't know if someone is still interested in this topic, but I am. So is there an easy way to decrypt the encrypted data files of ATD? I downloaded the suggested code, but (not being a programmer) I don't know how to make it work in windows.

Thanks
Post edited September 23, 2018 by Neldot