ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Thu Oct 19, 2017 4:22 pm

All times are UTC




Post new topic  Reply to topic  [ 18 posts ] 
Author Message
PostPosted: Sun May 01, 2016 11:21 pm 

Joined: Sun May 01, 2016 10:06 pm
Posts: 40
Yet another update: Updated script to make use of ps_lz77 decompression in 0.7.5-0.7.6a. Edit line 23 to set your platform. Comment/remove lines 152 & 155-161 if using in 0.7.7+. No reimport.


Attachments:
pc_psvita_hyperdevotion_noire_tex2dds.zip [3.69 KiB]
Downloaded 149 times


Last edited by TheUkrainianBard on Sun Aug 28, 2016 7:40 am, edited 7 times in total.
Top
   
PostPosted: Mon May 02, 2016 1:29 pm 

Joined: Sun May 01, 2016 10:06 pm
Posts: 40
A small find for 3rd group: going in-game and looking at Gallery, it looks like there are DXT-ish compression artifacts and compression ratio seems to be 4:1.


Attachments:
File comment: A cutout of texture - 8x zoomed
DXT_compression_artifacts_8x.png [27.76 KiB]
Not downloaded yet
Top
   
PostPosted: Mon May 02, 2016 4:04 pm 
User avatar

Joined: Fri Aug 08, 2014 1:06 am
Posts: 333
this is what i see :D
sample 1 is 142x212 bgra8888 with 28 byte header, imgFmt at 0x0C (00 40), width at 0x14 and height at 0x18
sample 2 is 1920x1312 bgra8888 with 16 byte header, imgFmt at 0x00 (00 40), width at 0x08 and height at 0x0C
sample 3 is 3728x1088 dxt5 with a 28 byte header, imgFmt at 0x0C (00 20), width at 0x14 and height at 0x18
i'm not sure about sample 4 yet, will have a better look later. imgFmt at 0x0C (00 10), width at 0x14 and height at 0x18


Last edited by Acewell on Tue May 03, 2016 6:34 am, edited 1 time in total.

Top
   
PostPosted: Mon May 02, 2016 4:53 pm 

Joined: Sun May 01, 2016 10:06 pm
Posts: 40
Acewell, thank you.
After some brainstorming myself I too understood that Group 3 is DXT5.
Here's the DDS file (I think it's correct) of that sample.

Group 4 may be 1920x1088 DXT1 files...


Attachments:
Bg0001.zip [1.16 MiB]
Downloaded 86 times
Top
   
PostPosted: Mon May 02, 2016 11:48 pm 
User avatar

Joined: Fri Aug 08, 2014 1:06 am
Posts: 333
my concern about 2s001.tex is the height in the header isn't matching the displayed image, as if the image data was truncated or something. it looks cut off in both Noesis and TextureFinder. :?
The sample 4 files could be dxt1 i guess, Bg9998.tex is all white and Bg9999.tex is all black except for two small spots.

I can make a script for Noesis that will open your samples on 2 conditions, they have a .tex extension and are already decompressed.
Noesis is capable of decompressing them on the fly but this level of scripting is beyond my experience level.
the fmt_bulletwitch_cpr.py script has an example of that and there is Noesis tutorial for Zlib here
http://forum.xentax.com/viewtopic.php?f=29&t=7813

the compressed textures header look like this to me
4 bytes - magic (ZLIB)
4 bytes - uncompressed data size
4 bytes - compressed data size
start of compressed data


Top
   
PostPosted: Tue May 03, 2016 7:57 am 

Joined: Sun May 01, 2016 10:06 pm
Posts: 40
Acewell wrote:
my concern about 2s001.tex is the height in the header isn't matching the displayed image, as if the image data was truncated or something. it looks cut off in both Noesis and TextureFinder.

Uh, whoops, I forgot to mention that it was cut with filecutter.bms because it was too big to upload, even zipped. It's real size is 10 076 176 bytes, deflate-32K-128word compresses it to 2 717 258.
Sorry.


Top
   
PostPosted: Tue May 03, 2016 12:35 pm 
User avatar

Joined: Fri Aug 08, 2014 1:06 am
Posts: 333
here try my Noesis script :D
Attachment:
tex_HyperdevotionNoire_tex.zip [882 Bytes]
Downloaded 142 times


supports rgba8888, dxt1, dxt5
works only on uncompressed textures.....for now


Top
   
PostPosted: Tue May 03, 2016 4:16 pm 

Joined: Sun May 01, 2016 10:06 pm
Posts: 40
Acewell, again, thank you. ;)
Meanwhile, I made a BMS script that recreates DDS header from .tex header with "Texture " ID. I will add .tex w/o that ID soon, ZLIB'd - Soon™ (once I understand how to do it all inside one BMS script).

UPD: all .tex should be approachable now.


Last edited by TheUkrainianBard on Thu Jun 09, 2016 4:07 pm, edited 2 times in total.

Top
   
PostPosted: Sun May 08, 2016 11:03 am 

Joined: Sun May 01, 2016 10:06 pm
Posts: 40
Turns out there's more hurdle: custom LZ77 BGRA8888 pixel data, which is, apparently, typical for Japanese PS3/PSVita games and their ports to Windows. I've found that someone already cracked into it (that C++ code seemed awfully familiar), but the decompression itself is in inline ASM and I can't read ASM.

UPD2 (2016/05/09 14:38 UTC): bit flags go first (the size of this part is 1/8th of the bulk, give or take 1B), then the bulk of compressed data, then dictionary, maybe?


Attachments:
File comment: Some examples
Object.zip [550.12 KiB]
Downloaded 95 times


Last edited by TheUkrainianBard on Sat Jun 11, 2016 3:19 pm, edited 1 time in total.
Top
   
PostPosted: Thu Jun 09, 2016 4:07 pm 

Joined: Sun May 01, 2016 10:06 pm
Posts: 40
That was a specific implementation of LZSS. I hope I've commented the lines enough for people to understand.

UPD2 (2016/06/11 15:12 UTC): this seems final...
UPD3 (2016/08/07 11:21 UTC): updated the message a bit.
UPD4 (2016/08/10 18:56 UTC): moved everything to OP.


Last edited by TheUkrainianBard on Wed Aug 10, 2016 6:56 pm, edited 4 times in total.

Top
   
PostPosted: Fri Aug 05, 2016 12:30 pm 

Joined: Fri Aug 05, 2016 12:26 pm
Posts: 4
Hey, I just ripped game tex file from PSVita.
But I dont convert tex file.
here is a tex file from vita version
Someone can analysis and make script?


Attachments:
town2.zip [6.72 KiB]
Downloaded 51 times
Top
   
PostPosted: Sat Aug 06, 2016 7:26 pm 

Joined: Sun May 01, 2016 10:06 pm
Posts: 40
Suprisingly, I didn't even change anything in my script.
Can you provide more examples, "Obj0__.tex" etc?


Attachments:
town2.png [6.29 KiB]
Not downloaded yet
Top
   
PostPosted: Sun Aug 07, 2016 3:29 am 

Joined: Fri Aug 05, 2016 12:26 pm
Posts: 4
Yeah I can extract some Vita's tex file. but color is different.
Image
this is screent shot of Vita version,but extracted vita's file's color is different(town1.tex)
Image
Do you know what is wrong?

and I found some of Vita's file cant convert(but PC's can convert)
ex:FontGp_data.tex
(Vita)
Image
(PC)
Image


TheUkrainianBard wrote:
Suprisingly, I didn't even change anything in my script.
Can you provide more examples, "Obj0__.tex" etc?


Attachments:
File comment: It is Town1.tex(Vita's file),screen shot of VitaVersion(Jp), and FontGp_data.tex(PC and Vita files)
tex.zip [981.5 KiB]
Downloaded 77 times
Top
   
PostPosted: Sun Aug 07, 2016 11:10 am 

Joined: Sun May 01, 2016 10:06 pm
Posts: 40
I think I got it. Maybe.
Issue #1 was different channel order (PC textures were BGRA, provided PSVita texture is RGBA);
Issue #2 - I've added a dirty 4bpp grayscale texture support.

Please test and, if possible, report.


Last edited by TheUkrainianBard on Sun Aug 07, 2016 5:42 pm, edited 1 time in total.

Top
   
PostPosted: Sun Aug 07, 2016 3:38 pm 

Joined: Fri Aug 05, 2016 12:26 pm
Posts: 4
TheUkrainianBard wrote:
I think I got it. Maybe.
Issue #1 was different channel order (PC textures were BGRA, provided PSVita texture is RGBA);
Issue #2 - I've added a dirty 4bpp grayscale texture support.

Please test and, if possible, report.

Thanks! I can convert!Image
and Is it difficult to reimport? I try reimport.bat, but both of your scripts doesn't work for reimport.

One more, do you convert this file? (PC's FontMes_data_rg.tex) I cant convert it(but Vita's same name file can convert.)

thanks!


Attachments:
FontMes_data_rg.zip [182.39 KiB]
Downloaded 59 times
Top
   
PostPosted: Sun Aug 07, 2016 5:45 pm 

Joined: Sun May 01, 2016 10:06 pm
Posts: 40
Sorry, it's impossible to reimport. I'm a newbie - I focused on extraction.
Try this to extract that PC "FontMes_data_rg.tex" character map you've attached.


Attachments:
File comment: The result.
FontMes_data_rg.png [114.64 KiB]
Not downloaded yet


Last edited by TheUkrainianBard on Wed Aug 10, 2016 6:30 pm, edited 1 time in total.
Top
   
PostPosted: Mon Aug 08, 2016 11:27 am 

Joined: Fri Aug 05, 2016 12:26 pm
Posts: 4
ok, thanks


Top
   
PostPosted: Tue Mar 07, 2017 3:17 pm 

Joined: Mon Mar 06, 2017 11:10 pm
Posts: 3
Hi,

Can anyone please give me a script to convert the attached .tex images to dds (or png) and from dds to tex.

I can pay anyone who wants to do it as job.

Thanks


Attachments:
TEX files.zip [255.73 KiB]
Downloaded 42 times
Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 18 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited