Border of her Heart

Border of her Heart

View Stats:
< >
Showing 1-5 of 5 comments
Tuomo L  [developer] Apr 25, 2021 @ 10:55pm 
Oops what?
Cheetah Pixie Apr 26, 2021 @ 1:30am 
I figured out your .pak format and ripped the files. Interesting usage of nv here.
Cheetah Pixie Apr 26, 2021 @ 2:14am 
#!/bin/sh

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
Cheetah Pixie Apr 26, 2021 @ 2:19am 
meta:
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
Tuomo L  [developer] Apr 26, 2021 @ 10:50pm 
Cool.
< >
Showing 1-5 of 5 comments
Per page: 1530 50