Setting a byte offset in a flat structure
Use a SetElementProperty and a GetElementProperty function to edit a byte offset in an element.
Before you begin
About this task
A1111B2222C00003333
Procedure
- Open the Util tab for the c element.
- Drag and drop a SetElementProperty function in the Util tab.
- Drag and drop an Add function on the Value argument.
- Drag and drop a GetElementProperty function on the First Value argument.
- Double-click the GetElementProperty function and select Byte offset in the Property drop-down list, then click OK.
- Drag and drop the c element on the Element argument of the GetElementProperty function.
- Drag and drop a Constant function on the Second Value argument.
- Double-click the Constant function and enter 4 in the Value field, then click OK.
Results
If you want to check that the new offset is correct, you can create a map with this
structure as both input and output.
When using the Test Run feature, you should get the
following result:
A1111B2222C3333