jjdredd / ljd

LuaJIT raw-bytecode decompiler
MIT License
10 stars 7 forks source link

Decompiling Farming Simulator 17 .l32/.l64 scripts #7

Open thefoofighter opened 6 years ago

thefoofighter commented 6 years ago

Hi, I figure you probably don't work on this anymore but you are the best lead I have right now ^^.

I saw this and managed to get some of the FS15 scripts decompiled using ldj 2.1, Thanks! and great work.

I moved my attention to FS17 and it seems that this game has moved to a new model of storing their Luc data. Each script is now represented by a .l32 and .l64 file.

When using your ldj 2.1 branch I get the error:

Unknown flags set: 111101110000 Failed to read raw-dump header

It figures i guess that they have changed the headers between game versions.

I was wonder if you have time maybe you could have a quick look over these files and perhaps point me in the right direction?

I am hoping it may only require that I add new or modified headers to the ldj2.1 branch.

FS15 Samples: FS15 luc files.zip

FS17 Samples: FS17 luc files.zip

Thank you :)

jjdredd commented 6 years ago

When using your ldj 2.1 branch I get the error:

On which files? Does this work with .l32 files and not .l64 files in fs17 or does it work with fs15 files but not fs17 files?

thefoofighter commented 6 years ago

Hey, Sorry it works for FS15 and not FS17, Neither .l32 or .l64 decompiled for me.

KITT3000 commented 6 years ago

@jjdredd If you are working on a decompiler for files from FS17, I can provide source files and compiled from this game (version 1.3.1.0).

jjdredd commented 6 years ago

I have very limited time so at this point I just hope it's an easy fix.

thefoofighter commented 6 years ago

@KITT3000 What do you mean by Source files? the .l32/.l64 files or the Lua source?? :O

@jjdredd I understand, thanks for any help you can provide :)

jjdredd commented 6 years ago

Ok, I've added the new flag, however that doesn't seem to help.

KITT3000 commented 6 years ago

@thefoofighter In one update, Giants left the ".lua" files by mistake before the compilation.

thefoofighter commented 6 years ago

FS17 Lua & luc sample.zip @KITT3000 so they did! Thank you for that info. Having the source files should help alot when making decompiler. Not expecting you to do it @jjdredd but perhaps someone someday might get a chance,

@KITT3000 you hardly have binary/ida/x64dbg knowledge? I have used them on a few occasions to unlock abandonware but reverse engineering a compiled and maybe even encrypted format looks tough..

@jjdredd what was the new flag? If you need the whole source for testing some time I also have it now thanks to @KITT3000's pointer

KITT3000 commented 6 years ago

@thefoofighter Unfortunately not.

jjdredd commented 6 years ago

They could've changed the bytecode dump format. A binary of the game would help if it isn't stripped. And try not to break the tos/law by posting such files on GH.

jjdredd commented 6 years ago

well it isn't really "new" https://github.com/jjdredd/ljd/commit/90fefbd61d5326d28854240bac3cd41cc4f12a24

Pierrot08 commented 6 years ago

Hello, I have a problem using the decompiler, can you help me?

Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 17:26:49) [MSC v.1900 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information.

== RESTART: C:\Users\pierre-antoine\Downloads\ljd-ljv2.1\ljd-ljv2.1\main.py == Traceback (most recent call last): File "C:\Users\pierre-antoine\Downloads\ljd-ljv2.1\ljd-ljv2.1\main.py", line 123, in retval = main() File "C:\Users\pierre-antoine\Downloads\ljd-ljv2.1\ljd-ljv2.1\main.py", line 75, in main file_in = sys.argv[1] IndexError: list index out of range C:/Users/pierre-antoine/Downloads/FS17.luc.files/FS17 luc files/Gui.l32 SyntaxError: invalid syntax

thefoofighter commented 6 years ago

@Pierrot08 That is because the decompiler doesn't currently work on FS17 compiled lua code.

Pierrot08 commented 6 years ago

ha sorry my error above that I launched the decomplileur in python and not in CMD For luc no worries ^^ but for the same error as you, hoping that you find a solution Sorry for the inconvenience

thefoofighter commented 6 years ago

@Pierrot08 Np, if you want to have a look at the source get a hold of the 1.3.1 update and using universal extractor dump the contents to a folder, find the .gar files and extract with quickbms & giants config.

The .lua's are intact and i doubt there are too many major changes to 1.5.1 Good source to learn how Giants made some things to help with modding ^^

Good Luck :)

naruken16 commented 6 years ago

hello sorry how to start the main.py file? and what phyton version should I use?

KITT3000 commented 6 years ago

@naruken16 Read it: https://github.com/jjdredd/ljd/blob/bugfix/README.md I used version 3.5+ on Linux Mint and there the command was: python3 main.py script.luc Of course, before I went to the directory with the decompiler files and threw in the decompilation file there.

naruken16 commented 6 years ago

thanks

naruken16 commented 6 years ago

have this error Unknown flags set: 1111111000 Failed to read raw-dump header

Eepsquared commented 5 years ago

Any update on this and progress towards reading FS19's L32/L64 files?

More info: https://zenhax.com/viewtopic.php?t=4094