Skip to content

Instantly share code, notes, and snippets.

@unresolvedsymbol
Last active November 7, 2020 16:03
Show Gist options
  • Save unresolvedsymbol/8bcb77878198b0948a78bfae21012fb2 to your computer and use it in GitHub Desktop.
Save unresolvedsymbol/8bcb77878198b0948a78bfae21012fb2 to your computer and use it in GitHub Desktop.
Combined 3DSX SMDH extractor
#!/bin/sh
# Fully sh compatible :^)
# -=- V0idst4r -=-
# Simple script to extract SMDH from a combined 3DSX
# Doesn't do anything fancy, uses strings to find the SMDH
# For some reason bytes 0x20-0x24 where the SMDH offset should be yeilded me a scrambled offset
[ ! -f "$1" ] && {
echo "Usage: $0 <3dsx>"
exit 1
}
of=$(basename "$1").smdh
offset=$(strings -t d "$1" | grep SMDH | awk 'END{print $1}')
[ ! "$offset" ] && {
echo "[!] SMDH not found"
exit 1
}
dd if="$1" of="$of" ibs=1 skip=$offset count=14016 status=none
echo "[*] Wrote SMDH: $of"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment