ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Wed Dec 13, 2017 8:56 am

All times are UTC




Post new topic  Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Wed Nov 29, 2017 3:36 pm 

Joined: Thu May 18, 2017 10:35 am
Posts: 6
can anyone help me with these image files? there are multiple headers in them (does it mean there are more than one image in each one?)
I have some experience with coding in .net and stuff but i have no experience with finding patterns in binary. so I would appreciate if anyone could at least put me on the right track. I don't even know where to start
here's a sample of some of the files
https://www.mediafire.com/file/k5kdaz5z ... Sample.zip

Edit :they're from "vainglory"
both iOS and android versions use this format


Last edited by verticalD on Wed Nov 29, 2017 3:53 pm, edited 3 times in total.

Top
   
PostPosted: Wed Nov 29, 2017 3:47 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 7236
Remember to specify the name of the game


Top
   
PostPosted: Wed Nov 29, 2017 4:56 pm 

Joined: Fri Oct 27, 2017 7:36 pm
Posts: 32
does the game matter? the structure seems obvious.

Code:
struct
{
   int32   filesize;
   int32   nr_mipmaps;
   int32   unk0;
   int32   unk1;
   int32   width;
   int32   height;
}multi_header;

for nr_mipmaps

int32   size_chunk;

struct
{
   int32   magic;
   int32   size_payload;
   int32   FOURCC_webp;
   int32   FOURCC_vfmt;
   int32   size_vfragment

   char   data[size_vfragment]
}file_webp;


Top
   
PostPosted: Wed Nov 29, 2017 6:32 pm 

Joined: Thu May 18, 2017 10:35 am
Posts: 6
episoder wrote:
does the game matter? the structure seems obvious.

Code:
struct
{
   int32   filesize;
   int32   nr_mipmaps;
   int32   unk0;
   int32   unk1;
   int32   width;
   int32   height;
}multi_header;

for nr_mipmaps

int32   size_chunk;

struct
{
   int32   magic;
   int32   size_payload;
   int32   FOURCC_webp;
   int32   FOURCC_vfmt;
   int32   size_vfragment

   char   data[size_vfragment]
}file_webp;

well its a moba, and mobas are addictive as hell.
thank you man, now im on the right track.
im assuming by "unk0" you mean unknown right?
if I understand correctly each file has the first part until 'height' and then each mipmap starts at the 'size chunk' line and ends with the file itself. and then right at the end of the file the next mipmap with its 'size chunk' starts. is that correct?


Top
   
PostPosted: Wed Nov 29, 2017 8:25 pm 

Joined: Fri Oct 27, 2017 7:36 pm
Posts: 32
yep. unkX is unknown purpose. width and height are basicly engine internal. the dimensions of the biggest mimap. and...

the files you gotta extract are basicly just the first mipmap. which start at the first 'R'I'F'F' magic. that is the start of the header of the webp file format. the size_chunk before that tells you how large the entire webp file for this particular mipmap is.


Top
   
PostPosted: Sat Dec 02, 2017 1:18 am 
User avatar

Joined: Fri Aug 08, 2014 1:06 am
Posts: 362
episoder wrote:
does the game matter?

of course! posting the game name, platform and format will leave enough breadcrumbs in
Google search so the next guy can find this thread and not have to start from scratch :)

here is a bms script based on episoder's findings :D
Code:
# script for QuickBMS http://aluigi.altervista.org/quickbms.htm

get FILESIZE long
get NUM_MIPS long
get UNK long
get UNK2 long
get WIDTH long
get HEIGHT long
for i = 0 < NUM_MIPS
   get SIZE long
   savepos OFFSET
   get NAME basename
   string NAME + _
   string NAME + i   
   string NAME + .webp
   if i == 0
      log NAME OFFSET SIZE
   endif
   math OFFSET + SIZE
   goto OFFSET
next i

it is currently set to write out only largest mip.
comment out lines 16 and 18 to write out all mips.
you can open these webp files in IrfanView.

_________________
Quickbms.com link thread
Search bms scripts


Top
   
PostPosted: Sat Dec 02, 2017 10:43 pm 

Joined: Thu May 18, 2017 10:35 am
Posts: 6
Acewell wrote:
episoder wrote:
does the game matter?

of course! posting the game name, platform and format will leave enough breadcrumbs in
Google search so the next guy can find this thread and not have to start from scratch :)

here is a bms script based on episoder's findings :D
Code:
# script for QuickBMS http://aluigi.altervista.org/quickbms.htm

get FILESIZE long
get NUM_MIPS long
get UNK long
get UNK2 long
get WIDTH long
get HEIGHT long
for i = 0 < NUM_MIPS
   get SIZE long
   savepos OFFSET
   get NAME basename
   string NAME + _
   string NAME + i   
   string NAME + .webp
   if i == 0
      log NAME OFFSET SIZE
   endif
   math OFFSET + SIZE
   goto OFFSET
next i

it is currently set to write out only largest mip.
comment out lines 16 and 18 to write out all mips.
you can open these webp files in IrfanView.

I already made a console tool for it but man you make it look hella easy with this script. also some of them with extended webp format (VP8X) wont show properly using normal viewers.(irfanview included). even chrome and the official webp library released by google didn't show them properly for some reason. you'll have to use picasa or "file viewer plus" or something like that.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 7 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