ROM Hack [Release] CTPK Tool

DarkSynopsis

Well-Known Member
Member
Joined
Oct 15, 2014
Messages
483
Trophies
0
Age
33
Location
New Zealand
Website
ninjasfate.com
XP
2,611
Country
New Zealand
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.
 

Giodude

GBAtemp's official rock
Member
Joined
May 17, 2015
Messages
5,094
Trophies
1
Age
23
Location
New York
XP
2,761
Country
United States
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?
 

bqio

Active Member
Newcomer
Joined
Mar 30, 2017
Messages
30
Trophies
0
Age
25
XP
207
Country
Russia
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,

Subötaï

Well-Known Member
Member
Joined
Jul 13, 2016
Messages
141
Trophies
0
Age
34
XP
926
Country
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
 

Rooster33

New Member
Newbie
Joined
Sep 12, 2019
Messages
3
Trophies
0
Age
27
XP
45
Country
United Kingdom
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?
 
D

Deleted User

Guest
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.
 

Xmortal

Other Nickname Legarad
Member
Joined
May 28, 2008
Messages
306
Trophies
1
Age
36
Location
Venezuela
XP
1,105
Country
Venezuela
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,

DKH6789

Active Member
Newcomer
Joined
Jun 1, 2020
Messages
28
Trophies
0
Age
33
XP
273
Country
Vietnam
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

General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: https://www.youtube.com/watch?v=L1BDM1oBRJ8