Join also our Discord channel! Click here.

Is there a Hex Editor that do batch delete byte?

Coders and would-be coders alike, this is the place to talk about programming.
Post Reply
User avatar
petventh18
beginner
Posts: 35
Joined: Sat Mar 25, 2017 1:40 am
Has thanked: 14 times
Been thanked: 2 times

Is there a Hex Editor that do batch delete byte?

Post by petventh18 » Wed Aug 05, 2020 2:41 am

Hi, so I have a bunch of DDS textures I extracted from a CryEngine game but all the texture files have some random bytes before the extension .DDS...
I will be able to view those file(s) as normal dds texture as long as I delete those bytes using a hex editor and gave it the .DDS extension afterward.

So my question is, is it possible to automate this process? Some kind of command-line tool to patch these files?
Or is there any Hex Editor that will allow you to write a script (or any sort of the like) that tell the Hex Editor to look through all the files of (say Texture Folder) and delete everything (bytes) that come before DDS then save it/rename it/override it (or whatever work as long as it delete those byte).

It look like these screenshots for all of the texture files.
Image
Image
Image

If anyone have any idea of how to tackle this kind of problem then please do share them and help a brother out, huh?

Sample
406588021295361925817424315325322206345.rar
You do not have the required permissions to view the files attached to this post.

User avatar
Acewell
VIP member
VIP member
Posts: 1317
Joined: Wed Nov 05, 2008 12:16 pm
Has thanked: 2652 times
Been thanked: 816 times

Re: Is there a Hex Editor that do batch delete byte?

Post by Acewell » Wed Aug 05, 2020 3:06 am

here is a script for Quickbms that will do what you want. :D

Code: Select all

# script for QuickBMS http://aluigi.altervista.org/quickbms.htm

get NAME basename
get SIZE asize
string NAME + ".dds"
findloc OFFSET binary "\x44\x44\x53\x20"
math SIZE - OFFSET
log NAME OFFSET SIZE

User avatar
petventh18
beginner
Posts: 35
Joined: Sat Mar 25, 2017 1:40 am
Has thanked: 14 times
Been thanked: 2 times

Re: Is there a Hex Editor that do batch delete byte?

Post by petventh18 » Wed Aug 05, 2020 5:33 am

Acewell wrote:
Wed Aug 05, 2020 3:06 am
here is a script for Quickbms that will do what you want. :D

Code: Select all

# script for QuickBMS http://aluigi.altervista.org/quickbms.htm

get NAME basename
get SIZE asize
string NAME + ".dds"
findloc OFFSET binary "\x44\x44\x53\x20"
math SIZE - OFFSET
log NAME OFFSET SIZE
Oh WOW! You're my hero! If only I had ask a little sooner lol... I spent a few hours deleting those annoying bytes manually for the meshes. :cry:
Thanks a bunch... it works perfectly... Really saved my ass...

Post Reply