Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Miracle Nikki - .ktx file doesn't open

Get your graphics formats figures out here! Got details for others? Post here!
Post Reply
Lucy
ultra-n00b
Posts: 3
Joined: Sun Sep 04, 2016 7:37 am

Miracle Nikki - .ktx file doesn't open

Post by Lucy »

I have taken textures/sprites from a mobile game (Miracle Nikki) but I can't open them. They are in .ktx format but PVRTexTool doesn't open the files, tells that it is a wrong format or corrupted. I thought maybe its deciphered in some way, but I don't know anything about that so I can't know for sure, so I need some help with that ^^'
Attached is on of the textures.. :)
You do not have the required permissions to view the files attached to this post.
User avatar
ikskoks
Moderator
Posts: 1666
Joined: Thu Jul 26, 2012 5:06 pm
Location: Poland, Łódź
Has thanked: 647 times
Been thanked: 431 times
Contact:

Re: .ktx file doesn't open

Post by ikskoks »

Yeah, it is not standard KTX Image.
You can see here how it should look like http://wiki.xentax.com/index.php/KTX_Image

The one you have posted is encrypted in some way.
User avatar
aspadm
advanced
Posts: 52
Joined: Wed Nov 25, 2015 8:43 pm
Has thanked: 10 times
Been thanked: 34 times

Re: .ktx file doesn't open

Post by aspadm »

Lucy wrote: Fri Mar 05, 2021 4:11 pm I have taken textures/sprites from a mobile game (Miracle Nikki) but I can't open them.
This is custom made file format with blowfish encryption that was reverse engineered several times.
Latest version was deleted as tencent started the pursuit of enthusiasts.
User avatar
ikskoks
Moderator
Posts: 1666
Joined: Thu Jul 26, 2012 5:06 pm
Location: Poland, Łódź
Has thanked: 647 times
Been thanked: 431 times
Contact:

Re: .ktx file doesn't open

Post by ikskoks »

@aspadm, can you link to some documentation or at least some discussion regarding this format?

Also, what do you mean by "deleted"?
User avatar
aspadm
advanced
Posts: 52
Joined: Wed Nov 25, 2015 8:43 pm
Has thanked: 10 times
Been thanked: 34 times

Re: .ktx file doesn't open

Post by aspadm »

ikskoks wrote: Sat Mar 06, 2021 3:31 pm @aspadm, can you link to some documentation or at least some discussion regarding this format?
Ow, looks like they changed format.
Previous was like this:

Code: Select all

byte data[len-8]; // len = file size, must be a multiple of 8
char sign[2]; // "dr"
unsigned char version_a;
unsigned char version_b;
unsigned char trim; // number (0-7) of padding bytes
char ftype[3]; // "lua" of "png"
data is the blowfish encrypted (ECB for "png", CBC for "lua").
version_a and version_b is used in app to chose parts for key generation.

Decrypted data can be packed with LZ4.
Also, what do you mean by "deleted"?
Some time ago there was a thread on xentax where somebody :) posted a tool that decrypt files of MN (also known as "Love Nikki" etc.).
After that, one of the users (presumably from Vietnam) used this to publish information about the game events that have not yet been released, which is why tencent launched an investigation in the direction of localizers and others. The topic was removed from the forum, as the author of the tool asked for it.
Lucy
ultra-n00b
Posts: 3
Joined: Sun Sep 04, 2016 7:37 am

Re: Miracle Nikki - .ktx file doesn't open

Post by Lucy »

Thanks everyone for responses :) Thing is I know that the older version, that used .png was decrypted. But the tools for cracking the old one (at least the ones I tried before they were scrapped from internet or the ones that are still there) don't seem to work with the .ktx version. (I mean, duh, they weren't made for .ktx)
User avatar
aspadm
advanced
Posts: 52
Joined: Wed Nov 25, 2015 8:43 pm
Has thanked: 10 times
Been thanked: 34 times

Re: Miracle Nikki - .ktx file doesn't open

Post by aspadm »

From which game version did you take sample .ktx file?
"png" signature also was in .ktx files, it's just flag for chosing right encryption method.
Lucy
ultra-n00b
Posts: 3
Joined: Sun Sep 04, 2016 7:37 am

Re: Miracle Nikki - .ktx file doesn't open

Post by Lucy »

It's from miracle nikki for mainland china.
lunar23
ultra-n00b
Posts: 3
Joined: Tue Mar 16, 2021 6:46 am
Has thanked: 1 time

Re: Miracle Nikki - .ktx file doesn't open

Post by lunar23 »

hope someone can decrypt the ktx file :cry:
lunar23
ultra-n00b
Posts: 3
Joined: Tue Mar 16, 2021 6:46 am
Has thanked: 1 time

Nikki Games .ktx file help

Post by lunar23 »

I have several ktx files encoded from png files (the current png file is also an encrypted file but I can decrypt them). I used some softwares like Mali or PVRTexTool but can't open ktx file.
I hope someone can help me method to decode this ktx file. Attachments include the ktx file and the original png file.
https://drive.google.com/drive/folders/ ... sp=sharing
User avatar
aspadm
advanced
Posts: 52
Joined: Wed Nov 25, 2015 8:43 pm
Has thanked: 10 times
Been thanked: 34 times

Re: Nikki Games .ktx file help

Post by aspadm »

lunar23 wrote: Sun Mar 21, 2021 4:20 am I hope someone can help me method to decode this ktx file. Attachments include the ktx file and the original png file.
Well, this is the encrypted textures. You can see characters "dr***png" at the end of files.
They have known file structure, but sharing the decryption keys is prohibited.
lunar23
ultra-n00b
Posts: 3
Joined: Tue Mar 16, 2021 6:46 am
Has thanked: 1 time

Re: Miracle Nikki - .ktx file doesn't open

Post by lunar23 »

I desperately sought the decoding. I think the old key still works, but the script structure in bms doesn't match the new structure. Hope someone can help write a code that is suitable for the new structure. :( :( :(
User avatar
aspadm
advanced
Posts: 52
Joined: Wed Nov 25, 2015 8:43 pm
Has thanked: 10 times
Been thanked: 34 times

Re: Miracle Nikki - .ktx file doesn't open

Post by aspadm »

Well, old script or LN_decode still works for files that use old key.
For the files encrypted with new keys you must change script AND aquire 26*26-1 = 675 new keys. After that you must use right key that chosed by version_a/b fields.
Sorry, but I can't say more as it will against forum rules (rule item 3, as the keys is a part of application).
Post Reply