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)

A simulator for xkcd 2529's weirdly concrete problem

What is this? This is a quick hack implementation of a simulator for xkcd 2529's weirdly concrete problem. This is barely tested and I suck at computa

Reuben Steenekamp 6 Oct 27, 2021
Run async workflows using pytest-fixtures-style dependency injection

Run async workflows using pytest-fixtures-style dependency injection

Simon Willison 26 Jun 26, 2022
Animation retargeting tool for Autodesk Maya. Retargets mocap to a custom rig with a few clicks.

Animation Retargeting Tool for Maya A tool for transferring animation data and mocap from a skeleton to a custom rig in Autodesk Maya. Installation: A

Joaen 63 Jan 06, 2023
Software to help automate collecting crowdsourced annotations using Mechanical Turk.

Video Crowdsourcing Software to help automate collecting crowdsourced annotations using Mechanical Turk. The goal of this project is to enable crowdso

Mike Peven 1 Oct 25, 2021
Rabbito is a mini tool to find serialized objects in input values

Rabbito-ObjectFinder Rabbito is a mini tool to find serialized objects in input values What does Rabbito do Rabbito has the main object finding Serial

7 Dec 13, 2021
Dynamic key remapper for Wayland Window System, especially for Sway

wayremap Dynamic keyboard remapper for Wayland. It works on both X Window Manager and Wayland, but focused on Wayland as it intercepts evdev input and

Kay Gosho 50 Nov 29, 2022
A python module to validate input.

A python module to validate input.

Matthias 6 Sep 13, 2022
A python package containing all the basic functions and classes for python. From simple addition to advanced file encryption.

A python package containing all the basic functions and classes for python. From simple addition to advanced file encryption.

PyBash 11 May 22, 2022
Here, I find the Fibonacci Series using python

Fibonacci-Series-using-python Here, I find the Fibonacci Series using python Requirements No Special Requirements Contribution I have strong belief on

Sachin Vinayak Dabhade 4 Sep 24, 2021
a tool for annotating table

table_annotate_tool a tool for annotating table motivated by wiki2bio,we create a tool to annoate all types of tables,this tool can annotate a table w

wisdom under lemon trees 4 Sep 23, 2021
Standard implementations of FedLab and its provided benchmarks.

FedLab-benchmarks This repo contains standard implementations of FedLab and its provided benchmarks. Currently, following algorithms or benchrmarks ar

SMILELab-FL 104 Dec 05, 2022
A Randomizer Oracle

Tezos Randomizer Tezod Randomizer "Oracle". It's a smart contract that you can call to get a random number between X and Y (for now). It uses entropy

Asbjorn Enge 19 Sep 13, 2022
pydsinternals - A Python native library containing necessary classes, functions and structures to interact with Windows Active Directory.

pydsinternals - Directory Services Internals Library A Python native library containing necessary classes, functions and structures to interact with W

Podalirius 36 Dec 14, 2022
PyResToolbox - A collection of Reservoir Engineering Utilities

pyrestoolbox A collection of Reservoir Engineering Utilities This set of functio

Mark W. Burgoyne 39 Oct 17, 2022
Pampy: The Pattern Matching for Python you always dreamed of.

Pampy: Pattern Matching for Python Pampy is pretty small (150 lines), reasonably fast, and often makes your code more readable and hence easier to rea

Claudio Santini 3.5k Jan 06, 2023
A repo for working with and building daos

DAO Mix DAO Mix About How to DAO No Code Tools Getting Started Prerequisites Installation Usage On-Chain Governance Example Off-Chain governance Examp

Brownie Mixes 86 Dec 19, 2022
Check the basic quality of any dataset

Data Quality Checker in Python Check the basic quality of any dataset. Sneak Peek Read full tutorial at Medium. Explore the app Requirements python 3.

MalaDeep 8 Feb 23, 2022
Keval allows you to call arbitrary Windows kernel-mode functions from user mode, even (and primarily) on another machine.

Keval Keval allows you to call arbitrary Windows kernel-mode functions from user mode, even (and primarily) on another machine. The user mode portion

42 Dec 17, 2022
Customized python validations.

A customized python validations.

Wilfred V. Pine 2 Apr 20, 2022
Conveniently measures the time of your loops, contexts and functions.

Conveniently measures the time of your loops, contexts and functions.

Maciej J Mikulski 79 Nov 15, 2022