ROM Hack [Release] CTPK Tool

  • Thread starter Thread starter Nagato
  • Start date Start date
  • Views Views 42,098
  • Replies Replies 53
  • Likes Likes 14
Is it normal that I export a ctpk file that is about 1.345 kB and after ctpktool converts the same folder back into a ctpk file, it's suddenly exactly 1 MB? The file then causes graphical errors in the game. Another file that already was 1 MB in size when I exported it obviously worked fine after some editing, but does anybody know how to handle files with different sizes?

Ran into similar problems in the past with graphical glitches, ended up having to do some messy hex editing to get stuff working, does the ctpk contain multiple images? if so are they different resolutions? I can't recall if the troublesome files I messed with in the past had multiple images but with Nagato's TXP Tool on VITA the images get messed up when there are multiple images and different resolutions, main reason I bring up the VITA tool is it works in a very similar way to this CTPK one.
 
im sorry to bump such an old thread, but i downloaded the tool, and even though they both are clearly in the same path, it says there is no ctpk file.
Capture.PNG
Capture.PNG

any idea why it wouldnt be able to find the ctpk file?
 
Decoded the file status_u.ctpk.lz via FEAT.
As a result, I got a folder with graphical .PNG and .XML files.
I changed them and encrypted them back with ctpktool.
After that, I used DSDecmp4 to encrypt the file and got status_u.ctpk.lz.
Collected ROM and launched in Citra. As a result, I received a green screen instead of a texture. What to do? :huh:
XIwC4IU8Yvo.jpg
 
Last edited by bqio,
script for batch extraction

Code:
:::::::::::::::::::::::::::::::::::::::::
:: Automatically check & get admin rights
:::::::::::::::::::::::::::::::::::::::::
@echo off
CLS
ECHO.
ECHO =============================
ECHO Running Admin shell
ECHO =============================
:checkPrivileges
NET FILE 1>NUL 2>NUL
if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges )
:getPrivileges
if '%1'=='ELEV' (echo ELEV & shift /1 & goto gotPrivileges)
ECHO.
ECHO **************************************
ECHO Invoking UAC for Privilege Escalation
ECHO **************************************
setlocal DisableDelayedExpansion
set "batchPath=%~0"
for %%k in (%0) do set batchName=%%~nk
setlocal EnableDelayedExpansion
ECHO Set UAC = CreateObject^("Shell.Application"^) > "%temp%\OEgetPrivileges_%batchName%.vbs"
ECHO args = "ELEV " >> "%temp%\OEgetPrivileges_%batchName%.vbs"
ECHO For Each strArg in WScript.Arguments >> "%temp%\OEgetPrivileges_%batchName%.vbs"
ECHO args = args ^& strArg ^& " "  >> "%temp%\OEgetPrivileges_%batchName%.vbs"
ECHO Next >> "%temp%\OEgetPrivileges_%batchName%.vbs"
ECHO UAC.ShellExecute "!batchPath!", args, "", "runas", 1 >> "%temp%\OEgetPrivileges_%batchName%.vbs"
"%SystemRoot%\System32\WScript.exe" "%temp%\OEgetPrivileges_%batchName%.vbs" %*
exit /B
:gotPrivileges
if '%1'=='ELEV' shift /1
setlocal & pushd .
cd /d %~dp0
for %%k in (%0) do set batchName=%%~nk
del "%temp%\OEgetPrivileges_%batchName%.vbs" 1>nul 2>nul
::::::::::::::::::::::::::::
::START
::::::::::::::::::::::::::::
:Loop
IF "%1"=="" GOTO Continue
   ctpktool.exe -x %~f1
SHIFT
GOTO Loop
:Continue
pause
 
I have converted and edited an image but when i turn it back into a ctpk and rebuild everything it plays up the the bit i changed it black screens ob menu cause thsts whst i edited is there a way to fix this yet?
 
Looks like the links to this tool are no longer functional. Does anyone have an updated link that for ctpktool?
 
Looks like the links to this tool are no longer functional. Does anyone have an updated link that for ctpktool?
there's probably no chance you're still interested, but I have an answer for anybody who finds this thread later.
i have a fork that still lives. https://github.com/MyLegGuy/ctpktool-patching
you can clone it and revert to commit 9ca30d043b28c99367212cb3c8772eeef1534bde if you only want polaris-'s code. https://github.com/MyLegGuy/ctpktool-patching/archive/9ca30d043b28c99367212cb3c8772eeef1534bde.zip
but i recommend my fork because it has an rgba4 bug fix.
 
there's probably no chance you're still interested, but I have an answer for anybody who finds this thread later.
i have a fork that still lives. https://github.com/MyLegGuy/ctpktool-patching
you can clone it and revert to commit 9ca30d043b28c99367212cb3c8772eeef1534bde if you only want polaris-'s code. https://github.com/MyLegGuy/ctpktool-patching/archive/9ca30d043b28c99367212cb3c8772eeef1534bde.zip
but i recommend my fork because it has an rgba4 bug fix.

I looking binary file ctpktool.exe, Even yours is useless without creating that file.
 
Last edited by Xmortal,
Decoded the file status_u.ctpk.lz via FEAT.
As a result, I got a folder with graphical .PNG and .XML files.
I changed them and encrypted them back with ctpktool.
After that, I used DSDecmp4to encrypt the file and got status_u.ctpk.lz.
Collected ROM and launched in Citra. As a result, I received a green screen instead of a texture. What to do? :huh:
XIwC4IU8Yvo.jpg
Did you find solution for this?
 

Site & Scene News

Popular threads in this forum