A simple language and reference decompiler/compiler for MHW THK Files

Overview

Leviathon

Project Logo A simple language and reference decompiler/compiler for MHW THK Files.

Project Goals

The project aims to define a language specification for working with THK and THKLST files as code. In that sense it aims to be a mid-level language abstraction of the low-level language which the THK comprise, providing higher level features such as named functions, action name resolution, importable behavior libraries and behavior frameworks.

The Leviathon language consists of three formats:

Fandirus (Fand) Files

Fand files are project definitions (which are decompiled from THKLST files). They define what file is tied to which behavior group. Their structure is defined on the Fand Specification File.

Fand files are named after Fandirus, AI Research Pioneer who established most of the basis of what's known about the execution of the thk format and author of the biggest AI editing project in MHW (MHWI: Stories mod).

NackDN (Nack) Files

Nack files are the Think Table decompilation results. They define the AI of a monster for a given context (In-Combat, Out-Of-Comabt, Turf War). Their Structure is defined on the Nack Specification File.

Nack files are named after NackDN, human repository of THK files knowledge and documentation. He formalized and documented a considerable amount of Fandirus loose findings, and more importantly authored the THK Graphical Editor Tool for THK Research without which this project wouldn't even have been started.

Forked Functional Extension (FExtY) Files

FExtY files are dynamical language extensions which enable the compiler and decompiler to elegantly resolve THK Function Types into human readable code and viceversa. Their structure is defined on the FExtY Specification File.

FExtY files are named after Fexty, a relative newcommer to Monster AI Editing Research who performed vital decompilation and documentation work of the game internal switch cases functions as well as authored the AI Extension Framework to enable modders to add custom Function Types (which can be compatibilized with this tool through the FExtY files).

Aditional Credits

Monster THK editing is a rich and storied field which has had numerous contributors, it's almost impossible to provide an extensive listing of findings per credit as the early history is riddled with undocumented findings and oral tradition. In chronological order:

  • hexhexhex
  • Fandirus
  • NekotagaYuhatora
  • Freschu
  • NackDN
  • AsteriskAmpersand
  • Stracker
  • Fexty

Special Thanks

Additional credit is given to Fandirus, NackDN, Silvris and Fexty for assisting with the language specification and target feature list.

The ABC Reference Compiler-Decompiler

Compiler Logot

A reference Compiler-Decompiler which implements the Leviathon Specification is provided for actual practical usage. At the time only decompilation is implemented.

The decompiler is written in Python using the Construct library for binary parsing.

You might also like...
A tool written in python to generate basic repo files from github
A tool written in python to generate basic repo files from github

A tool written in python to generate basic repo files from github

This tool analyzes the json files generated by stream-lnd-htlcs to find hidden channel demand.

analyze_lnd_htlc Introduction Rebalancing channels is an important part of running a Lightning Network node. While it would be great if all channels c

Napari plugin for loading Bitplane Imaris files .ims

napari-imaris-loader Napari plugin for loading Bitplane Imaris files '.ims'. Notes: For this plugin to work "File/Preferences/Experimental/Render Imag

These scripts look for non-printable unicode characters in all text files in a source tree

find-unicode-control These scripts look for non-printable unicode characters in all text files in a source tree. find_unicode_control.py should work w

A utility tool to create .env files

A utility tool to create .env files dump-env takes an .env.template file and some optional environmental variables to create a new .env file from thes

Python program for analyzing the output files of phonopy.
Python program for analyzing the output files of phonopy.

PhononTools Description Python program to analyze the results generated by phonopy. Using the .yaml and .dat files that phonopy generates one can plot

Data Utilities e.g. for importing files to onetask

Use this repository to easily convert your source files (csv, txt, excel, json, html) into record-oriented JSON files that can be uploaded into onetask.

A script to check for common mistakes in LaTeX source files of scientific papers.

LaTeX Paper Linter This script checks for common mistakes in LaTeX source files of scientific papers. Usage python3 paperlint.py file.tex [-i/x inc

python package for generating typescript grpc-web stubs from protobuf files.

grpc-web-proto-compile NOTE: This package has been superseded by romnn/proto-compile, which provides the same functionality but offers a lot more flex

Comments
  • register_alias in fandLexParse.py

    register_alias in fandLexParse.py

    Hello AsteriskAmpersand,

    Line 41 in fandLexParse.py: register_alias = T_ALIAS + "\s+" + parens("$[A-T]")

    So the alias of a RegisterVar is allowed to be from A to T in this case. If a FAND-file has "U" as alias of a RegisterVar, Lexer from python module SLY will report error when the FAND-file is being compiled. For example, the FAND-file decompiled from em013.thklst of Fatalis has "U" as an alias.

    Best regards, Yu-Yun

    opened by yuyunlu 0
Releases(0.5.1)
  • 0.5.1(Jan 7, 2023)

  • 0.5.0(Jan 9, 2022)

    -Fixed Major Issues Involving Library Compilation: -- Fixed outright non-functional code pathways related to library resolution -- Registers now correctly resolve constants when they are targets of comparisons -- Fixed broken error upstreaming pathways during library includes -- Significantly overhauled error reporting in several library include use cases

    • Can now import constants from libraries

    • Fixed Macro Preprocessor being completely non-functional

    • Fixed Major Disfunction when Hard Coding Registers

    • Updated Error Messages to disambiguate previously identical reports

    Source code(tar.gz)
    Source code(zip)
    ABCompiler.exe(387.76 MB)
  • 0.4.1(Jan 4, 2022)

  • 0.4.0(Dec 18, 2021)

    Fixed a major issue with compiling of functions with secondary arguments

    Re-enabled Library compiling functionality (thanks to Chantox for reporting)

    Extended the ETL with:

    • Native Function Negation
    • Self Healing and Damaging
    • Stamina Increase and Decrease
    • Enraging
    • Enrage Prolongation
    • Set Corpse Duration

    Included the ETL next to the Release. Users are free to package the ETL with their mods freely, with the exception of any website that requires transfer of ownership of the files being uploaded (such as Nexus).

    Source code(tar.gz)
    Source code(zip)
    ABCompiler.exe(9.21 MB)
    ETL.dll(13.00 KB)
    ETL.json(4.05 KB)
  • 0.3.0(Dec 15, 2021)

    Breaking Changes:

    • Fixed Major Error Regarding Register Comparisons
    • (GT/GEQ and LT/LEQ were switched around.)
    • Recompiling previously made files will cause major issues.

    Non-Breaking Changes:

    • Added absolute value as unary operator ||
    Source code(tar.gz)
    Source code(zip)
    ABCompiler.exe(9.21 MB)
  • 0.2.1(Dec 14, 2021)

  • 0.2.0(Dec 9, 2021)

  • 0.1.0(Dec 6, 2021)

Owner
null
Utility to extract Fantasy Grounds Unity Line-of-sight and lighting files from a Univeral VTT file exported from Dungeondraft

uvtt2fgu Utility to extract Fantasy Grounds Unity Line-of-sight and lighting files from a Univeral VTT file exported from Dungeondraft This program wo

Andre Kostur 29 Dec 5, 2022
iOS Snapchat parser for chats and cached files

ParseSnapchat iOS Snapchat parser for chats and cached files Tested on Windows and Linux install required libraries: pip install -r requirements.txt c

null 11 Dec 5, 2022
Lock files using python and cmd

Python_Lock_Files Lock files using python and cmd license feel free to do whatever you want to with these files, i dont take any responsibility tho, u

null 1 Nov 1, 2021
Find unused resource keys in properties files in a Salesforce Commerce Cloud project and get rid of them.

Find Unused Resource Keys Find unused resource keys in properties files in a Salesforce Commerce Cloud project and get rid of them. It looks through a

Noël 5 Jan 8, 2022
A script copies movie and TV files to your GD drive, or create Hard Link in a seperate dir, in Emby-happy struct.

torcp A script copies movie and TV files to your GD drive, or create Hard Link in a seperate dir, in Emby-happy struct. Usage: python3 torcp.py -h Exa

ccf2012 105 Dec 22, 2022
A small utility that sorts your files.

FileSorter A small utility that sorts your files. TODO: Scan directory to find files(thanks @corruptmemry for this!) Split extensions to determine fil

null 2 Jun 16, 2022
Edit SRT files to delay subtitle time-stamps.

subtitle-delay A program written in Python that directly edits SRT file to delay the subtitles. Features: Will throw an error if delaying with negativ

null 8 Jul 17, 2022
Blender 2.93 addon for loading Quake II MD2 files

io_mesh_md2 is a Blender 2.93 addon for importing Quake II MD2 files.

Joshua Skelton 11 Aug 31, 2022
This code renames subtitle file names to your video files names, so you don't need to rename them manually.

Rename Subtitle This code renames your subtitle file names to your video file names so you don't need to do it manually Note: It only works for series

Mostafa Kazemi 4 Sep 12, 2021
produces PCA on genotypes from fasta files (popPhyl's ID format)

popPhyl_PCA Performs PCA of genotypes. Works in two steps. 1. Input file A single fasta file containing different loci, in different populations/speci

camille roux 2 Oct 8, 2021