Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
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