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

PS3 How to train your dragon 2 hunkfile

The Original Forum. Game archives, full of resources. How to open them? Get help here.
Post Reply
User avatar
PredatorCZ
mega-veteran
mega-veteran
Posts: 291
Joined: Mon Apr 21, 2014 8:32 pm
Has thanked: 11 times
Been thanked: 256 times
Contact:

PS3 How to train your dragon 2 hunkfile

Post by PredatorCZ »

Sup, Im not an archive guy and if I ever try it will take a long time.
Sample hir.
Would be happy if anyone make bms script for it.
You do not have the required permissions to view the files attached to this post.
Last edited by PredatorCZ on Wed Dec 24, 2014 2:53 pm, edited 1 time in total.
merlinsvk
ultra-veteran
ultra-veteran
Posts: 411
Joined: Mon Oct 27, 2008 12:11 am
Location: Slovakia
Has thanked: 35 times
Been thanked: 121 times

Re: PS3 How to train your dragon 2 hunkfile

Post by merlinsvk »

My guess for this file:

Little endian
offset 0x2DD
4 bytes (long) => width // maybe height
4 bytes (long) => height // maybe width
2 bytes (short) = > null
4 bytes (long) => texture length
4 bytes (long) => unknown
0x20000 bytes texture data

This sample file contains DXT1 512x512px texture without mipmaps.

Image
User avatar
PredatorCZ
mega-veteran
mega-veteran
Posts: 291
Joined: Mon Apr 21, 2014 8:32 pm
Has thanked: 11 times
Been thanked: 256 times
Contact:

Re: PS3 How to train your dragon 2 hunkfile

Post by PredatorCZ »

Okay, so it will be year soon since I posted it, and still nothing, I have decided to use my noob skillz and create bms script, actually I just finished it.
I will add code for texture conversion soon, and maybye ms too.

Code: Select all

# How to train your dragon 2 hunk (HNK), Little Orbit
# Author Lukáš Kužel in 2015
# script for QuickBMS http://quickbms.aluigi.org

set curoff long 0
set size long 0
set curname string ""
get fsiz ASIZE
math fsiz -= 8
for i = 0 < fsiz
  savepos Slump
  get LumpLen long
  get LumpID long 
  if LumpID == 0x40071   
    get unk11 short
    get unk12 short
    get unk13 short 
    get typelength short
    get namelength short 
    getdstring TYPE typelength
    getdstring curname namelength 
    string curname + "."
    string curname + TYPE
  elif LumpID == 0x40070     
    get blcount short
    get unk22 short
    get unk23 short 
    get unk24 short   
    get unk25 long  
    get usedblocks long 
    for i2 = 0 < blcount
      getdstring name 64 
      get unk26 long  // offset or size?
      get unk27 long  // identifier, last short from lumpid
    next i2
  elif LumpID == 0x40072    
    math size = Slump
    math size -= curoff
    log curname curoff size
    //Print "Log %curname% %curoff% %size%"
    math curoff = 0
  elif curoff == 0 
    math curoff = Slump
    goto LumpLen 0 SEEK_CUR  
  else
    goto LumpLen 0 SEEK_CUR                                                                                                    
  endif
  if fsiz == Slump
    cleanexit
  endif 
next i
User avatar
PredatorCZ
mega-veteran
mega-veteran
Posts: 291
Joined: Mon Apr 21, 2014 8:32 pm
Has thanked: 11 times
Been thanked: 256 times
Contact:

Re: PS3 How to train your dragon 2 hunkfile

Post by PredatorCZ »

And we have texture conversion to dds.

Code: Select all

# How to train your dragon 2 Texture to dds (TSETexture), Little Orbit
# Author Lukáš Kužel in 2015
# script for QuickBMS http://quickbms.aluigi.org

get ddsname BASENAME 
string ddsname + ".dds"

log MEMORY_FILE 0 0

Put 0x20534444 Long MEMORY_FILE  
Put 0x7c long MEMORY_FILE 
     
set flags long 7
math flags | 0x1000
math flags | 0x8
math flags | 0x800000
Put flags Long MEMORY_FILE

goto 8
get type byte
goto 19
get size1 short
get size2 short
goto 100
get size3 long
get lumpid long

Put size2 Long MEMORY_FILE
Put size1 Long MEMORY_FILE
Put 0 Long MEMORY_FILE
Put 1 Long MEMORY_FILE
Put 11 Long MEMORY_FILE   // mipmaps
Put 0 Long MEMORY_FILE
Put 0 Long MEMORY_FILE
Put 0 Long MEMORY_FILE
Put 0 Long MEMORY_FILE
Put 0 Long MEMORY_FILE
Put 0 Long MEMORY_FILE
Put 0 Long MEMORY_FILE
Put 0 Long MEMORY_FILE
Put 0 Long MEMORY_FILE
Put 0 Long MEMORY_FILE
Put 0 Long MEMORY_FILE
Put 0x20 Long MEMORY_FILE
Put 5 Long MEMORY_FILE

if type == 0xa1
  Put 0x31545844 Long MEMORY_FILE 
else
  Put 0x35545844 Long MEMORY_FILE 
endif
   
Put 0 Long MEMORY_FILE
Put 0 Long MEMORY_FILE
Put 0 Long MEMORY_FILE
Put 0 Long MEMORY_FILE
Put 0 Long MEMORY_FILE

set pflags long 0x400000
math pflags | 0x1000
math pflags | 5

Put pflags Long MEMORY_FILE
Put 0 Long MEMORY_FILE
Put 0 Long MEMORY_FILE
Put 0 Long MEMORY_FILE
Put 0 Long MEMORY_FILE


set fsize 125
math fsize += size3

for i = 0 < size3
  get tmp byte
  Put tmp byte MEMORY_FILE
next i 

goto 0 MEMORY_FILE
log ddsname 0 fsize MEMORY_FILE
keybladegames
ultra-n00b
Posts: 1
Joined: Wed Feb 16, 2022 7:59 am

Re: PS3 How to train your dragon 2 hunkfile

Post by keybladegames »

it doesn't work at all.
Post Reply