Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
source="$1"
source_size=$(stat -c %s "$source")
offsets=( $(grep --only-matching --byte-offset --binary --text Creative "$source" | cut -d : -f 1) )
# setting the last offset to the size of the file
offsets[${#offsets[@]}]=$source_size
for ((i = 0; i < $(( ${#offsets[@]} - 1 )); i++)); do
#!/bin/bash
# $1 - exe part of the archive
# Note:
# Game ID can also be obtained as
# game_id=$(curl -s -o- "$gog_game_url" | pcregrep --buffer-size 1M -o1 "addToCart\('/cart/add/(\d+)'\)")
rar_header='526172211a07'
#!/bin/bash
# Usage: gog_system_shock_demo_extract_music.sh <data_dir>
#
# The script relies on these utilities:
# 1. Wwise BNK File Extractor.
# Source: https://github.com/eXpl0it3r/bnkextr
#
# 2. sox
#
#!/bin/bash
# Configuration:
#
# WINEPREFIX what prefix to use (or will use the default).
# WINEPATH custom location of Wine if needed (custom variable for the script).
#
# Uses wine_env.sh
# Note, winetricks requires using WoW64 build of Wine.
#!/bin/bash
# Make sure you have bbe (binary block editor) installed.
# Run this from inside the Outlaws install directory.
files_to_patch=(
glide2x.dll
glide3x.dll
glide.dll
lecaur3d.dll
#!/bin/bash
# Analysis of obfsuscated KoTOR II audio
#
# *** Stock mp3 encoded with lame
# position of LAME : 0x09c (156)
# position of Info : 0x024 (36)
#
# *** KoTOR II obfuscated audio (using bed_001ebo.wav)
# position of LAME : 0xc7 (199)
#!/bin/bash
# Shows status of selected wine dlls (like for DX11).
# Inspired by https://www.winehq.org/winapi_stats.
# The script works best in terminals with true color support,
# but it should work with less colors as well.
function no_clr()
{
printf '\x1b[0m'
#!/bin/bash
# Usage: gog_dex_extract_music.sh <data_dir>
#
# The script relies on these utilities:
# 1. QuickBMS extractor (quickbms)
# See http://aluigi.altervista.org/quickbms.htm
# Source: http://aluigi.altervista.org/papers/quickbms_src.zip
#
# 2. Unity BMS script to be used with QuickBMS (unity.bms)
@shmerl
shmerl / wordle.sh
Last active February 7, 2022 07:59
A simple version of Wordle game
#!/bin/bash
#
# Uses ripgrep (rg)
#
length=${length:-5}
tries=${tries:-6}
# All words of given length from a dictionary
#!/bin/bash
# Run from location where you have audio
# from the <game-dir>/streammusic directory
mp3s=(
[0-5]*.wav
mus_{a,b,t}*.wav
evil_ending.wav
credits.wav