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)

Group imports from Windows binaries

importsort This is a tool that I use to group imports from Windows binaries. Sometimes, you have a gigantic folder full of executables, and you want t

【☆ ゆう ☆ 】 15 Aug 27, 2022
Program to extract signatures from documents.

Extracting Signatures from Bank Checks Introduction Ahmed et al. [1] suggest a connected components-based method for segmenting signatures in document

Muhammad Saif Ullah Khan 9 Jan 26, 2022
Daiho Tool is a Script Gathering for Windows/Linux systems written in Python.

Daiho is a Script Developed with Python3. It gathers a total of 22 Discord tools (including a RAT, a Raid Tool, a Nuker Tool, a Token Grabberr, etc). It has a pleasant and intuitive interface to faci

AstraaDev 32 Jan 05, 2023
A simple Python app that generates semi-random chord progressions.

chords-generator A simple Python app that generates semi-random chord progressions.

53 Sep 07, 2022
Color getter (including method to get random color or complementary color) made out of Python

python-color-getter Color getter (including method to get random color or complementary color) made out of Python Setup pip3 install git+https://githu

Jung Gyu Yoon 2 Sep 17, 2022
Python based utilities for interacting with digital multimeters that are built on the FS9721-LP3 chipset.

Python based utilities for interacting with digital multimeters that are built on the FS9721-LP3 chipset.

Fergus 1 Feb 02, 2022
A thing to simplify listening for PG notifications with asyncpg

asyncpg-listen This library simplifies usage of listen/notify with asyncpg: Handles loss of a connection Simplifies notifications processing from mult

ANNA 18 Dec 23, 2022
Python HTTP Agent Parser

Features Fast Detects OS and Browser. Does not aim to be a full featured agent parser Will not turn into django-httpagentparser ;) Usage import ht

Shekhar 213 Dec 06, 2022
The producer-consumer problem implemented with threads in Python

This was developed using a Python virtual environment, I would strongly recommend to do the same if you want to clone this repository. How to run this

Omar Beltran 1 Oct 30, 2021
Early version for manipulate Geo localization data trough API REST.

Backend para obtener los datos (beta) Descripción El servidor está diseñado para recibir y almacenar datos enviados en forma de JSON por una aplicació

Víctor Omar Vento Hernández 1 Nov 14, 2021
Library for processing molecules and reactions in python way

Chython [ˈkʌɪθ(ə)n] Library for processing molecules and reactions in python way. Features: Read/write/convert formats: MDL .RDF (.RXN) and .SDF (.MOL

16 Dec 01, 2022
A quick username checker to see if a username is available on a list of assorted websites.

A quick username checker to see if a username is available on a list of assorted websites.

Maddie 4 Jan 04, 2022
✨ Voici un code en Python par moi, et en français qui permet d'exécuter du Javascript en Python.

JavaScript In Python ❗ Voici un code en Python par moi, et en français qui permet d'exécuter du Javascript en Python. 🔮 Une vidéo pour vous expliquer

MrGabin 4 Mar 28, 2022
A utility that makes it easy to work with Python projects containing lots of packages, of which you only want to develop some.

Mixed development source packages on top of stable constraints using pip mxdev [mɪks dɛv] is a utility that makes it easy to work with Python projects

BlueDynamics Alliance 6 Jun 08, 2022
A fast Python implementation of Ac Auto Mechine

A fast Python implementation of Ac Auto Mechine

Jin Zitian 1 Dec 07, 2021
Script for generating Hearthstone card spoilers & checklists

This is a script for generating text spoilers and set checklists for Hearthstone. Installation & Running Python 3.6 or higher is required. Copy/clone

John T. Wodder II 1 Oct 11, 2022
password generator

Password generator technologies used What is? It is Password generator How to Download? Download on releases Clone repo git clone https://github.com/m

1 Dec 16, 2021
Yet another retry utility in Python

Yet another retry utility in Python, avereno being the Malagasy word for retry.

Haute École d'Informatique de Madagascar 4 Nov 02, 2021
Extract XML from the OS X dictionaries.

Extract XML from the OS X dictionaries.

Joshua Olson 13 Dec 11, 2022
Tools to connect to and interact with the Mila cluster

milatools The milatools package provides the mila command, which is meant to help with connecting to and interacting with the Mila cluster. Install Re

Mila 32 Dec 01, 2022