Jump to content

Juiced (PC) *.d8t / *.d8w


Go to solution Solved by ikskoks,

Recommended Posts

  • 1 month later...
  • Engineers
Posted (edited)

*.d8w = table

*.d8t = raw data

uint32 Count;
FSkip(20);

struct
{
    uint32 RawDataSize;
    char PixelFormat[4];
    uint32 TextureWidth;
    uint32 TextureHeight;
    uint32 Unknown_0;
    uint32 Unknown_1;
    uint32 Unknown_2;
    uint32 Unknown_3;
    uint32 Unknown_4;
    uint32 Unknown_5;
    float Unknown_6;
    uint32 Unknown_7;
}Table[Count];

 

Edited by h3x3r
  • Engineers
Posted

So here's bms to unpack it. You must rename d8t to match name of d8w.

###################################
get BaseFileName basename

open FDDE d8w 0
open FDDE d8t 1

get Files uint32
getdstring dummy 0x14

for i = 0 < Files
	savepos InfoOffset
	get RawDataSize uint32
	getdstring InfoSize 0x2C
	
	savepos RawOffset 1
	getdstring RawData RawDataSize 1
	
	string InfoFileName p= "%s/%u.jtex" BaseFileName RawOffset
	string RawFileName p= "%s/%u.jtex" BaseFileName RawOffset
	
	append 0
	log InfoFileName InfoOffset 48
	log RawFileName RawOffset RawDataSize 1
next i

And here's Noesis script for unpacked *.jtex files.

from inc_noesis import *
import noesis
import rapi
import os

def registerNoesisTypes():
   handle = noesis.register("Juiced - Texture", ".jtex")
   noesis.setHandlerTypeCheck(handle, noepyCheckType)
   noesis.setHandlerLoadRGBA(handle, noepyLoadRGBA)
   noesis.logPopup()
   return 1
        
def noepyCheckType(data):
   bs = NoeBitStream(data)
   if len(data) < 20:
      return 0
   return 1
   
def noepyLoadRGBA(data, texList):
    bs = NoeBitStream(data)
    baseName = rapi.getExtensionlessName(rapi.getLocalFileName(rapi.getInputName()))
    bs.read(4)
    PixelFormat = bs.readUInt()
    TexWidth = bs.readUInt()
    TexHeight = bs.readUInt()
    bs.read(32)
        
    if PixelFormat == 827611204:
        TexSize = TexWidth * TexHeight //2 # DXT1
        print("Pixel Format > DXT1")
    elif PixelFormat == 894720068:
        TexSize = TexWidth * TexHeight # DXT5
        print("Pixel Format > DXT5")
    elif PixelFormat == 21:
        TexSize = TexWidth * TexHeight *4 # RGBA8
        print("Pixel Format > RGBA8")
    else:
        print("Unknown Pixel Format > ",PixelFormat)

    data = bs.readBytes(TexSize)                       
    if PixelFormat == 827611204:
        texFmt = noesis.NOESISTEX_DXT1
    elif PixelFormat == 894720068:
        texFmt = noesis.NOESISTEX_DXT5
    elif PixelFormat == 21:
        texFmt = noesis.NOESISTEX_RGBA32           
    texList.append(NoeTexture(rapi.getInputName(), TexWidth, TexHeight, data, texFmt))
    return 1

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...