Skip to content

Instantly share code, notes, and snippets.

@x4fx77x4f
x4fx77x4f / decrypt_gdec.lua
Last active September 28, 2024 17:06
Decrypt Godot Engine GDEC files and Looking Up I See Only A Ceiling save files and The Relapse assets
#!/usr/bin/env luajit
local argparse = require("argparse")()
argparse:argument("input_path")
argparse:argument("output_path", nil, "-")
argparse:mutex(
argparse:option("--password"),
argparse:option("--key")
)
local arguments = argparse:parse()
@x4fx77x4f
x4fx77x4f / decrypt.lua
Created August 12, 2024 06:16
Unpack gluapack
#!/usr/bin/env luajit
local argparse = require("argparse") -- https://github.com/luarocks/argparse
argparse = argparse(nil, "Decrypt and/or decompress a gluapack file.")
argparse:argument("file", "Path to file to read from, or \"-\" for standard input. Should be in \"garrysmod/download/data/gluapack/\".")
argparse:argument("key", "Value of \"gluapack_key\" console variable.")
argparse:option("--md5", "Value of \"gluapack_md5\" console variable.")
argparse:option("--output", "Path to file to write to, or \"-\" for standard output.", "-")
argparse:option("--output-at", "Which stage of processing to stop at before outputting.", "decompressed"):choices({
"decrypted",
"skipped",
@x4fx77x4f
x4fx77x4f / voice_ban.hexpat
Created June 25, 2024 20:00
voice_ban.dt parser for ImHex
// informed by https://github.com/tmp64/BugfixedHL-Rebased/blob/7538c9ea954133e6c4dd1ca31ed8579861bace54/src/game/client/voice_banmgr.cpp#L15
#include <std/mem.pat>
#include <std/string.pat>
#include <std/sys.pat>
#pragma endian little
struct ban_t {
char community_id[32];
// https://developer.valvesoftware.com/wiki/SteamID#Steam_ID_as_a_Steam_Community_ID
// consists of "[U:1:", some digits, "]", then null bytes pad the rest.
};
@x4fx77x4f
x4fx77x4f / x_mwm.cfg
Created June 6, 2024 07:12
WIP onehanded TF2 config
// Usage:
// 1. Save this file to "tf/cfg/x_mwm.cfg".
// 2. Add line "exec x_mwm" to "tf/cfg/autoexec.cfg".
// Scroll up to shift up a gear.
// Scroll down to shift down a gear.
// Gear range is 1 to 3. Default gear is 2.
// Gear 1 moves forward.
// Gear 2 stands still.
// Gear 3 moves backward.
// Assumes WASD. W and S behave as normal and additionally set gear to 2.
@x4fx77x4f
x4fx77x4f / create_p64_rom.lua
Created March 27, 2024 18:13
Picotron .p64.rom extraction and creation
#!/usr/bin/env luajit
local argparse = require("argparse")(nil, [[Create a Picotron .p64.rom.
Dependencies:
sudo apt install liblz4-1 luajit luarocks
luarocks install luaposix --local]])
argparse:argument("input_path", "Directory to read files from.")
argparse:argument("output_path", "Path to save .p64.rom to.")
local arguments = argparse:parse()
local input_path = arguments.input_path
local output_path = arguments.output_path
@x4fx77x4f
x4fx77x4f / bit.lua
Created January 12, 2024 18:10
Pure Lua bitwise operations library compatible with Lua BitOp/LuaJIT
--[[
This file provides a library for bitwise operations. It is intended to
be compatible with Lua BitOp which itself is intended to be compatible
with the "bit" library bundled with LuaJIT. It is *not* compatible with
the "bit32" library bundled with Lua 5.2 and higher. For usage, consult
the Lua BitOp documentation:
https://bitop.luajit.org/api.html
https://bitop.luajit.org/semantics.html
]]
local string_format = string.format
@x4fx77x4f
x4fx77x4f / tdetool2.lua
Created November 16, 2023 22:45
Decrypt Teardown ".tde" files.
#!/usr/bin/env luajit
local argparse = require("argparse") -- https://github.com/mpeterv/argparse
local parser = argparse("./tdetool2.lua", "Decrypt and reencrypt Teardown's \".tde\" files.")
parser:argument("input", "Input file(s)."):args("+")
parser:option("-o --output", "Output file.")
parser:option("--working-directory"):hidden(true)
local args = parser:parse()
if #args.input > 1 and args.output ~= nil then
parser:error("cannot use output option with more than one input argument")
end
@x4fx77x4f
x4fx77x4f / hydra5-x64.c
Last active January 16, 2024 15:15
Analytics disabler for Teardown.
#define NULL ((void*) 0)
__declspec(dllexport) int hydra5_client_connect_developer(void* _1, void* _2) {
return 1;
}
__declspec(dllexport) int hydra5_client_connect_steam(void* _1, void* _2) {
return 1;
}
__declspec(dllexport) void* hydra5_client_create(void* _1) {
return NULL;
}
@x4fx77x4f
x4fx77x4f / unsubscribe_unavailable.js
Last active July 24, 2025 19:17
Unsubscribe unavailable Teardown mods
/*
# unsubscribe_unavailable.js
This script will go through your Steam Workshop mod subscriptions for
Teardown mods and unsubscribe from any that are unavailable (e.g. private).
## Usage:
1. Open a tab to any page on the steamcommunity.com domain
2. Open developer tools (Ctrl+Shift+I or F12)
3. Go to "Console" tab
4. Copy and paste the contents of this file into it
4.a.: Don't do this unless you trust me. Malicious code in the developer
@x4fx77x4f
x4fx77x4f / x_freecam.lua
Created May 28, 2023 22:54
Simple freecam script for Garry's Mod.
local identifier = "x_freecam"
local self = _G[identifier]
local function unload()
local hook_tbl = self.hook_tbl
if hook_tbl ~= nil then
for hook_name, hook_name_tbl in pairs(hook_tbl) do
for hook_id, func in pairs(hook_name_tbl) do
hook.Remove(hook_name, hook_id)
end
end