Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- REM This tool was created by Jet for the purpose of decompiling/recompiling EBOOT.BIN/.ELF files for PlayStation 3 games.
- REM I am releasing this code with full authorization for the purpose of education.
- @shift /0
- @shift
- @echo off
- call data\config
- setlocal enabledelayedexpansion
- ::pushd %temp%
- color 0c
- set mode=%fw%
- title R3D Apple Resigner 2.1.1 [%mode% Mode]
- goto globals
- :globals
- cls
- set sid=%random%
- set user=%usr%
- set curdir=%cd%
- set selfctrlflags=4000000000000000000000000000000000000000000000000000000000000002
- set selfcapflags=00000000000000000000000000000000000000000000003B0000000100040000
- set output=4xxstd
- set outputmsg=[4.XX STD]
- set elfsdk=41
- set keyrev=1C
- set fwver=0004002000000000
- set ctrlflagswitch=FALSE
- set capflagswitch=FALSE
- set compress=TRUE
- set compressmsg=[ON]
- goto init
- :init
- cls
- set selfctrlflags=4000000000000000000000000000000000000000000000000000000000000002
- set selfcapflags=00000000000000000000000000000000000000000000003B0000000100040000
- set output=4xxstd
- set outputmsg=[4.XX STD]
- set elfsdk=41
- set keyrev=1C
- set fwver=0004002000000000
- set ctrlflagswitch=FALSE
- set capflagswitch=FALSE
- set compress=TRUE
- set compressmsg=[ON]
- goto default_mode
- :default_mode
- cls
- if %mode%==DEX goto dex_menu
- if %mode%==CEX goto cex_menu
- :dex_menu
- if %mode%==CEX goto cex_menu
- set mode=DEX
- title R3D Apple Resigner 2.1.1 [%mode% Mode]
- set opt=NULL
- cls
- echo WARNING: Be sure that your BIN/ELF is in %cd%
- echo.
- echo Mode: %mode% // Output: %outputmsg%
- echo Type "/cex" to change to CEX mode.
- echo.
- echo ^+================================^+
- ::echo ^| R3D Apple Resigner 2.1.1 ^|
- echo ^| .:' ^|
- echo ^| __ :'__ ^|
- echo ^| .'^`__^`-'__^`^`. ^|
- echo ^| ^:____R3D___.-' ^|
- echo ^| ^:__Apple__: ^|
- echo ^| ^:__2.1.1__`-; ^|
- echo ^| ^`.__.-.__.' ^|
- echo ^+================================^+
- echo ^| [1] - Decrypt BIN to ELF ^|
- echo ^| [2] - Resign NON-DRM ^|
- echo ^| [3] - Output Option ^|
- echo ^| [4] - Credits ^|
- echo ^| [5] - About R3D Apple ^|
- echo ^| [6] - Exit R3D Apple ^|
- echo ^+================================^+
- echo.
- set /p opt= %user%@%sid%:
- if %opt%==1 (goto d_dex)
- if %opt%==2 (goto disc_dex)
- if %opt%==3 (goto outputoption)
- if %opt%==4 (goto credits)
- if %opt%==5 (goto about)
- if %opt%==6 exit
- if %opt%==/dex goto error
- if %opt%==/DEX goto error
- if %opt%==/cex goto change_mode
- if %opt%==/CEX goto change_mode
- if not %opt%==1 goto error
- if not %opt%==2 goto error
- if not %opt%==3 goto error
- if not %opt%==4 goto error
- if not %opt%==5 goto error
- if not %opt%==6 goto error
- if not %opt%==/cex goto error
- if not %opt%==/CEX goto error
- :cex_menu
- if %mode%==DEX goto dex_menu
- set mode=CEX
- title R3D Apple Resigner 2.1.1 [%mode% Mode]
- set opt=NULL
- cls
- echo WARNING: Be sure that your BIN/ELF is in %cd%
- echo.
- echo Mode: %mode% // Output: %outputmsg%
- echo Type "/dex" to change to DEX mode.
- echo.
- echo ^+================================^+
- ::echo ^| R3D Apple Resigner 2.1.1 ^|
- echo ^| .:' ^|
- echo ^| __ :'__ ^|
- echo ^| .'^`__^`-'__^`^`. ^|
- echo ^| ^:____R3D___.-' ^|
- echo ^| ^:__Apple__: ^|
- echo ^| ^:__2.1.1__`-; ^|
- echo ^| ^`.__.-.__.' ^|
- echo ^+================================^+
- echo ^| [1] - Decrypt BIN to ELF ^|
- echo ^| [2] - Resign NON-DRM ^|
- echo ^| [3] - Output Option ^|
- echo ^| [4] - Credits ^|
- echo ^| [5] - About R3D Apple ^|
- echo ^| [6] - Exit R3D Apple ^|
- echo ^+================================^+
- echo.
- set /p opt= %user%@%sid%:
- if %opt%==1 (goto d_cex)
- if %opt%==2 (goto disc_cex)
- if %opt%==3 (goto outputoption)
- if %opt%==4 (goto credits)
- if %opt%==5 (goto about)
- if %opt%==6 exit
- if %opt%==/cex goto error
- if %opt%==/CEX goto error
- if %opt%==/dex goto change_mode
- if %opt%==/DEX goto change_mode
- if not %opt%==1 goto error
- if not %opt%==2 goto error
- if not %opt%==3 goto error
- if not %opt%==4 goto error
- if not %opt%==5 goto error
- if not %opt%==6 goto error
- if not %opt%==/dex goto error
- if not %opt%==/DEX goto error
- if %opt%==NULL (goto cex_menu)
- :d_cex
- data\sfk.exe list . .bin>data\list.txt
- cls
- set /a count=0
- for /f %%f in (data\list.txt) do (
- set /a count+=1
- set a!count!=%%f
- if count NEQ 0 (echo [!count!] %%f )
- )
- ) else (echo Could not find .BINs to list.)
- set filesel=NONE
- echo.
- echo Type "/q" to quit decryption.
- echo.
- set /p filesel=[^^!] Enter # to File:
- echo.
- if %filesel%==/q (goto cex_menu)
- if %filesel%==/Q (goto cex_menu)
- if %filesel% GTR !count! (
- echo [^^!] Invalid Input.
- ping localhost -n 3 >nul
- goto d_cex
- )
- if %filesel% LSS 1 (
- echo [^^!] Invalid Input.
- ping localhost -n 3 >nul
- goto d_cex
- )
- set filename=!a%filesel%!
- set file=%filename:~0,-4%
- if exist %file%.ELF (del %file%.ELF)
- echo [*] Decrypting %file%.BIN...
- data\scetool.exe --decrypt "%curdir%\%file%.BIN" "%curdir%\%file%.ELF">nul
- if exist %file%.ELF (
- echo [*] Decrypted to %file%.ELF
- ) else (
- echo [^^!] Decryption failed.
- )
- if exist data\list.txt (del data\list.txt)
- ping localhost -n 3 >nul
- goto cex_menu
- :disc_cex
- data\sfk.exe list -file .elf>data\list.txt
- cls
- set /a count=0
- for /f %%f in (data\list.txt) do (
- set /a count+=1
- set a!count!=%%f
- if count NEQ 0 (echo [!count!] %%f )
- )
- ) else (echo Could not find .ELFs to list.)
- set filesel=NONE
- echo.
- echo Type "/q" to quit encryption.
- echo.
- set /p filesel=[^^!] Enter # to File:
- echo.
- if %filesel%==/Q (goto cex_menu)
- if %filesel%==/q (goto cex_menu)
- if %filesel% GTR !count! (
- echo [^^!] Invalid Input.
- ping localhost -n 3 >nul
- goto disc_cex
- )
- if %filesel% LSS 1 (
- echo [^^!] Invalid Input.
- ping localhost -n 3 >nul
- goto disc_cex
- )
- set filename=!a%filesel%!
- set file=%filename:~0,-4%
- set CID=
- FOR /F "tokens=1,2 delims= " %%A IN ('data\scetool.exe -i "%curdir%\%file%.BIN"') DO (
- if [%%A]==[ContentID] set CID=%%B
- )
- data\FixELF.exe %file%.ELF %elfsdk%
- if [%CID%]==[] (
- data\scetool.exe -v --sce-type=SELF --compress-data=FALSE --skip-sections=TRUE --key-revision=%keyrev% --self-auth-id=1010000001000003 --self-vendor-id=01000002 --self-type=APP --self-app-version=0001000000000000 --self-fw-version=%fwver% --encrypt "%curdir%\%file%.ELF" "%curdir%\%file%.BIN" >nul
- echo [*] Encrypted to %file%.BIN. ) ELSE (
- echo ContentID = %CID%
- data\scetool.exe -v --sce-type=SELF --compress-data=FALSE --skip-sections=TRUE --key-revision=%keyrev% --self-auth-id=1010000001000003 --self-add-shdrs=TRUE --self-vendor-id=01000002 --self-type=NPDRM --self-app-version=0001000000000000 --self-fw-version=%fwver% --np-license-type=FREE --np-content-id=%CID% --np-app-type=EXEC --np-real-file=%file%.BIN --encrypt "%curdir%\%file%.ELF" "%curdir%\%file%.BIN" >nul
- echo [*] Encrypted to %file%.BIN. )
- ::del "%curdir%\%file%.BIN.BAK">nul
- ping localhost -n 3 >nul
- goto cex_menu
- :d_dex
- data\sfk.exe list -file .bin>data\list.txt
- cls
- set /a count=0
- for /f %%f in (data\list.txt) do (
- set /a count+=1
- set a!count!=%%f
- if count NEQ 0 (echo [!count!] %%f )
- )
- ) else (echo Could not find .ELFs to list.)
- set filesel=NONE
- echo.
- echo Type "/q" to quit decryption.
- echo.
- set /p filesel=[^^!] Enter # to File:
- echo.
- if %filesel%==/Q (goto dex_menu)
- if %filesel%==/q (goto dex_menu)
- if %filesel% GTR !count! (
- echo [^^!] Invalid Input.
- ping localhost -n 3 >nul
- goto disc_cex
- )
- if %filesel% LSS 1 (
- echo [^^!] Invalid Input.
- ping localhost -n 3 >nul
- goto disc_cex
- )
- set filename=!a%filesel%!
- set file=%filename:~0,-4%
- if not exist %file%.BIN (
- echo [^^!] %file%.BIN can't be found.
- ping localhost -n 3 >nul
- goto dex_menu
- )
- if exist %file%.ELF (del %file%.ELF)
- echo [*] Decrypting %file%.BIN...
- data\unfself "%curdir%\%file%.BIN" "%curdir%\%file%.ELF">nul
- if exist %file%.ELF (
- echo [*] Decrypted to %file%.ELF
- ) else (
- echo [^^!] Decryption failed.
- )
- ping localhost -n 3 >nul
- goto dex_menu
- :disc_dex
- data\sfk.exe list -file .elf>data\list.txt
- cls
- set /a count=0
- for /f %%f in (data\list.txt) do (
- set /a count+=1
- set a!count!=%%f
- if count NEQ 0 (echo [!count!] %%f )
- )
- ) else (echo Could not find .ELFs to list.)
- set filesel=NONE
- echo.
- echo Type "/q" to quit encryption.
- echo.
- set /p filesel=[^^!] Enter # to File:
- echo.
- if %filesel%==/Q (goto dex_menu)
- if %filesel%==/q (goto dex_menu)
- if %filesel% GTR !count! (
- echo [^^!] Invalid Input.
- ping localhost -n 3 >nul
- goto disc_cex
- )
- if %filesel% LSS 1 (
- echo [^^!] Invalid Input.
- ping localhost -n 3 >nul
- goto disc_cex
- )
- set filename=!a%filesel%!
- set file=%filename:~0,-4%
- set autoresign=FALSE
- if not exist %file%.BIN (
- if not exist %file%.ELF (
- echo [^^!] %file%.BIN/ELF can't be found.
- ping localhost -n 3 >nul
- goto dex_menu
- )
- )
- if not exist %file%.ELF (
- echo [*] Decrypting %file%.BIN...
- data\scetool.exe --decrypt "%curdir%\%file%.BIN" "%curdir%\%file%.ELF">nul
- set autoresign=TRUE
- )
- if not exist %file%.ELF (
- echo [^^!] Decryption failed.
- ping localhost -n 3 >nul
- goto dex_menu
- )
- if exist %file%.BIN (
- if exist %file%.BIN.BAK (del %file%.BIN.BAK)
- ren %file%.BIN %file%.BIN.BAK
- )
- echo [*] Patching %file%.ELF...
- data\FixELF "%curdir%\%file%.ELF"
- echo [*] Encrypting %file%.ELF...
- data\make_fself "%curdir%\%file%.ELF" "%curdir%\%file%.BIN">nul
- if %autoresign%==TRUE (del %file%.ELF)
- echo [*] Encrypted to %file%.BIN
- del %file%.BIN.BAK>nul
- ping localhost -n 3 >nul
- goto dex_menu
- :outputoption
- if %output%==4xxstd (
- set output=4xxalt
- set outputmsg=[4.XX ALT]
- set elfsdk=41
- set keyrev=1C
- set fwver=0004002000000000
- set ctrlflagswitch=TRUE
- set capflagswitch=FALSE
- echo.
- echo [*] Output set to 4.XX ALT.
- ping localhost -n 2 >nul
- goto default_mode
- )
- if %output%==4xxalt (
- set output=4xxode
- set outputmsg=[4.XX ODE]
- set elfsdk=33
- set keyrev=0A
- set fwver=0003005500000000
- set ctrlflagswitch=FALSE
- set capflagswitch=TRUE
- echo.
- echo [*] Output set to 4.XX ODE.
- ping localhost -n 2 >nul
- goto default_mode
- )
- if %output%==4xxode (
- set output=3xxstd
- set outputmsg=[3.XX STD]
- set elfsdk=33
- set keyrev=04
- set fwver=0003004000000000
- set ctrlflagswitch=FALSE
- set capflagswitch=FALSE
- echo.
- echo [*] Output set to 3.XX STD.
- ping localhost -n 2 >nul
- goto default_mode
- )
- if %output%==3xxstd (
- set output=3xxalt
- set outputmsg=[3.XX ALT]
- set elfsdk=33
- set keyrev=04
- set fwver=0003004000000000
- set ctrlflagswitch=TRUE
- set capflagswitch=FALSE
- echo [*] Output set to 3.XX ALT.
- echo.
- ping localhost -n 2 >nul
- goto default_mode
- )
- if %output%==3xxalt (
- set output=4xxstd
- set outputmsg=[4.XX STD]
- set elfsdk=41
- set keyrev=1C
- set fwver=0004002000000000
- set ctrlflagswitch=FALSE
- set capflagswitch=FALSE
- echo.
- echo [*] Output set to 4.XX STD.
- ping localhost -n 2 >nul
- goto default_mode
- )
- :change_mode
- if %opt%==/cex goto set_cex
- if %opt%==/CEX goto set_cex
- if %opt%==/dex goto set_dex
- if %opt%==/DEX goto set_dex
- :set_cex
- set mode=CEX
- echo.
- echo CEX mode enabled.
- ping localhost -n 2 >nul
- goto cex_menu
- :set_dex
- set mode=DEX
- echo.
- echo DEX mode enabled.
- ping localhost -n 2 >nul
- goto dex_menu
- :error
- echo.
- if %opt%==/cex goto fw_error
- if %opt%==/CEX goto fw_error
- if %opt%==/dex goto fw_error
- if %opt%==/DEX echo fw_error
- if %mode%==CEX echo [^^!] "%opt%" is not a valid option.
- if %mode%==DEX echo [^^!] "%opt%" is not a valid option.
- ping localhost -n 3 >nul
- goto default_mode
- :fw_error
- if %opt%==/cex echo [^^!] CEX mode is already enabled.
- if %opt%==/CEX echo [^^!] CEX mode is already enabled.
- if %opt%==/dex echo [^^!] DEX mode is already enabled.
- if %opt%==/DEX echo [^^!] DEX mode is already enabled.
- ping localhost -n 3 >nul
- goto default_mode
- :about
- echo.
- echo R3D Apple is a resigning tool developed to quickly and simply encrypt/decrypt EBOOTs.
- echo.
- echo Waiting on %user%...
- pause >nul
- goto default_mode
- :credits
- cls
- echo R3D Apple Resigner developed by Jet
- echo Released Sept. 22, 2016
- echo NGU: TrippinOnACID
- echo RG: Jet
- echo.
- echo Shout out to Trojan and Krank
- echo.
- echo Waiting on %user%...
- pause >nul
- goto default_mode
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement