increment a value at an offset in hundreds very large hex file

I have a lot of very large hex files that I need to change one value at the same offset and save to another file. I have a script that finds each file and just need to put an operator for each file.

I think sed might be able to do this but I have not used it before and would like some help. If it can't do it by offset, I believe the section before it and after it in every file, and the one value needs to be incremented.

Thanks!

-----Post Update-----

if not, is there a simple python or perl script i can write?

-----Post Update-----

if not, is there a simple python or perl script i can write?

What type of offset? Line? Byte?

What is the format of the files?

Sed is not so good for editing binary files. It's not very good at arithmetic either.

Essential to know. There is no right answer without this information.

The closest I can get to giving an answer with what little we know is that 'dd' *might* be the tool to use.

its at location 0x8F. The format is hex with a semi-ASCII header.

the part that needs to be changed is in an ASCII section of the header

Hex, as in, to encode the value 0x0032 it contains the literal ASCII characters 0032? Or hex as in binary, containing a binary representation of 0x32? How many bits? What endian?

binary hex, little endian

i was able to sort the files to where each group had the same value to be incremented and experimented with sed, which seemed to preserve the binary fine, but will be testing it out in a program monday

Which is it? Binary and hex are two different things. Or, rather, hex is an ASCII representation of binary. Does the file contain the binary or the hex representation?

And how many bits?