diff --git a/README.md b/README.md index d6317f700..4d579be97 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,11 @@ mv borealis_demo.self eboot.bin && \ curl --ftp-method nocwd -T eboot.bin ftp://192.168.1.140:1337/ux0:/app/BRLS00000/ && \ echo launch BRLS00000 | nc 192.168.1.140 1338 ``` +6. If your app crash, you can run the following command under the build directory to parse the dump file: + +```shell +docker run --rm -it -v $(pwd):/src xfangfang/vita_parse ftp://192.168.1.140:1337 borealis_demo +``` > 192.168.1.140 is the ip address of my psv > BRLS00000 is the demo app ID diff --git a/psv/scripts/vita-parse/Dockerfile b/psv/scripts/vita-parse/Dockerfile new file mode 100644 index 000000000..858318d87 --- /dev/null +++ b/psv/scripts/vita-parse/Dockerfile @@ -0,0 +1,14 @@ +FROM vitasdk/vitasdk:latest + +ADD psv_debug.sh . + +RUN apk update && \ + apk add python3 py3-pip && \ + wget https://github.com/xyzz/vita-parse-core/archive/refs/heads/master.zip && \ + unzip master.zip && \ + rm master.zip && \ + pip install -r vita-parse-core-master/requirements.txt --break-system-packages && \ + sed -i 's/from collections import MutableMapping/from collections.abc import MutableMapping/g' `python -c "import site; print(site.getsitepackages()[0])"`/elftools/construct/lib/container.py + +WORKDIR /vita-parse-core-master +ENTRYPOINT ["/psv_debug.sh"] diff --git a/psv/scripts/vita-parse/psv_debug.sh b/psv/scripts/vita-parse/psv_debug.sh new file mode 100755 index 000000000..36d743498 --- /dev/null +++ b/psv/scripts/vita-parse/psv_debug.sh @@ -0,0 +1,29 @@ +#!/bin/bash +set -e + +# This script is used to request the latest crash report from the PSV homebrew FTP server +# Tested with: https://github.com/devnoname120/vitacompanion +# Author: https://github.com/xfangfang + +if [ $# -lt 2 ]; then + echo -e "This script is used to request the latest crash report from the PSV homebrew FTP server" + echo -e "Usage: docker run --rm -v "'$(pwd)'":/src xfangfang/vita_parse " + echo -e "Example: \n\tdocker run --rm -v "'$(pwd)'":/src xfangfang/vita_parse ftp://192.168.1.140:1337 main.elf" + exit 1 +fi + +ftp_server="$1" +elf_path="$2" +reports_dir="ux0:/data" + +echo "===> Using FTP Config: $ftp_server" +echo "===> Requesting crash report list from $ftp_server/$reports_dir" +crash_report_path="$(curl -s "$ftp_server"/$reports_dir/ | awk '/\.psp2dmp/ {print $9}' | sort -r | head -n 1)" + +echo "===> Requesting latest report: $ftp_server/$reports_dir/$crash_report_path" +curl -o "$crash_report_path" -s "$ftp_server"/$reports_dir/"$crash_report_path" +echo "===> Saving crash report to $crash_report_path" + +python main.py "$crash_report_path" /src/"$elf_path" + +rm -f "$crash_report_path"