Skip to content

Commit

Permalink
Switching to local paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Thesola10 committed Mar 29, 2022
1 parent e0da3b3 commit 376b0f9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions extract_nsp.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# This script automatically pulls the titlekey from the tik file found in the
# NSP bundle, and extracts it down to the required ROMFS

hactool -x $1 --pfs0dir=$PSScriptRoot\work -t pfs0
hactool -x $PSScriptRoot\work\97105c79474118d294c8808a22f39bd3.nca `
--titlekey=$(Format-Hex -Count 16 -Offset 0x180 -Path $PSScriptRoot\work\0100d12014fc2000000000000000000b.tik) `
--romfsdir=$PSScriptRoot\work
.\3rdparty\hactool.exe -x $1 --pfs0dir=.\work -t pfs0
.\3rdparty\hactool.exe -x .\work\97105c79474118d294c8808a22f39bd3.nca `
--titlekey=$(Format-Hex -Count 16 -Offset 0x180 -Path .\work\0100d12014fc2000000000000000000b.tik) `
--romfsdir=.\work

Remove-Item $PSScriptRoot\work\*.nca $PSScriptRoot\work\*.tik $PSScriptRoot\work\*.cert
Remove-Item .\work\*.nca .\work\*.tik .\work\*.cert
16 changes: 8 additions & 8 deletions repack_scrpt.cpk.ps1
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
md $PSScriptRoot\work\Data\StreamingAssets\scrpt.cpk.contents `
$PSScriptRoot\out\contents\0100D12014FC200\romfs\Data\StreamingAssets
md -p .\work\Data\StreamingAssets\scrpt.cpk.contents `
.\out\contents\0100D12014FC200\romfs\Data\StreamingAssets

Get-ChildItem -Path $PSScriptRoot\patches\Data\StreamingAssets\scrpt.cpk -Filter *.json |
Get-ChildItem -Path .\patches\Data\StreamingAssets\scrpt.cpk -Filter *.json |
Foreach-Object {
Write-Output "Encoding ${$_.Name}"
python3 $PSScriptRoot\inucode.py $_.FullName > "$PSScriptRoot\work\Data\StreamingAssets\scrpt.cpk.contents\${$_.BaseName}"
python3 .\inucode.py $_.FullName > ".\work\Data\StreamingAssets\scrpt.cpk.contents\${$_.BaseName}"
}

$PSScriptRoot\3rdparty\cpkmakec.exe `
$PSScriptRoot\work\Data\StreamingAssets\scrpt.cpk.contents `
$PSScriptRoot\out\contents\0100D12014FC200\romfs\Data\StreamingAssets\scrpt.cpk `
.\3rdparty\cpkmakec.exe `
.\work\Data\StreamingAssets\scrpt.cpk.contents `
.\out\contents\0100D12014FC200\romfs\Data\StreamingAssets\scrpt.cpk `
-mode=FILENAME
-code=UTF-8
-align=2048

Remove-Item -r $PSScriptRoot\work\Data\StreamingAssets\scrpt.cpk.contents
Remove-Item -r .\work\Data\StreamingAssets\scrpt.cpk.contents

0 comments on commit 376b0f9

Please sign in to comment.