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)

Backman is a random/fixed background image setter for wlroots based compositors

backman Backman is a random/fixed background image setter for wlroots based compositors Dependencies: The program depends on swaybg, python3-toml (or

Hemish 3 Mar 09, 2022
Monte Carlo simulation of 3G rules

mc3g Monte Carlo simulation of 3G rules This project contains the Python code to do simulations of events according to the 3G rule (in German: "Geimpf

Jan Christoph Terasa 4 Nov 01, 2021
Simple profile athena generator for Fortnite Private Servers.

Profile-Athena-Generator A simple profile athena generator for Fortnite Private Servers. This profile athena generrator features: Item variants Get al

Fevers 10 Aug 27, 2022
Numbers-parser - Python module for parsing Apple Numbers .numbers files

numbers-parser numbers-parser is a Python module for parsing Apple Numbers .numbers files. It supports Numbers files generated by Numbers version 10.3

Jon Connell 154 Jan 05, 2023
Exports the local variables into a global dictionary for later debugging.

PyExfiltrator Julia’s @exfiltrate for Python; Exports the local variables into a global dictionary for later debugging. Installation pip install pyexf

6 Nov 07, 2022
A quick random name generator

Random Profile Generator USAGE & CREDITS Any public or priavte demonstrative usage of this project is strictly prohibited, UNLESS WhineyMonkey10 (http

2 May 05, 2022
An URL checking python module

An URL checking python module

Fayas Noushad 6 Aug 10, 2022
A set of Python scripts to surpass human limits in accomplishing simple tasks.

Human benchmark fooler Summary A set of Python scripts with Selenium designed to surpass human limits in accomplishing simple tasks available on https

Bohdan Dudchenko 3 Feb 10, 2022
Modest utility collection for development with AIOHTTP framework.

aiohttp-things Modest utility collection for development with AIOHTTP framework. Documentation https://aiohttp-things.readthedocs.io Installation Inst

Ruslan Ilyasovich Gilfanov 0 Dec 11, 2022
Control-Alt-Delete - Help Tux Escape Beastie's Jail!

Control-Alt-Delete Help Tux escape Beastie's jail by completing the following challenges! Challenges Challenge 00: Drinks: Tux needs to drink less. Ch

NDLUG 8 Oct 31, 2021
RapidFuzz is a fast string matching library for Python and C++

RapidFuzz is a fast string matching library for Python and C++, which is using the string similarity calculations from FuzzyWuzzy

Max Bachmann 1.7k Jan 04, 2023
EthTx - Ethereum transactions decoder

EthTx - Ethereum transactions decoder Installation pip install ethtx Requirements The package needs a few external resources, defined in EthTxConfig o

398 Dec 25, 2022
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
A workflow management tool for numerical models on the NCI computing systems

Payu Payu is a climate model workflow management tool for supercomputing environments. Payu is currently only configured for use on computing clusters

The Payu Organization 11 Aug 25, 2022
A library from RCTI+ to handle RabbitMQ tasks (connect, send, receive, etc) in Python.

Introduction A library from RCTI+ to handle RabbitMQ tasks (connect, send, receive, etc) in Python. Requirements Python =3.7.3 Pika ==1.2.0 Aio-pika

Dali Kewara 1 Feb 05, 2022
Prime Path Generator is a prime path generator used to generate prime paths.

Prime Path Generator is a prime path generator used to generate prime paths.

1 Nov 06, 2021
Brainfuck rollup scaling experiment for fun

Optimistic Brainfuck Ever wanted to run Brainfuck on ethereum? Don't ask, now you can! And at a fraction of the cost, thanks to optimistic rollup tech

Diederik Loerakker 48 Dec 28, 2022
A Python class for checking the status of an enabled Minecraft server

mcstatus provides an easy way to query Minecraft servers for any information they can expose. It provides three modes of access (query, status and ping), the differences of which are listed below in

Nathan Adams 1.1k Jan 06, 2023
Writing Alfred copy/paste scripts in Python

Writing Alfred copy/paste scripts in Python This repository shows how to create Alfred scripts in Python. It assumes that you using pyenv for Python v

Will Fitzgerald 2 Oct 26, 2021
Easy compression and extraction for any compression or archival format.

Tzar: Tar, Zip, Anything Really Easy compression and extraction for any compression or archival format. Usage/Examples tzar compress large-dir compres

DanielVZ 37 Nov 02, 2022