Decompiling the Darktide Source Code (Windows/Linux)

Thanks to smart people, we have the tools to decompile the source code for Warhammer 40,000: Darktide into readable Lua code.

These tools come with instructions, but lazy people (me) get annoyed at having to read two documents (oh the horror), so I just collated them into this page for convenience. Consequently, I don't cover every single option because that's more reading I don't care to do.

The main instructions will be written from a Windows perspective. I'm assuming you are familiar with moving folders and files around, but I'll treat you like an idiot because that's how I like to be treated (wait what who said that). Linux instructions are below.

Requirements

Instructions

  1. Extract limn and the decompiler to a folder, which I'll call "Decompiling Folder" from now on
    Decompiling Folder
     |
     |---> limn.exe
     |---> README.md
     |---> luajit-decompiler-v2.exe
     |---> luajit-decompiler-v2.pdb
    
  2. Open the command prompt (cmd.exe) or PowerShell
  3. (Optional) In the command prompt, move to the Decompiling Folder
  4. Run limn on your Darktide game folder, through the command prompt
  5. Run luajit-decompiler on the out folder
  6. You're done! Read the output with your method of choice

Linux Instructions

Previously, there were native versions for limn. However, newer versions (0.6.1+) are Windows only since they rely on using Darktide's decompression algorithm. Details on the commands are in the tool READMEs and above instructions; this is just how to get it to run on Linux.

  1. Have wine installed
  2. Open the terminal to the Decompiling Folder
  3. Run limn through wine: wine ./limn.exe -i "<darktide_install_folder>/bundle"
  4. Now the source code is in its bytecode form. Run the luajit decompiler to make it human-readable

Uploading These Files

The Darktide community hosts a copy of these in a GitHub repository, maintained by Aussiemoon. If you decompiled the code before Aussiemoon caught up to the latest patch, you can make a pull request (PR), if you have a GitHub account. However, make sure you have the latest versions of both tools.

  1. Fork the repository
  2. Clone your fork locally
  3. Replace the contents of your fork (besides the README) with the contents of the output folder
  4. Upload it with git
  5. Make a PR
    1. Compare across forks
    2. Select the main branch of your fork
    3. Fill out and submit the PR