Properly handle inject app romfs (Unix)

This commit is contained in:
d0k3 2016-04-12 22:49:19 +02:00
parent 54b378f691
commit f3ca143d43

View file

@ -2,7 +2,7 @@
clear
printf " --- UNIVERSAL INJECT GENERATOR V0.3 ---\n"
printf " --- UNIVERSAL INJECT GENERATOR v0.5 ---\n"
printf " --- LINUX EDITION --- \n\n\n"
printf "[+] IDENTIFY FILES TO WORK WITH\n"
@ -15,8 +15,8 @@ cat $2 > work/hs.app
mv work/ciacnt.0000.* work/inject.app
printf "[+] EXTRACT HS AND INJECT APP\n"
./tools/3dstool-$(uname) -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 &>/dev/null
./tools/3dstool-$(uname) -x -f work/inject.app --exh work/inject_exhdr.bin --exefs work/inject_exefs.bin &>/dev/null
./tools/3dstool-$(uname) -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 &>/dev/null
./tools/3dstool-$(uname) -x -f work/inject.app --exh work/inject_exhdr.bin --exefs work/inject_exefs.bin --romfs work/inject_romfs.bin &>/dev/null
./tools/3dstool-$(uname) -x -f work/hs_exefs.bin --exefs-dir work/hs_exefs &>/dev/null
./tools/3dstool-$(uname) -x -f work/inject_exefs.bin --exefs-dir work/inject_exefs &>/dev/null
@ -31,6 +31,9 @@ printf "[+] GENERATE NEW ROMFS\n"
mkdir work/dummy_romfs
cp tools/dummy.bin work/dummy_romfs/dummy.bin
./tools/3dstool-$(uname) -c -t romfs -f work/dummy_romfs.bin --romfs-dir work/dummy_romfs &>/dev/null
if [ ! -e work/inject_romfs.bin ]
then rn work/dummy_romfs work/inject_romfs.bin
fi
printf "[+] MERGE EXHEADER\n"
./tools/MergeExHeader-$(uname) work/inject_exhdr.bin work/hs_exhdr.bin work/merge_exhdr.bin &>/dev/null
@ -38,13 +41,13 @@ printf "[+] MERGE EXHEADER\n"
printf "[+] REBUILD HS INJECT APP\n"
if [ -e work/hs_logo.bin ]
then ./tools/3dstool-$(uname) -c -t cxi -f ${1%.*}_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 &>/dev/null
else ./tools/3dstool-$(uname) -c -t cxi -f ${1%.*}_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 &>/dev/null
then ./tools/3dstool-$(uname) -c -t cxi -f ${1%.*}_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 &>/dev/null
else ./tools/3dstool-$(uname) -c -t cxi -f ${1%.*}_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 &>/dev/null
fi
if [ -e work/hs_logo.bin ]
then ./tools/3dstool-$(uname) -c -t cxi -f ${1%.*}_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 &>/dev/null
else ./tools/3dstool-$(uname) -c -t cxi -f ${1%.*}_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 &>/dev/null
then ./tools/3dstool-$(uname) -c -t cxi -f ${1%.*}_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 &>/dev/null
else ./tools/3dstool-$(uname) -c -t cxi -f ${1%.*}_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 &>/dev/null
fi
for i in work/hs.app; do HS_ORIGINAL_SIZE=$(ls -l $i | awk '{print $5}'); done