Skip to content

Commit

Permalink
Add vita-parse-core helper command
Browse files Browse the repository at this point in the history
  • Loading branch information
xfangfang committed Nov 27, 2024
1 parent 965ac58 commit 1bb64a5
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions psv/scripts/vita-parse/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
29 changes: 29 additions & 0 deletions psv/scripts/vita-parse/psv_debug.sh
Original file line number Diff line number Diff line change
@@ -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 <ftp_config> <elf_path>"
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"

0 comments on commit 1bb64a5

Please sign in to comment.