Edit Anything

Professional text and hex editing
with Binary Templates technology.

SweetScape Knowledgebase
KB1028: How do I insert data into a file using a script?

When working with scripts, assigning to a template variable or using the 'Write' functions (WriteByte, WriteUByte, WriteInt, WriteUInt, etc.) only overwrites data and can not be used to insert data to a file. To insert data into a file use the 'InsertBytes' function. This function inserts bytes with a zero value which can then be filled using any of the 'Write' functions. For example, the following inserts 4 bytes at address 16:

    InsertBytes( 16, 4 );
    WriteUInt( 16, 0xffffffff );

Back to knowledgebase index
Back to main support page

Our Products

Latest News

- 010 Editor
is now available.

Download it now!
What's New in 8.0?

Join our newsletter to receive tips and tricks on hex editing, special offers, and news from SweetScape Software Inc.

Sign-up Now...