#array of pointers
1 messages · Page 1 of 1 (latest)
Hey, there's no direct syntax for this. Wrap your pointers into a struct and then create an array of that
is there a way to get relative-to-parent pointers to not refer to this wrapper struct, then?
You can define your own pointer base function. Take a look at the standard library how it's implemented
Alternatively, use calculated pointers using the @ syntax. Then you can do any logic you need in-line
So what I'm trying to do is write a pattern for berkeleyDB files, which are page-based (4K, 8K, etc) and all the "pointers" are u16 offsets from the start of the page. Maybe there's some features more on-point for this
I also think relative_to_parent is not working how I expect: I have a struct at 0x4000 with a char *highfreeoffset: u16 [[pointer_base("std::ptr::relative_to_parent")]]; member at +0x16. The value is 0x0A04, so I would expect the pointer to be calculated to be 0x4A04, but it's being calculated to be 0x4A1A
yeah, std::ptr::relative_to_pointer and std::ptr::relative_to_parent are giving the same result
ah, found the issue: https://github.com/WerWolv/ImHex/issues/2507