add psn_package_npdrm
authorMazet Laurent <mazet@softndesign.org>
Tue, 5 Dec 2023 22:36:21 +0000 (23:36 +0100)
committerMazet Laurent <mazet@softndesign.org>
Tue, 5 Dec 2023 22:36:21 +0000 (23:36 +0100)
iso2ps2
psn_package_npdrm/psn_package_npdrm [new file with mode: 0755]
psn_package_npdrm/psn_package_npdrm.exe [new file with mode: 0644]

diff --git a/iso2ps2 b/iso2ps2
index a77f938d9a31ded41a44b812b9fd4efa50b569ea..fd26b5f89de4288761695e122168520f2e837982 100755 (executable)
--- a/iso2ps2
+++ b/iso2ps2
@@ -3,6 +3,8 @@
 # default values
 PROGNAME=$(basename $0)
 KLICENSE="e4e54fd67c16c316f47829a30484d843"
+PS2CLASSIC=ps2classic/ps2classic
+PSNPACKAGE=psn_package_npdrm/psn_package_npdrm
 
 # defaut values
 id=0
@@ -52,7 +54,6 @@ echo "Title: '$title'"
 mkdir $serial
 tar -C $serial -xzf skeleton.tgz
 
-
 # images:
 # - ICON0.PNG 320x176
 # - PIC0.PNG 1000x560
@@ -71,7 +72,7 @@ fi
 # screenshot
 touch .touch
 find $HOME/.config/PCSX2/snaps/ -type f | xargs rm .touch
-#pcsx2 "$file"
+pcsx2 "$file"
 capture=$(find $HOME/.config/PCSX2/snaps/ -type f | sort)
 if [ "$capture" ]; then
     cp "$capture" tmp.png
@@ -90,7 +91,21 @@ echo -n $title | xxd | xxd -r -s 0x108 - $serial/PARAM.SFO
 echo -n $CID | xxd | xxd -r -s 0x188 - $serial/PARAM.SFO
 echo -n $CID | xxd | xxd -r -s 0x17- $serial/USRDIR/ISO.BIN.EDAT
 
-# convert
+# generate key
 dd bs=1 count=$(expr ${#KLICENSE} / 2) if=/dev/zero of=$serial/ps2.key
 echo "00000000  $KLICENSE" | xdd -r - > $serial/ps2.key
-ps2classic e cex $serial/ps2.key "$1" $serial/USRDIR/ISO.BIN.ENC ISO.BIN.ENC 2P0001-${CID}_00-0000111122223333
+
+# package config
+echo > $serial/package.conf << EOF
+Content-ID = $CID
+k_licensee = 0x$KLICENSE
+DRM_Type = Free
+Content_Type = Game_Data
+PackageVersion = 01.01
+EOF
+
+# convert iso
+$PS2CLASSIC e cex $serial/ps2.key "$1" $serial/USRDIR/ISO.BIN.ENC ISO.BIN.ENC 2P0001-${CID}_00-0000111122223333
+
+# create package
+$PSNPACKAGE $serial
diff --git a/psn_package_npdrm/psn_package_npdrm b/psn_package_npdrm/psn_package_npdrm
new file mode 100755 (executable)
index 0000000..42a0e3f
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+PWD=$(dirname $0)
+[ "$PWD" ] || PWD=.
+wine $PWD/$0.exe
diff --git a/psn_package_npdrm/psn_package_npdrm.exe b/psn_package_npdrm/psn_package_npdrm.exe
new file mode 100644 (file)
index 0000000..83d9816
Binary files /dev/null and b/psn_package_npdrm/psn_package_npdrm.exe differ