RIAT is a free script compiler for Halo: Combat Evolved scripts

Rat In a Tube

RIAT is a free script compiler for Halo: Combat Evolved scripts.

To compile, you will need:

  • CMake 3.14 or newer
  • Python 3 or newer
  • C11 compiler

Example usage

RIAT comes with both a C and C++ header:

  • The C header allows you to use RIAT with more programming languages, but error handling and cleanup have to be triggered by the caller.
  • You can use the C++ header to take advantage of C++'s stronger type safety, automatic cleanup (via destructors), and exceptions. There are no exported C++ functions, as all C++ functions in the header are static and call C functions.
#include <riat/riat.hpp>
#include <filesystem>
#include <cstdio>
#include <string>

bool compile_scripts_cpp(const std::string &my_script_data, const std::filesystem::path &path) {
    // Instantiate our instance
    RIAT::Instance instance;

    // Load HSC data
    instance.load_script_source(my_script_data.c_str(), my_script_data.size(), path.filename().string().c_str());

    // Compile scripts
    try {
        instance.compile_scripts();
    }
    catch(RIAT::Exception &e) {
        std::fprintf(stderr, "Error: %s\n", e.what());
        return false;
    }

    // Final results
    std::printf("Scripts: %zu\n", instance.get_scripts().size());
    std::printf("Globals: %zu\n", instance.get_globals().size());
    std::printf("Nodes: %zu\n", instance.get_nodes().size());

    // NOTE: Cleanup is handled by RIAT::Instance's destructor, thus it will clean up when the function returns.
    return true;
}
#include <riat/riat.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>

bool compile_scripts_c(const char *my_script_data, size_t my_script_data_length, const char *filename) {
    // Store our results here
    bool result = false;
    const RIAT_Node *nodes;
    const RIAT_Global *globals;
    const RIAT_Script *scripts;
    size_t node_count, global_count, script_count;

    // Instantiate our instance
    RIAT_Instance *instance = riat_instance_new();
    if(instance == NULL) {
        goto cleanup;
    }

    // Load HSC data
    if(riat_instance_load_script_source(instance, my_script_data, my_script_data_length, filename) != RIAT_COMPILE_OK) {
        goto cleanup;
    }

    // Compile
    if(riat_instance_compile_scripts(instance) != RIAT_COMPILE_OK) {
        goto cleanup;
    }

    // Final results
    nodes = riat_instance_get_nodes(instance, &node_count);
    globals = riat_instance_get_globals(instance, &global_count);
    scripts = riat_instance_get_scripts(instance, &script_count);

    printf("Scripts: %zu\n", script_count);
    printf("Globals: %zu\n", global_count);
    printf("Nodes: %zu\n", node_count);

    cleanup:

    // Check if result is false. If so, check if we have an instance.
    if(!result && instance != NULL) {
        fprintf(stderr, "Error: %s\n", riat_instance_get_last_compile_error(instance, NULL, NULL, NULL));
    }

    // NOTE: Cleanup is required unless riat_instance_new returned NULL. If instance is NULL, this function will do nothing.
    riat_instance_delete(instance);

    return result;
}
Owner
Snowy
Loves cookies and open source! 🐭
Snowy
Similar Resources

Conjunto de scripts para treinar um Sistema de Recomendação Híbrido baseado nos algoritmos do scikit-learn

hybrid-rs-trainner Treine suas engines de recomendação with zero code! :) Sumário Sistemas de Recomendação Collaborative Filtering Content-Based Filte

Dec 17, 2022

Scripts to help create QUIC version test vectors in RFC 9001 format.

quic-test-vector Scripts to help create QUIC version test vectors in RFC 9001 format. Just type 'make all' to build everything. There are two tools he

Jan 21, 2022

A utility to compile IW engine legacy UI scripts.

MENU Tool A utility to compile IW engine legacy UI scripts. Supported Games IW5 (Call of Duty: Modern Warfare 3) Usage ./menu-tool.exe path Disclaim

Sep 21, 2022

A python script loader for Grand Theft Auto San Andreas

PyLoader Introduction This is a .asi plugin that allows writing custom Python scripts for GTA SanAndreas. This plugin is still in the early stages of

Nov 28, 2022

Simple and easy script language for your dead brain, or break time of you.

What is this trush? Shut up, this isnt a trush. Lol This is a easy and simple script language. Change the world. Rotation the world. BIG REVOLUTION OF

May 28, 2021

A new JS script plugin for flutter

js_script Run JS script. Usage // Create a JS context. JsScript script = JsScript(); // Define a class. var classInfo = ClassInfoTestClass( newI

Mar 8, 2022

This is Script tools from all attack Denial of service by C programming

RemaxDos Paltfrom Attack RemaxDos This is Script tools from all attack Denial of service Remax Box Team !. Features ! Cam overflow Syn Flooding. Smurf

Sep 11, 2022

A Roblox Script Executor made by me

Roblox Executor A self made Roblox Executor. Works with most scripts and rarely crashes How to use the Roblox Executor [+] - Download it, then compile

Jun 5, 2022

A Script to thin Universal Apps on macOS quickly

UBThinner A Script to thin Universal Apps on macOS quickly. It traverses through the given folder recursively, identifies any universal binaries and t

Dec 26, 2021
Related tags
Patterns - This is an experimental library that has evolved to P1371, proposed for C++23.

MPark.Patterns This is an experimental library that has evolved to P1371, being proposed for C++23. Introduction MPark.Patterns is an experimental pat

Dec 29, 2022
A FREE Windows C development course where we will learn the Win32API and reverse engineer each step utilizing IDA Free in both an x86 and x64 environment.
A FREE Windows C development course where we will learn the Win32API and reverse engineer each step utilizing IDA Free in both an x86 and x64 environment.

FREE Reverse Engineering Self-Study Course HERE Hacking Windows The book and code repo for the FREE Hacking Windows book by Kevin Thomas. FREE Book Do

Dec 27, 2022
Learn how to connect your Flexispot (LoctekMotion) desk to the internet. This repository contains a collection of scripts to get your started, combined with research and instructions.
Learn how to connect your Flexispot (LoctekMotion) desk to the internet. This repository contains a collection of scripts to get your started, combined with research and instructions.

(image source: Windows Central) Turn your LoctekMotion/FlexiSpot desk into a smart desk Recently I acquired a new standing desk from FlexiSpot. During

Dec 28, 2022
A collection of scripts written in many different programming languages and each developed independently to perform very specific tasks (big or small)

Script Collection A collection of scripts written in many different programming languages and each developed independently to perform very specific ta

Aug 31, 2021
emily - GNU/Linux applications and scripts launcher.

emily emily - GNU/Linux applications and scripts launcher. For What? Firstly emily has been maden as a replacement for i3-dmenu, because i don't like

May 13, 2022
Coleção de scripts para Linux que fornecem um Wallpaper dinâmico que muda com o tempo

DayPaper Solução básica de wallpaper dinâmico para Linux Introdução A maioria das engines de wallpapers animados são focadas em gifs, vídeos e slides

Nov 25, 2021
Tooling and Scripts for Hacking Super Street Fighter II Cabinets

sf-cabinet Tools and utilities for modifying SF2 Cabinets What This repository contains research and tooling around the mini Street Fighter 2 cabinet

Oct 29, 2022
PHP Encoder, protect PHP scripts in PHP 8 and PHP 7, High Performance, Compitable with X86_64, MIPS, ARM platform and Ubuntu/Centos/OpenWRT system.

What's FRICC2? FRICC2 is a PHP Script encryption tool. When you are developing a commercial software using PHP, the script can be distributed as encry

Dec 12, 2022
Collection of scripts and writeups

ctf-writeups Tree 0ctf-quals-2017 EasiestPrintf (pwn 150pts) char (pwn 132pts) diethard (pwn 183pts) pages (pwn 647pts) writeup uploadcenter (pwn 523p

Nov 15, 2022
This project contains three scripts to help working with the steam-runtime, especially outside of Steam.

This project contains three scripts to help working with the steam-runtime, especially outside of Steam. See these blog posts for more details: steam-

Sep 27, 2022