Properly handle inject app romfs (Windows)

This commit is contained in:
d0k3 2016-04-12 22:40:06 +02:00
parent baed9607b1
commit 54b378f691

View file

@ -1,6 +1,6 @@
@echo off @echo off
echo [!] --- UNIVERSAL INJECT GENERATOR V0.3 --- echo [!] --- UNIVERSAL INJECT GENERATOR v0.5 ---
echo. echo.
echo [+] CLEAR WORKING DIRECTORY echo [+] CLEAR WORKING DIRECTORY
rd /s /q work rd /s /q work
@ -13,8 +13,8 @@ ren "work\ciacnt.0000.*" inject.app
echo. echo.
echo [+] EXTRACT HS AND INJECT APP echo [+] EXTRACT HS AND INJECT APP
tools\3dstool -x -f work\hs.app --header work\hs_hdr.bin --exh work\hs_exhdr.bin --plain work\hs_plain.bin --logo work\hs_logo.bin --exefs work\hs_exefs.bin --romfs work\hs_romfs.bin tools\3dstool -x -f work\hs.app --header work\hs_hdr.bin --exh work\hs_exhdr.bin --plain work\hs_plain.bin --logo work\hs_logo.bin --exefs work\hs_exefs.bin
tools\3dstool -x -f work\inject.app --exh work\inject_exhdr.bin --exefs work\inject_exefs.bin tools\3dstool -x -f work\inject.app --exh work\inject_exhdr.bin --exefs work\inject_exefs.bin --romfs work\inject_romfs.bin
tools\3dstool -x -f work\hs_exefs.bin --exefs-dir work\hs_exefs tools\3dstool -x -f work\hs_exefs.bin --exefs-dir work\hs_exefs
tools\3dstool -x -f work\inject_exefs.bin --exefs-dir work\inject_exefs tools\3dstool -x -f work\inject_exefs.bin --exefs-dir work\inject_exefs
@ -31,6 +31,7 @@ echo [+] GENERATE NEW ROMFS
md work\dummy_romfs md work\dummy_romfs
copy /y /v tools\dummy.bin work\dummy_romfs\dummy.bin copy /y /v tools\dummy.bin work\dummy_romfs\dummy.bin
tools\3dstool -c -t romfs -f work\dummy_romfs.bin --romfs-dir work\dummy_romfs tools\3dstool -c -t romfs -f work\dummy_romfs.bin --romfs-dir work\dummy_romfs
if not exist work\inject_romfs.bin ren work\dummy_romfs work\inject_romfs.bin
echo. echo.
echo [+] MERGE EXHEADER echo [+] MERGE EXHEADER
@ -38,8 +39,9 @@ tools\MergeExHeader work\inject_exhdr.bin work\hs_exhdr.bin work\merge_exhdr.bin
echo. echo.
echo [+] REBUILD HS INJECT APP echo [+] REBUILD HS INJECT APP
if exist work\hs_logo.bin (tools\3dstool -c -t cxi -f "%~n1_inject_no_banner.app" --header work\hs_hdr.bin --exh work\merge_exhdr.bin --plain work\hs_plain.bin --logo work\hs_logo.bin --exefs work\hs_mod_exefs.bin --romfs work\dummy_romfs.bin) else (tools\3dstool -c -t cxi -f %~n1_inject_no_banner.app --header work\hs_hdr.bin --exh work\merge_exhdr.bin --plain work\hs_plain.bin --exefs work\hs_mod_exefs.bin --romfs work\dummy_romfs.bin) if exist work\hs_logo.bin (tools\3dstool -c -t cxi -f %~n1_inject_no_banner.app --header work\hs_hdr.bin --exh work\merge_exhdr.bin --plain work\hs_plain.bin --logo work\hs_logo.bin --exefs work\hs_mod_exefs.bin --romfs work\inject_romfs.bin) else (tools\3dstool -c -t cxi -f %~n1_inject_no_banner.app --header work\hs_hdr.bin --exh work\merge_exhdr.bin --plain work\hs_plain.bin --exefs work\hs_mod_exefs.bin --romfs work\inject_romfs.bin)
if exist work\hs_logo.bin (tools\3dstool -c -t cxi -f "%~n1_inject_with_banner.app" --header work\hs_hdr.bin --exh work\merge_exhdr.bin --plain work\hs_plain.bin --logo work\hs_logo.bin --exefs work\hs_mod_banner_exefs.bin --romfs work\dummy_romfs.bin) else (tools\3dstool -c -t cxi -f %~n1_inject_with_banner.app --header work\hs_hdr.bin --exh work\merge_exhdr.bin --plain work\hs_plain.bin --exefs work\hs_mod_banner_exefs.bin --romfs work\dummy_romfs.bin) if exist work\hs_logo.bin (tools\3dstool -c -t cxi -f %~n1_inject_with_banner.app --header work\hs_hdr.bin --exh work\merge_exhdr.bin --plain work\hs_plain.bin --logo work\hs_logo.bin --exefs work\hs_mod_banner_exefs.bin --romfs work\inject_romfs.bin) else (tools\3dstool -c -t cxi -f %~n1_inject_with_banner.app --header work\hs_hdr.bin --exh work\merge_exhdr.bin --plain work\hs_plain.bin --exefs work\hs_mod_banner_exefs.bin --romfs work\inject_romfs.bin)
for %%i in (work\hs.app) do set HS_ORIGINAL_SIZE=%%~zi for %%i in (work\hs.app) do set HS_ORIGINAL_SIZE=%%~zi
for %%i in ("%~n1_inject_no_banner.app") do set HS_INJECT_N_SIZE=%%~zi for %%i in ("%~n1_inject_no_banner.app") do set HS_INJECT_N_SIZE=%%~zi
for %%i in ("%~n1_inject_with_banner.app") do set HS_INJECT_B_SIZE=%%~zi for %%i in ("%~n1_inject_with_banner.app") do set HS_INJECT_B_SIZE=%%~zi