Header Renamer? (quickbms)

Coders and would-be coders alike, this is the place to talk about programming.
Post Reply
stipo360
ultra-n00b
Posts: 6
Joined: Mon Oct 06, 2014 2:00 am
Has thanked: 2 times

Header Renamer? (quickbms)

Post by stipo360 » Sun Oct 02, 2016 1:42 am

.
Last edited by stipo360 on Fri Oct 05, 2018 4:52 am, edited 1 time in total.

Gh0stBlade
Moderator
Posts: 673
Joined: Mon Jul 05, 2010 8:55 pm
Has thanked: 20 times
Been thanked: 308 times

Re: Header Renamer? (quickbms)

Post by Gh0stBlade » Sun Oct 02, 2016 2:46 pm

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!

User avatar
Acewell
VIP member
VIP member
Posts: 1189
Joined: Wed Nov 05, 2008 12:16 pm
Has thanked: 2336 times
Been thanked: 691 times

Re: Header Renamer? (quickbms)

Post by Acewell » Sun Oct 02, 2016 6:13 pm

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: Select all

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

stipo360
ultra-n00b
Posts: 6
Joined: Mon Oct 06, 2014 2:00 am
Has thanked: 2 times

Re: Header Renamer? (quickbms)

Post by stipo360 » Sun Oct 02, 2016 7:41 pm

.
Last edited by stipo360 on Fri Oct 05, 2018 4:53 am, edited 1 time in total.

User avatar
Acewell
VIP member
VIP member
Posts: 1189
Joined: Wed Nov 05, 2008 12:16 pm
Has thanked: 2336 times
Been thanked: 691 times

Re: Header Renamer? (quickbms)

Post by Acewell » Sun Oct 02, 2016 9:48 pm

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

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 :)

stipo360
ultra-n00b
Posts: 6
Joined: Mon Oct 06, 2014 2:00 am
Has thanked: 2 times

Re: Header Renamer? (quickbms)

Post by stipo360 » Mon Oct 03, 2016 5:02 am

.
Last edited by stipo360 on Fri Oct 05, 2018 4:53 am, edited 1 time in total.

User avatar
Acewell
VIP member
VIP member
Posts: 1189
Joined: Wed Nov 05, 2008 12:16 pm
Has thanked: 2336 times
Been thanked: 691 times

Re: Header Renamer? (quickbms)

Post by Acewell » Mon Oct 03, 2016 5:22 pm

try this, didn't have any of your samples to test it on (:

Code: Select all

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.

Post Reply