I’m writing a library for a fileformat, that stores embedded files.
The space between the end of 1 file and the start of another isn’t a fixed size. It’s to the closest upper 0x1000. So for example, if File1 ended at 0xAC4654, File2 would start at 0xAC5000.
I can’t think of a way to calculate this.
Assuming you just want to round up to the nearest 0x1000, then the following code should suffice: