Jump to content
LaunchBox Community Forums

PS3: Looking to Create a Batch file to Decrypt ISOs with PS3dec when launching a game. Then delete the decrypted PS3 file on QUIT.


darreldearth

Recommended Posts

So for anyone trying to use PS3 ISO ROMS instead of JB Folder versions (which are annoying for storage kuz of the thousands of files in each one) you've probably noticed they're all Encrypted. So wanted  to see if anyone with any scrypting knowledge would wanna  take shot at creating a Batch file that would use PS3dec to decrypt the game using a games dkey when launched, and then  load the decrypted game. Then delete the created decrypted ISO on game quit. Saw someone did it a few years back but he never posted his code.

(Also yes you could just decrypt all the games in your library , but then you'd lose the encrypted original which is nice to have if you ever wanna use it on your REAL Modded PS3) 

 

Someone already made the powershell code to mount the games ISO and unmount it here... (but it would need to be tweaked to launch the decrypted iso instead of the initial encrypted one)

 

Heres a link to the PS3dec and how its works as well as a youtube video if it helps. Its all done using Command Prompt...

 

 

 

Anyway, just throwing it out there to see if anyone wants to take a shot at it, because it would be nice for preservation, and also be a lot more convient than the JB Folders most people are currently using. 

Link to comment
Share on other sites

In the video, it took 74 seconds just to decrypt the iso.  Seems like a long time to wait to load a game.  Maybe that was atypical, and it'll normally be a lot faster.  I don't own or emulate PS3, so I have no idea.

 

This "looks" like it should work.

set path2ps3dec=D:\PS3\utilities\ps3dec\ps3dec.exe
set decryptedISO=D:\temp\temp-decryptedGame.iso
set key=323CE7042E84AF01555853C280760FIF
set path2RPCS3ps1=E:\LaunchBox\Emulators\rpcs3\RPCS3-ISO-LaunchBox.ps1

set encryptedISO=%1

start "" /w /d %path2ps3dec% d key %key% "%encryptedISO%" "%decryptedISO%"
start "" /w "C:\Program Files\PowerShell\7\pwsh.exe" -noprofile -executionpolicy bypass -WindowStyle hidden -file "%path2RPCS3ps1%" "%decryptedISO%"

del "%decryptedISO%

Edit ONLY the first 4 lines after their respective = (equal) sign.

  1. Full path to where you have ps3dec.exe located.
  2. Full path to where you want the temp iso file created in and later deleted. (must end in .iso)
  3. The "key"
  4. Full path to the PowerShell script (which won't "need to be tweaked").  The PS script needs to be in the same folder as rspcs3.exe.

 

  • Copy the above and save the script with the appropriate changes somewhere and give it the file extension .bat  (myPS3emu.bat)
  • Set up a new emulator in LB and set the Associated Platform accordingly.

image.png.c289171c44bf31ec3780da3c194af21e.png

Notes:

If the "key" is something that changes with every iso file, then this isn't going to work as written.

This assumes you'll be using PowerShell 7.  If you use a different version of PowerShell, change the full path to it on the 2nd "start" line.  Be sure to put the "full/path/to/the/exe" in quotes.

Backup you original iso 1st, because you never know.

 

You may want to test this outside of LaunchBox 1st.

  • press Win+R on your keyboard
  • type cmd and press enter.  (this opens the Windows Command Prompt)
  • at the command window type cd followed by a space, a quote, the full path to the batch file, and another quote. press enter.
    • cd "D:\LaunchBox\Emulators\Misc\myPS3emu.bat"
  • Now type myPS3emu.bat followed by a space, a quote, the full path to an encrypted iso file, and another quote.
    • myPS3emu.bat "D:\LaunchBox\Games\Sony Playstation 3\some_game.iso"
  • cross your fingers
  • press enter.
  • Like 1
Link to comment
Share on other sites

3 hours ago, JoeViking245 said:

In the video, it took 74 seconds just to decrypt the iso.  Seems like a long time to wait to load a game.  Maybe that was atypical, and it'll normally be a lot faster.  I don't own or emulate PS3, so I have no idea.

 

This "looks" like it should work.

set path2ps3dec=D:\PS3\utilities\ps3dec\ps3dec.exe
set decryptedISO=D:\temp\temp-decryptedGame.iso
set key=323CE7042E84AF01555853C280760FIF
set path2RPCS3ps1=E:\LaunchBox\Emulators\rpcs3\RPCS3-ISO-LaunchBox.ps1

set encryptedISO=%1

start "" /w /d %path2ps3dec% d key %key% "%encryptedISO%" "%decryptedISO%"
start "" /w "C:\Program Files\PowerShell\7\pwsh.exe" -noprofile -executionpolicy bypass -WindowStyle hidden -file "%path2RPCS3ps1%" "%decryptedISO%"

del "%decryptedISO%

Edit ONLY the first 4 lines after their respective = (equal) sign.

  1. Full path to where you have ps3dec.exe located.
  2. Full path to where you want the temp iso file created in and later deleted. (must end in .iso)
  3. The "key"
  4. Full path to the PowerShell script (which won't "need to be tweaked").  The PS script needs to be in the same folder as rspcs3.exe.

 

  • Copy the above and save the script with the appropriate changes somewhere and give it the file extension .bat  (myPS3emu.bat)
  • Set up a new emulator in LB and set the Associated Platform accordingly.

image.png.c289171c44bf31ec3780da3c194af21e.png

Notes:

If the "key" is something that changes with every iso file, then this isn't going to work as written.

This assumes you'll be using PowerShell 7.  If you use a different version of PowerShell, change the full path to it on the 2nd "start" line.  Be sure to put the "full/path/to/the/exe" in quotes.

Backup you original iso 1st, because you never know.

 

You may want to test this outside of LaunchBox 1st.

  • press Win+R on your keyboard
  • type cmd and press enter.  (this opens the Windows Command Prompt)
  • at the command window type cd followed by a space, a quote, the full path to the batch file, and another quote. press enter.
    • cd "D:\LaunchBox\Emulators\Misc\myPS3emu.bat"
  • Now type myPS3emu.bat followed by a space, a quote, the full path to an encrypted iso file, and another quote.
    • myPS3emu.bat "D:\LaunchBox\Games\Sony Playstation 3\some_game.iso"
  • cross your fingers
  • press enter.

Wow that was fast😱. To answer your questions YES the key file does change with every game, so I'm assuming your code needs to be changed a little. The key file is named the same as each game with an extension of .dkey

Example would be 

007 - Blood Stone (Japan).iso

Would be...

007 - Blood Stone (Japan).dkey

They could either be in the same folder as the roms to simplify it, or if not to much work then in a seperate folder called keys or something.

 

Also, in the code you posted on line 3.... "key=323CE7042E84AF01555853C280760FIF" is this assuming the key is in the same folder as the encrypted rom with a name of "323CE7042E84AF01555853C280760FIF" ? Just trying to figure out what to edit to test the script. 

But that was really fast for the rest of everything! Thanks, and I'll still try the code when I get home. Temporarily I'll just name the key file key to test it. 

 

PS. yeah you're right, it takes a while each time to decrypt the games (sux kuz without a loading bar you might think it froze lol). But yeah, Figured it's easier than decrypting each game 1 by 1 before hand which takes forever for 1k+ games without a batch script for ps3dec 😬 (unless you're willing to take a shot at that too lol) 😵. Each game would just need to retain its original name so you could tell them apart with "_dec" at the end or something. Definately would have been nice if the creator of ps3dec included that for those of us without much coding ability instead of having to do them individually in command prompt. 

Edited by darreldearth
Link to comment
Share on other sites

12 minutes ago, darreldearth said:

Also, in the code you posted on line 3.... "key=323CE7042E84AF01555853C280760FIF" is this assuming the key is in the same folder as the encrypted rom with a name of "323CE7042E84AF01555853C280760FIF" ? 

No. Well, kinda. Sotra not really. I guess.  I glossed over that part of the video where he got that lon-gass number from.  I just sorta copied the resulting command line needed. 😊

So I guess you need to read the contents of game_name.dkey.

 

Here, ONLY set the proper paths for the 1st 3 lines.

set path2ps3dec=D:\PS3\utilities\ps3dec\ps3dec.exe
set decryptedISO=D:\temp\temp-decryptedGame.iso
set path2RPCS3ps1=E:\LaunchBox\Emulators\rpcs3\RPCS3-ISO-LaunchBox.ps1

set encryptedISO=%1
set keyFile=%~dpn1.dkey
set /p key=< %keyFile%


start "" /w /d %path2ps3dec% d key %key% "%encryptedISO%" "%decryptedISO%"
start "" /w "C:\Program Files\PowerShell\7\pwsh.exe" -noprofile -executionpolicy bypass -WindowStyle hidden -file "%path2RPCS3ps1%" "%decryptedISO%"

del "%decryptedISO%

 

This assumes the .dkey file only has one-line of text in it (the 'key') and it's located in the same folder as game_name.iso AND has the exact same name as game_name (i.e. game_name.dkey).

Link to comment
Share on other sites

1 hour ago, darreldearth said:

I didn't know how to make a batch script using PS3dec that would automate the process for 1.5k ps3 games in a folder

If you want to bulk decrypt all the encrypted files, then just store the encrypted ones somewhere [else] for historical reference and use the decrypted ones in LB.. that'd probably help immensely with your game playing enjoyment.  To decrypt all of them will definitely take a bit of time.  But you only have to do that once.  Whereas doing it the way you requested, when you go to play a game, you have to decrypt it   e v e r y   s i n g l e   t i m e.

Link to comment
Share on other sites

@JoeViking245 Awesome! I'll test the new script when I get back home and report back! 

 

Also, For decrypting all of the games at once like you posted above do you know how to make a batch script for PS3dec which will run through all games within a folder decrypting them all? Otherwise you have to sit there for 2-5 min at a time waiting for each to finish which takes an average of around 75 hours for 1500 games 😵

Edited by darreldearth
Link to comment
Share on other sites

24 minutes ago, darreldearth said:

do you know how to make a batch script for PS3dec which will run through all games within a folder decrypting them all?

If the above batch script works to decrypt and play the game, this should work to decrypt all the .iso files in a given folder.

@echo off
set path2ps3dec=D:\PS3\utilities\ps3dec\ps3dec.exe
set decryptedISOFolder=D:\temp\decryptedISOs\

for %%f in (*.iso) do (
  set keyFile=%%~dpnf.dkey
  set /p key=< %keyFile%
  %path2ps3dec% d key %key% "%encryptedISO%" "%decryptedISOFolder%%%f"
)

pause
  1. Copy/edit/save this as a .bat file (decryptAll.bat).
    1. set the path to ps3dec.exe
    2. set the path to the folder where you want the decrypted file to end up.
      1. NOTE the path ends with a \ (slash)
  2. Copy a couple of your encrypted .iso files and their .dkey files to a temp folder (D:\temp\encrypted\)
  3. Put your batch file in that folder (D:\temp\encrypted\decryptAll.bat)
  4. Double-click the .bat file

If all goes well with those 2, put the .bat file in the folder that has all your .ios/.dkey files and double click it.  Then come back to it in a few days.

 

To do it in segments, change this line

for %%f in (*.iso) do (

to this

for %%f in (a*.iso) do (

This will only do the iso files that begin with "a".  Run it.  Change "a" to "b". Run it.  etc. etc...

  • Unusual Gem 1
Link to comment
Share on other sites

I don't remember why I didn't do this last time it was requested, maybe I was just being lazy or burnt out not sure but I think I worked this out now.  I will clean up and write up better instructions this weekend....probably.

https://github.com/ptmorris1/RPCS3-ISOLauncher-Launchbox

Use the RPCS3-Decrypt-ISO-LaunchBox.ps1 and let me know how it works out for you.

Put script in same folder as RPCS3.exe (or change script path)

make folder in same place called ps3dec and add ps3dec.exe and vcomp100.dll to this folder (or change script path)

make another folder in root with rpcs3.exe and name it dkeys and add all keys into this folder (or change script path)

setup as per normal instructions for launchbox

this version only works for encrypted games.  ISO name must not be changed or must be same name as key or this will not work.  As long as name and key are same should decrypt and run game.

Link to comment
Share on other sites

6 hours ago, JoeViking245 said:

In the video, it took 74 seconds just to decrypt the iso.  Seems like a long time to wait to load a game.  Maybe that was atypical, and it'll normally be a lot faster.  I don't own or emulate PS3, so I have no idea.

Nice, I didn't even read to see if anyone had replied yet before posting my own.

I would think the same and just decrypt the games I am playing or know I will play but hey to each his own.

  • Like 1
Link to comment
Share on other sites

3 hours ago, JoeViking245 said:

No. Well, kinda. Sotra not really. I guess.  I glossed over that part of the video where he got that lon-gass number from.  I just sorta copied the resulting command line needed. 😊

So I guess you need to read the contents of game_name.dkey.

 

Here, ONLY set the proper paths for the 1st 3 lines.

set path2ps3dec=D:\PS3\utilities\ps3dec\ps3dec.exe
set decryptedISO=D:\temp\temp-decryptedGame.iso
set path2RPCS3ps1=E:\LaunchBox\Emulators\rpcs3\RPCS3-ISO-LaunchBox.ps1

set encryptedISO=%1
set keyFile=%~dpn1.dkey
set /p key=< %keyFile%


start "" /w /d %path2ps3dec% d key %key% "%encryptedISO%" "%decryptedISO%"
start "" /w "C:\Program Files\PowerShell\7\pwsh.exe" -noprofile -executionpolicy bypass -WindowStyle hidden -file "%path2RPCS3ps1%" "%decryptedISO%"

del "%decryptedISO%

 

This assumes the .dkey file only has one-line of text in it (the 'key') and it's located in the same folder as game_name.iso AND has the exact same name as game_name (i.e. game_name.dkey).

OK got home and tried the script. It didnt work yet so maybe i messed something up 😖 but ill post what happened. 

This is what i typed into the batch file (Also, i used windowspowershell instead because i dont have powershell7...

set path2ps3dec=C:\Users\darre\Desktop\TEMPPS3\PS3DEC\ps3dec.exe
set decryptedISO=C:\Users\darre\Desktop\TEMPPS3\DECRYPTED_GAMES\temp-decryptedGame.iso
set path2RPCS3ps1=M:\LaunchBox\Emulators\rpcs3\RPCS3-ISO-LaunchBox.ps1

set encryptedISO=%1
set keyFile=%~dpn1.dkey
set /p key=< %keyFile%


start "" /w /d %path2ps3dec% d key %key% "%encryptedISO%" "%decryptedISO%"
start "" /w "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -noprofile -executionpolicy bypass -WindowStyle hidden -file "%path2RPCS3ps1%" "%decryptedISO%"

del "%decryptedISO%

Below is a screenshot of the output from command prompt.

image.thumb.png.938d1bf1118feb35197f5ee78f7c87cb.png

 

Thanks!

 

Edited by darreldearth
Link to comment
Share on other sites

20 minutes ago, darreldearth said:

OK got home and tried the script. It didnt work yet so maybe i messed something up 😖 but ill post what happened. 

I posted my updated script above if you still want.  I can write up a powershell to bulk decrypt if @JoeViking245 doesn't help before I can get to it.  But you will need another drive with enough space to duplicate your entire 1500 games too.

Edited by phunky1
Link to comment
Share on other sites

17 minutes ago, JoeViking245 said:

You to launch the batch file from a PowerShell window (vs a Command Prompt window).  Which is fine.  Per the error message, at the prompt type in 

.\myPS3emu.bat "full\apath\tp\your\game.iso"

This seems to be working but then half way through the "Plants vs. Zombies (USA).dkey" name gets cut in half and becomes "vs. Zombies (USA).dkey". The output i recieved is below :)

 

image.thumb.png.310f35ed111fbd0c910cfee10258423f.png

 

Link to comment
Share on other sites

30 minutes ago, phunky1 said:

I posted my updated script above if you still want.  I can write up a powershell to bulk decrypt if @JoeViking245 doesn't help before I can get to it.  But you will need another drive with enough space to duplicate your entire 1500 games too.

That would be great to get the batch script! im trying out the new script you posted now and ill report back :)

Link to comment
Share on other sites

55 minutes ago, phunky1 said:

I posted my updated script above if you still want.  I can write up a powershell to bulk decrypt if @JoeViking245 doesn't help before I can get to it.  But you will need another drive with enough space to duplicate your entire 1500 games too.

The script worked great! it actually decrypted almost instantly... lol probably kuz i tested with a few games on my SSD instead of my NAS Server 😣. Be great if you could get the batch script working which could do all 1500 games at once from a single folder to give everyone options.

but with both of these it could really help people move away from the JB Folders with how much more convient the ISOs are. Most people seem to give up on ISOs kuz they get lost trying to decrypt the games, but this really speeds it up and makes it easy. So thanks a lot to you both @JoeViking245 @phunky1

Edited by darreldearth
  • Like 1
Link to comment
Share on other sites

18 minutes ago, darreldearth said:

half way through the "Plants vs. Zombies (USA).dkey" name gets cut in half and becomes "vs. Zombies (USA).dkey".

Forgot some quotes. 😊 (guess I should have tested with a file name that had spaces in it. lol)

Change this line

set /p key=< %keyFile%

to

set /p key=< "%keyFile%"

 

  • Like 1
Link to comment
Share on other sites

9 minutes ago, JoeViking245 said:

PS is a 3rd language to me.  lol   Please. Be my guest. :D

everything seems to work better now but gets stuck twards the bottom at (invalid switch - "/c") 

image.thumb.png.6418cca080931af61b54a2b3ab80f873.png

 

Heres the new code in my batch file again just for reference. 

 

set path2ps3dec=C:\Users\darre\Desktop\TEMPPS3\PS3DEC\ps3dec.exe
set decryptedISO=C:\Users\darre\Desktop\TEMPPS3\DECRYPTED_GAMES\temp-decryptedGame.iso
set path2RPCS3ps1=M:\LaunchBox\Emulators\rpcs3\RPCS3-ISO-LaunchBox.ps1

set encryptedISO=%1
set keyFile=%~dpn1.dkey
set /p key=< "%keyFile%"


start "" /w /c %path2ps3dec% d key %key% "%encryptedISO%" "%decryptedISO%"
start "" /w "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -noprofile -executionpolicy bypass -WindowStyle hidden -file "%path2RPCS3ps1%" "%decryptedISO%"

del "%decryptedISO%

Link to comment
Share on other sites

i switched it to /c because it got rid of this error below since all my files were on the C drive instead of D. Guessing that /c wasnt reffering to my drive letter though lol. This is what happens if i switch it back to /d 

just says the system cannot find the File d twards the bottom

 

image.thumb.png.bdbcace898a355d6df1cbda445155a7f.png

image.thumb.png.81047d4b103e22a7b1de2515dab3d114.png

 

Edited by darreldearth
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...