Steam installeren
inloggen
|
taal
简体中文 (Chinees, vereenvoudigd)
繁體中文 (Chinees, traditioneel)
日本語 (Japans)
한국어 (Koreaans)
ไทย (Thai)
Български (Bulgaars)
Čeština (Tsjechisch)
Dansk (Deens)
Deutsch (Duits)
English (Engels)
Español-España (Spaans - Spanje)
Español - Latinoamérica (Spaans - Latijns-Amerika)
Ελληνικά (Grieks)
Français (Frans)
Italiano (Italiaans)
Bahasa Indonesia (Indonesisch)
Magyar (Hongaars)
Norsk (Noors)
Polski (Pools)
Português (Portugees - Portugal)
Português - Brasil (Braziliaans-Portugees)
Română (Roemeens)
Русский (Russisch)
Suomi (Fins)
Svenska (Zweeds)
Türkçe (Turks)
Tiếng Việt (Vietnamees)
Українська (Oekraïens)
Een vertaalprobleem melden
usage()
{
printf "%s\n%s\n" "usage: ${0} FILE [DIR]" "See ${0} --help"
exit
}
help()
{
cat << _EOF
usage: ${0} FILE [DIR]
FILE:
A BOHH (Border of her Heart) pak file (.pak)
DIR:
Optional directory to specify where to extract
_EOF
exit
}
[] && usage
[] && help
[] &&
{
printf "%s\n" "${1} is not a file"
usage
}
[] &&
{
printf "%s\n" "${1} is not a valid BOHH pak file"
usage
}
if []
then
mkdir -p ./"${2}"
else
mkdir -p ./"${1%%.*}"
fi
record_count=$(od -N 2 -j 8 -t u2 "${1}" | head -n 1 | sed 's/^.*\ //')
if
for record_index in $(seq "${record_count}")
do
value=$(( 12 + (record_index - 1) * 6 ))
file_name=$(od -N 2 -j "${value}" -t x2 "${1}" | head -n 1 | sed 's/^.*\ //')
file1_offset=$(od -N 4 -j "$(( value + 2 ))" -t u4 "${1}" | head -n 1 | sed 's/^.*\ //')
file2_offset=$(od -N 4 -j "$(( value + 8 ))" -t u4 "${1}" | head -n 1 | sed 's/^.*\ //')
file_size=$(( file2_offset - file1_offset ))
dd if="${1}" bs=1 count="${file_size}" skip="${file1_offset}" of="${2:-${1%%.*}}"/"${file_name}" 2> /dev/null
echo "\033[1m${record_index}\033[0m of \033[1m${record_count}\033[0m extracted"
tput cuu1
done
then
printf "\n%s\n" "Successfully extracted ${1}"
else
printf "\n%s\n" "Failed to extract ${1}"
exit
fi
id: bohhpak
application: Border of her Heart .pak file
endian: le
seq:
- id: magic
contents: [0x05, 0, 0, 0, 0x01, 0, 0, 0]
- id: recordcount
type: u2
- id: entrycount # probably for indexed filenames
type: u2
- id: filerecords
type: filerecord
repeat: expr
repeat-expr: recordcount
- id: empty
size: 2
- id: selfsize
type: u4
- id: entrytable
type: tableentry
repeat: expr
repeat-expr: entrycount
types:
filerecord:
seq:
- id: uniqueid
type: u2
- id: fileoffset
type: u4
tableentry:
seq:
- id: header
type: u2
- id: index
type: u2