Skip to content

Instantly share code, notes, and snippets.

View ccawley2011's full-sized avatar

Cameron Cawley ccawley2011

View GitHub Profile
@ccawley2011
ccawley2011 / list_dlls.sh
Created April 22, 2021 18:10
Bash script to copy all DLLs needed by an application
#!/bin/sh
SKIP_DLLS=
DLL_PATH=/mingw/bin
OUTDIR=.
scan_executable() {
for i in `objdump -p $1 | grep 'DLL Name:' | cut -d ' ' -f 3`; do
if [[ ! "$SKIP_DLLS" =~ "$i" ]]; then
echo $1: $i
@ccawley2011
ccawley2011 / srcrename
Created July 30, 2020 12:03
Bash script to convert a source code tree for use on RISC OS
#!/bin/bash
ACTION="ln -sf"
if [ $# -lt 2 ]; then
echo "usage: $0 srcdir dstdir"
exit 1
fi
SRCDIR=$1
DSTDIR=$2
@ccawley2011
ccawley2011 / dgamer.bms
Created June 15, 2016 17:19
QuickBMS script to unpack .fun files used by DGamer
# DGamer .fun unpacker
# By Cameron Cawley
get NAMES long
math NAMES += 24
get NAMESLEN long
get POINTERS long
get POINTERSLEN long
do
@ccawley2011
ccawley2011 / Sim2000.bms
Created June 15, 2016 17:17
QuickBMS script to unpack SC2000.DAT in Sim City 2000
# Sim City 2000 SC2000.DAT unpacker
# By Cameron Cawley
getdstring NAME 12
get OFFSET long
math COUNT = OFFSET
math COUNT /= 16
for i = 1 <= COUNT
getdstring NEXTNAME 12
@ccawley2011
ccawley2011 / 4Mation.bms
Created June 15, 2016 17:15
QuickBMS script to unpack archives in 4Mation games
# 4Mation archive unpacker
# By Cameron Cawley
IDString "BIIK-DJC"
get ARCHIVE_SIZE asize
goto 20
get FILEINDEX long
goto FILEINDEX
get TEMP long
get INDEXSIZE long
@ccawley2011
ccawley2011 / gsp_run.bms
Created June 15, 2016 17:14
QuickBMS script to unpack gsp_run.dat in various games published by GSP
# gsp_run.dat unpacker
# By Cameron Cawley
get ARCHIVE_SIZE asize
math ARCHIVE_SIZE += 1
math OFFSET = 0
do
goto OFFSET
get NAME_LENGTH long
@ccawley2011
ccawley2011 / SADX.bms
Created June 15, 2016 17:13
QuickBMS script to unpack .dat files in Sonic Adventure DX
# Sonic Adventure DX .dat unpacker
# By Cameron Cawley
# Based on information from https://info.sonicretro.org/SCHG:Sonic_Adventure_DX:_PC/Sound_Editing/Sound_Effects#Format
getdstring IDSTR 16
set ID04 binary "archive V2.2\0\0\0"
set ID10 binary = "archive V2.DMZ\0"
if IDSTR == ID04
elif IDSTR == ID10
else
@ccawley2011
ccawley2011 / SCDsounds.bms
Created June 15, 2016 17:11
QuickBMS script to unpack pcm8.cmp in Sonic CD (PC 1996)
# Sonic CD (PC 1996) pcm8.cmp unpacker
# By Cameron Cawley
# Based on information from https://info.sonicretro.org/SCHG:Sonic_CD_(PC)#Sound_Effects
IDString "OTHE"
get EOF long
get COUNT long
get OFFSET long
for i = 0 < COUNT
@ccawley2011
ccawley2011 / SCCmods.bms
Created June 12, 2016 16:48
QuickBMS script to unpack .mods files in Sonic Classic Collection
# Sonic Classic Collection .mods unpacker
# By Cameron Cawley
get COUNT long
set POSITION long 4
for i = 0 < COUNT
get FIRSTPTR long
math POSITION += 4
get NEXTPTR long
if FIRSTPTR != NEXTPTR