XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Mon May 29, 2017 4:25 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Header Renamer? (quickbms)
PostPosted: Sun Oct 02, 2016 1:42 am 
Offline
ultra-n00b

Joined: Mon Oct 06, 2014 2:00 am
Posts: 6
Has thanked: 2 times
Have thanks: 0 time

-Gah! sorry admins, i posted this previously in the wrong spot.


So i'm trying to cook up a quickbms / or (some other type of script) that could take my textures header ".XETU" and spit out the file 100% unmodified except i need the header replaced with ".XETV" [one single byte change]

This can be done with HEX manually yes, but i have over 1000+ textures i need to header replace, so you can imagine the issue here...

How would i go about this?


Sorry if this is in the wrong place... again..

You can make the ads go away by registering



Top
 Profile  
 
 Post subject: Re: Header Renamer? (quickbms)
PostPosted: Sun Oct 02, 2016 2:46 pm 
Offline
Moderator

Joined: Mon Jul 05, 2010 8:55 pm
Posts: 577
Has thanked: 19 times
Have thanks: 207 times
What game? what platform?

Also, Quickbms can do this, but it might take a few lines. Probably better to do it in C/C++ (would take very few lines of code).

Cheers.

_________________
Click the thanks button if I helped!


Top
 Profile  
 
 Post subject: Re: Header Renamer? (quickbms)
PostPosted: Sun Oct 02, 2016 6:13 pm 
Offline
VIP member
VIP member
User avatar

Joined: Wed Nov 05, 2008 12:16 pm
Posts: 772
Has thanked: 1692 times
Have thanks: 382 times
stipo360 wrote:
So i'm trying to cook up a quickbms / or (some other type of script) that could take my textures header ".XETU" and spit out the file 100% unmodified except i need the header replaced with ".XETV"

i'm working on a simple bms script but i need to see a sample to know exactly what the header is in binary :D
i got the XETU to XETV working, i just need to know what that dot is

the double zero is a place holder until i can see a sample
Code:
idstring "\x00XETU" #".XETU"
get NAME filename
set MEMORY_FILE binary "\x00\x58\x45\x54\x56" #".XETV"
log NAME 0 0x5 MEMORY_FILE
append
get SIZE asize
math OFFSET = 0x5
math SIZE - OFFSET
log NAME OFFSET SIZE

_________________
Noesis
Hex2obj
QuickBMS
TextureFinder
Unity Assets Bundle Extractor


Top
 Profile  
 
 Post subject: Re: Header Renamer? (quickbms)
PostPosted: Sun Oct 02, 2016 7:41 pm 
Offline
ultra-n00b

Joined: Mon Oct 06, 2014 2:00 am
Posts: 6
Has thanked: 2 times
Have thanks: 0 time
AceWell wrote:
stipo360 wrote:
So i'm trying to cook up a quickbms / or (some other type of script) that could take my textures header ".XETU" and spit out the file 100% unmodified except i need the header replaced with ".XETV"

i'm working on a simple bms script but i need to see a sample to know exactly what the header is in binary :D
i got the XETU to XETV working, i just need to know what that dot is

the double zero is a place holder until i can see a sample
Code:
idstring "\x00XETU" #".XETU"
get NAME filename
set MEMORY_FILE binary "\x00\x58\x45\x54\x56" #".XETV"
log NAME 0 0x5 MEMORY_FILE
append
get SIZE asize
math OFFSET = 0x5
math SIZE - OFFSET
log NAME OFFSET SIZE




Thank you for the help so far!! It works perfectly as is, because the header in HEX is written "00 58 45 54 55" so the first '.' is actually just 00
The "U" at the end of the header is a version number, and doesn't impact the file whatsoever, the reason it needs to be set to "V" is because noesis and other texture viewers are only setup to read ".XETV"

Image

I replaced idstring "\x00XETU" with get NAME basename because i have multiple texture headers i need spat out in .XETV, but everything else is perfectoo.


Also the only issue is if i do replace, the resulting file is data-less, only header :p quickbms rename is the only way to go about it currently (not really a big issue, just an inconvenience to spit out doubles of each texture with _00000001 lol)


Gh0stBlade wrote:
What game? what platform?


These textures are from the Beta of Dead Rising.


Top
 Profile  
 
 Post subject: Re: Header Renamer? (quickbms)
PostPosted: Sun Oct 02, 2016 9:48 pm 
Offline
VIP member
VIP member
User avatar

Joined: Wed Nov 05, 2008 12:16 pm
Posts: 772
Has thanked: 1692 times
Have thanks: 382 times
stipo360 wrote:
...the reason it needs to be set to "V" is because noesis and other texture viewers are only setup to read ".XETV"

if you have a Noesis script to open these textures i could just modify the type checking in it to accept them, so no need for bms script here :D


Quote:
I replaced idstring "\x00XETU" with get NAME basename because i have multiple texture headers i need spat out in .XETV,

i don't understand, idstring is just a type check so you don't mistakenly modify the wrong files and basename doesn't grab the extension :)

_________________
Noesis
Hex2obj
QuickBMS
TextureFinder
Unity Assets Bundle Extractor


Top
 Profile  
 
 Post subject: Re: Header Renamer? (quickbms)
PostPosted: Mon Oct 03, 2016 5:02 am 
Offline
ultra-n00b

Joined: Mon Oct 06, 2014 2:00 am
Posts: 6
Has thanked: 2 times
Have thanks: 0 time
AceWell wrote:
i don't understand, idstring is just a type check so you don't mistakenly modify the wrong files and basename doesn't grab the extension :)



Ah see, my BMS knowledge isn't so sharp haha. However! I do know of its use in this case,
if idstring tries to find "XETU" then it will never find the other formats i have, such as XET@ and XETH, so by making it skip that check, it wont really matter whats written there, it'll overwrite it. However i DO notice an issue with this, as now it just tries to re-header anything you throw at it, instead of making sure its really a beta texture lol!

So, my question is: would there be a way to write something like this: (Note: i understand this isn't at all a correct syntax, but i'm insinuating writing someone along these lines :p)

idstring "\x00XETU
or
idstring "\x00XET@
or
idstring "\x00XETH


Writing it this way would attack any files with such headers, and skip what doesn't. How would such a thing be written? 0.o
Despite my best efforts of reading through tutorials, i can't find anyway to make idstring have multiple possibilities...


Top
 Profile  
 
 Post subject: Re: Header Renamer? (quickbms)
PostPosted: Mon Oct 03, 2016 5:22 pm 
Offline
VIP member
VIP member
User avatar

Joined: Wed Nov 05, 2008 12:16 pm
Posts: 772
Has thanked: 1692 times
Have thanks: 382 times
try this, didn't have any of your samples to test it on (:
Code:
get MAGIC long
get VERSION byte
if VERSION == 0x55                               #".XETU"
   get NAME filename
   set MEMORY_FILE binary "\x00\x58\x45\x54\x56" #".XETV"
   log NAME 0 0x5 MEMORY_FILE
   append
   get SIZE asize
   math OFFSET = 0x5
   math SIZE - OFFSET
   log NAME OFFSET SIZE
elif VERSION == 0x48                             #".XETH"
   get NAME filename
   set MEMORY_FILE binary "\x00\x58\x45\x54\x56" #".XETV"
   log NAME 0 0x5 MEMORY_FILE
   append
   get SIZE asize
   math OFFSET = 0x5
   math SIZE - OFFSET
   log NAME OFFSET SIZE
elif VERSION == 0x40                             #".XET@"
   get NAME filename
   set MEMORY_FILE binary "\x00\x58\x45\x54\x56" #".XETV"
   log NAME 0 0x5 MEMORY_FILE
   append
   get SIZE asize
   math OFFSET = 0x5
   math SIZE - OFFSET
   log NAME OFFSET SIZE
else
   get NAME filename
   print "%NAME% is version:%VERSION% which is not supported yet!"
endif


it'd be alot easier if you could just link to the Noesis script you mentioned earlier,
then i could just modify the type checking to support however many versions you have. :)

edit
never mind, it looks like that plugin is compiled into noesis.dll and there is no source :(
if you upload some unaltered texture samples i will make a python script that can be extended.


_________________
Noesis
Hex2obj
QuickBMS
TextureFinder
Unity Assets Bundle Extractor


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 5 guests


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:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group