On Wed Jan 24 18:51:33 2024 +0000, Piotr Caban wrote:
This is a native format that we're trying to mimic (even so we have some Wine-specific extensions now). I have analyzed some native NTF files and it looks like we should pad all strings to 4-byte boundary. It would be probably best to introduce something like `ntf_strlen` helper that returns `(strlen(str) + 4) & ~3` and use it instead of `strlen`. I'm expecting this to solve all the alignment related problems but I didn't test it.
Thanks, that sounds like a reasonable solution. I would expect all the involved structs to be a multiple of 4 already, and padding the strings that way should be enough indeed. And wrapping up the strlens in such a macro sounds like a neat way to fix it. And 4 byte alignment should be fine (I didn’t check what the structs contain, but that should be enough for the ldrd/strd instructions on arm at least).