I’m writing my first 010 template. It’s meant for a specific binary file structure.
The file format makes use of bitfields.
Basically there are a couple of variables placed in 4 bytes.
I want my template to read the variables, but it’s not working as intended.
This is the binary file: https://phil-moss.de/share/binary.file (use right-click → save as to download)
This is my template: https://phil-moss.de/share/firsttemplate.bt (use right-click → save as to download)
As you can see, all the bitfields will add up to 32 bits (6+2+2+1+1+20=32) = 4 bytes.
But the program doesn’t try to get the last 20 bits (baseAddress) from the first four bytes in the file, but takes them from the third, fourth, fifth and sixth bytes.
The issue is that I am using int as the variable datatype. And int is a 32-bit-variable type.
To me it looks like 010 Editor only supports 16- and 32-bit variable types.
But I have to read that 20-bit-value really from the correct position. Is there a way to make my template work as intended?