Assetto Corsa ACD extractor

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
sorcereR15
Posts: 1
Joined: Fri Nov 25, 2016 9:38 pm

Re: Assetto Corsa ACD extractor

Post by sorcereR15 »

thank you for this tool !

I have a question, after i extracted a car, i tried to copy the entire car folder (and renaming it), so that i have the original car, and the modified car, to do testing quickly in the game.

But i can not load the renamed car? any idea why this is.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Assetto Corsa ACD extractor

Post by aluigi »

As far as I remember you cannot create new cars but you can only use those existent (same names) or the game will not accept them.
There are modders who can give you an exact answer, so wait their confirmation.
kickstart
Posts: 43
Joined: Fri Dec 19, 2014 7:45 am

Re: Assetto Corsa ACD extractor

Post by kickstart »

After decrypt, you have to rename the "Car" as example to "Car_own_creation" and rename in the SFX-Folder the .bank to the same: Car_own_creation.bank
Now you have two same cars and you can edit, what you want.
jag543
Posts: 1
Joined: Thu Dec 22, 2016 9:54 pm

Re: Assetto Corsa ACD extractor

Post by jag543 »

Hi,
first I wanted to thank you for work with this great little script, which helped me a lot in the last 2 years.
Sadly I'm having some problems lately rebuilding my data.acd-files.
According to QuickBMS the process is finished succesfully, but ingame the engine behaves weirdly like it has 1000000000 horsepower at one exact rpm.
Has someone had the some problem?

Thanks and Greetings
Robbie222
Posts: 1
Joined: Tue Jan 10, 2017 11:24 am

Re: Assetto Corsa ACD extractor

Post by Robbie222 »

Hello Aluigi,

First of all thanks sharing your awesome work.

I have tried to rebuild an edited data.acd, the script worked succesfully, the file has the same size as the original. After replacing the original and renaming as the original, when I try to test it the game crashes on loading.

Are you able to fix this?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Assetto Corsa ACD extractor

Post by aluigi »

Rebuilding data.acd is not necessary because, as far as I remember, the game works with the extracted files in the data folder.
If you want to use the rebuilding script anyway try to set the ACD_VERSION variable in it to 1 instead of 0.
AngryArowana
Posts: 1
Joined: Fri Feb 10, 2017 1:57 pm

Re: Assetto Corsa ACD extractor

Post by AngryArowana »

Thank you so much for sharing this. Finally I can change tyres to the ones I wanted to use on those mod drift cars and actually drive them.
solyom
Posts: 1
Joined: Mon Jul 24, 2017 1:12 pm

Re: Assetto Corsa ACD extractor

Post by solyom »

d0m wrote:hey,

hmm. looks like editing the special events is the wrong way, I managed to change the acd file for one event (I replaced the event care with a powerfule one), but still didn't get a achievement.
I'll try now to increase the power of the original car, anyone know how to do this in an easy way? :D



Hi d0m, (or anybody else)

Could you tell me how did you edit finally the acd files?

I don't want to change the events but make new ones, because race events require acd files too. Time events curiously don't.
I'd like to make new acd files parallel to my own ini's to make working the race events.

Thanks!
AWD
Posts: 3
Joined: Thu Feb 15, 2018 4:48 pm

Re: Assetto Corsa ACD extractor

Post by AWD »

aluigi wrote:http://aluigi.org/papers/bms/others/assetto_corsa_acd.bms

Yeah, finally I have made the extractor that tons of people were requesting from months.
So let's start to extract all the data.acd you desire.

The format is simple, just a sequence of files that have each byte occupying a 32bit field so the size is 4 times the original one.
The real task of the format was the encryption because the key is generated with the name of the folder where is located the ACD file.
The encryption is just a simple rot.

The key is generated by 8 small algorithms that take the whole or parts of the folder name.
Then the 8bit values of these keys are used with sprintf "%d-%d-%d-%d-%d-%d-%d-%d"".
That's it.


Hey, can you tell me more about the encryption? I'm trying to make a plugin that uses theese informations about the car to view real time telemetry with the ideal tyre temps and pressures in Python, but I can't get it right (I'm new with this type of algorithm). I get the right keys, but can't decrypt the inner files. Could it be the alphabet or the way the keys are used in the inverted rot function?
Thanks
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Assetto Corsa ACD extractor

Post by aluigi »

The encryption is trivial, take a 32bit of data, use only its 8bit and then add the byte of the key: decrypted[i] = (long)encrypted[i] + key[i];
where "encrypted" is a 32bit pointer.

The complex part is the generation of the key, but if you say you obtained the right key then it's 99% of the problem solved :)
AWD
Posts: 3
Joined: Thu Feb 15, 2018 4:48 pm

Re: Assetto Corsa ACD extractor

Post by AWD »

aluigi wrote:The encryption is trivial, take a 32bit of data, use only its 8bit and then add the byte of the key: decrypted[i] = (long)encrypted[i] + key[i];
where "encrypted" is a 32bit pointer.

The complex part is the generation of the key, but if you say you obtained the right key then it's 99% of the problem solved :)


Thanks for the quick reply! I learned how to generate the keys in your bms script file. ^^
I was trying to do that, to subtract, to change the alphabet too but I'm still missing something very noobie... are you using key as a string or int array?
My code, in Python, for each inner file was:

keys = [179, 44, 163, 59, 166, 193, 14, 53] # generated keys
content = acd_file[offset:offset + file_size * 4] # get entire encrypted file content
packed_content = content[::4] # get only the first of each four bytes of the encription
new_content = ""
for i in range(file_size):
new_content += chr(packed_content[i] + keys[i % 8])

So this: bjh\\hg\xa9ddhehl7bhe\\ej\xaf`_h^kj;hk\\ch]\xadia`hla;gi\\`me\xa9db_hciAj`ccab\xb2f[fn`i@g``hg]\xadg[ejgpC^gc\\dm\xaf_cqagg@^ehb`h\xb0_cieiq7eh\\`ii\xa9ggbhgj7bmb\\dh\xa9gaeiqb
Turn into: ĕ–ċ—ĎĨ·™ė”Ĉ£ĒøpĘˆĈ¥ŕġmđ—čvĎĬj˜ě‰Ő¤ćġv¡ĔgĊ¤Ăġ{šŜąšĎĤwvĝŒĆžćģÀ›Ď’đ›ďāu•ē”Ċ˜œĨišĝ“ē~ĄĨq‘ė™ŒšĉIJoœĚlā Ďģnţ‹Ć¤ċĪlʔÿ›ďĪ·œĚŽċ¢Đøp¢ĕˆć£ŏĨošĜą
When it should be:
13//43|3.5833
12//41|3.4167
12//40|3.3334
13//42|3.2308
13//41|3.1538
13//40|3.0769
13//37|2.8461
14//37|2.6428
14//36|2.5714
14//34|2.4285

I have no experience in encryption at all. =/
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Assetto Corsa ACD extractor

Post by aluigi »

Let's say the following is the initial content of data.acd:

Code: Select all

  08 00 00 00 61 65 72 6f 2e 69 6e 69 41 08 00 00   ....aero.iniA...
  92 00 00 00 75 00 00 00 77 00 00 00 75 00 00 00   ....u...w...u...
and the key is 7-248-6-221-246-250-21-49

Code: Select all

0x92 - '7' = '['
0x75 - '-' = 'H'
0x77 - '2' = 'E'
0x75 - '4' = 'A'
...

Gotcha? :)
AWD
Posts: 3
Joined: Thu Feb 15, 2018 4:48 pm

Re: Assetto Corsa ACD extractor

Post by AWD »

aluigi wrote:Let's say the following is the initial content of data.acd:

Code: Select all

  08 00 00 00 61 65 72 6f 2e 69 6e 69 41 08 00 00   ....aero.iniA...
  92 00 00 00 75 00 00 00 77 00 00 00 75 00 00 00   ....u...w...u...
and the key is 7-248-6-221-246-250-21-49

Code: Select all

0x92 - '7' = '['
0x75 - '-' = 'H'
0x77 - '2' = 'E'
0x75 - '4' = 'A'
...

Gotcha? :)


Thanks, I've got it! I way using the 8 keys as a byte array, not a single string, so the sequence was:
i - 7
i - 248
i - 6
...
When I complete the app I'll post here. Thank you a lot for explain me the algorithm!
StarGT
Posts: 14
Joined: Tue Mar 17, 2015 7:41 am

Re: Assetto Corsa ACD extractor

Post by StarGT »

Why i have this when i try to open ini files in Notpad+++

DHADENaZ;LXDFR>: `8?W9^
M;^_UYHKa@4654& 0(JZЃlcyp!FrWofxwvguj^nPmANXRT]LL<SE=:$7B(ю 8 P`wcnsj`uZd#oj ^v_`e$qorlue!fsrnfww _wmk D=QDBTAKFdNEVMUEE6,57ю@N?HZENeAEVOIX==LEB/,0%/3(mi lfesgritrtfjkmi$aohhlqt01:cia_sgmnkj)btpm&jeankd~EDFYSM[ORIL7172,Dj|dtloj^efw]pghtds d`jzzjqhfm4e@C[GPcBLAKDR?_XMDHGZIJC=EY\HKMCZHJHDXC_LB>GESXDMZCYRFGMOGZLR5AJGdIERF_QU>SJ>iNV?GEGYDAPHdHZC[LD\YHE^_AROO>0&-R;AWeMCS_GJO[@*.:юEG?\TOJ=5/930CDL[LLKT4).;1
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Assetto Corsa ACD extractor

Post by aluigi »

You must use the script on the original data.acd file in the original location because the folder is the encryption key.
StarGT
Posts: 14
Joined: Tue Mar 17, 2015 7:41 am

Re: Assetto Corsa ACD extractor

Post by StarGT »

aluigi wrote:You must use the script on the original data.acd file in the original location because the folder is the encryption key.

but i want change specs on mod car
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Assetto Corsa ACD extractor

Post by aluigi »

First you must extract the files correctly, if you get garbage ini files like that it means you are doing it in the wrong way :)
StarGT
Posts: 14
Joined: Tue Mar 17, 2015 7:41 am

Re: Assetto Corsa ACD extractor

Post by StarGT »

all ini files corrupted, dont know why
http://www.mediafire.com/file/s09krcc7f ... a.acd/file
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Assetto Corsa ACD extractor

Post by aluigi »

What's the exact name of the folder containing that data.acd?
StarGT
Posts: 14
Joined: Tue Mar 17, 2015 7:41 am

Re: Assetto Corsa ACD extractor

Post by StarGT »

thanks i understand how