Hex replace size Log Out | Topics | Search
Moderators | Edit Profile

X-Ways Support Forum » Hex Editing » Hex replace size « Previous Next »

Author Message
Top of pagePrevious messageNext messageBottom of page Link to this message

rcole@emagsolutions.co.uk
Username: roncole

Registered: N/A
Posted on Friday, Feb 15, 2008 - 18:17:   

I am looking to replace a repeat block of hex values in a file with blanks so essentially striping them out.
The size of the repeat block I am looking to strip out is 544 bytes in size, however the replace hex values only seems to accept 50 bytes, which is very low, are there any settings I can chose to increase this, of is there another way to strip out a repeat block this size.
Top of pagePrevious messageNext messageBottom of page Link to this message

Stefan Fleischmann
Username: admin

Registered: 1-2001
Posted on Friday, Feb 15, 2008 - 20:13:   

Whether you wish to replace the hex values with something or remove them I'm not sure, but you could use Edit | Fill Block or Edit | Remove manually or, if too many blocks to replace/remove, use a script.
Top of pagePrevious messageNext messageBottom of page Link to this message

rcole@emagsolutions.co.uk
Username: roncole

Registered: N/A
Posted on Friday, Feb 15, 2008 - 21:17:   

Thanks for the reply. its essentially a block header so I need to remove 544bytes blocks every 65568bytes.
The bytes to remove are always the same and so a find will get them all, however the file contains several hundred thousand blocks, so manual is no good.
I select edit, highlight the 544 bytes, copy hex values and then select replace hex and paste the hex values i want to replace but when I do this only 50 bytes are pasted into the replace window, not the 544 I selected, I also cannot add more manually so the field seems to be set at 50 bytes.
Top of pagePrevious messageNext messageBottom of page Link to this message

Stefan Fleischmann
Username: admin

Registered: 1-2001
Posted on Friday, Feb 15, 2008 - 21:41:   

Yes, the limit is 50 bytes.

What you would like to accomplish can be done with a script.
Top of pagePrevious messageNext messageBottom of page Link to this message

rcole@emagsolutions.co.uk
Username: roncole

Registered: N/A
Posted on Friday, Feb 15, 2008 - 23:35:   

thanks but tried this and find the version I have bought does not do scripts, I have to buy the professional version to get scripts, wish I had known this beforehand.
Top of pagePrevious messageNext messageBottom of page Link to this message

rcole@emagsolutions.co.uk
Username: roncole

Registered: N/A
Posted on Monday, Feb 18, 2008 - 16:31:   

Have now upgraded to Professional version and I can run scripts. My script is simply
ReplaceAll 0x25........ (for all 544 hex bytes) 0x
but I get a parameter error when I try to run it, I've tried variations, without the 0x and with {down} but always the same, is the parameter too big?
Top of pagePrevious messageNext messageBottom of page Link to this message

Jens Kirschner
Username: jenskirschner

Registered: N/A
Posted on Monday, Feb 18, 2008 - 16:37:   

It is probably a lot simpler to write a script that simply writes 544 bytes of zeros and then skips the known number of bytes in between.
Top of pagePrevious messageNext messageBottom of page Link to this message

rcole@emagsolutions.co.uk
Username: roncole

Registered: N/A
Posted on Monday, Feb 18, 2008 - 16:42:   

Have now fixed this in that I have to replace it with something rather than nothing which is a bit annoying so my replace field had to contain data, how do I get it to replace all but with nothing.
Top of pagePrevious messageNext messageBottom of page Link to this message

Stefan Fleischmann
Username: admin

Registered: 1-2001
Posted on Monday, Feb 18, 2008 - 16:50:   

You cannot replace more more than 50 bytes with something else, neither with the user interface nor with a script. If you wish to overwrite certain bytes with a script, use the Write command. If you wish to remove certain bytes with a script, use the Remove command.

Add Your Message Here
Post:
Username: Posting Information:
Only registered users may post messages here, i.e. you need to have an account.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action:
Forum operated by X-Ways Software Technology AG.