[DiscordArchive] does string block offsets start with 1 or 0 ? i mean string ends with empty byte so string `Hangar`
[DiscordArchive] does string block offsets start with 1 or 0 ? i mean string ends with empty byte so string `Hangar`
Archived author: <o> • Posted: 2022-11-08T18:08:58.218000+00:00
Original source
the first byte isn't special, so "1" will refer to "H"
Archived author: stoneharry • Posted: 2022-11-08T18:08:58.648000+00:00
Original source
It doesn't matter as long as the string block pointer is valid
Archived author: Rymercyble • Posted: 2022-11-08T18:10:13.040000+00:00
Original source
it does matter bcs if offset 1 is that empty byte then reading it will be wrong bcs there will be some empty character at start
Archived author: <o> • Posted: 2022-11-08T18:11:54.097000+00:00
Original source
i g2g, but the reason it causes issues for his reader is that he doesn't read c-strings correctly, he guesses the length of the string by using the following offset as a heuristic, assuming all strings are sequential in the block
Archived author: <o> • Posted: 2022-11-08T18:12:17.856000+00:00
Original source
you won't have this issue if you start reading and writing them as proper c-strings
Archived author: Rymercyble • Posted: 2022-11-08T18:12:52.775000+00:00
Original source
but i think i got it right bcs in my read script im skipping offset 0 then reading `next - current - 1` bytes at `current` offset then skipping 1 and moving to next offset
Archived author: <o> • Posted: 2022-11-08T18:13:36.062000+00:00
Original source
yeah it incidentally might work with your example, but you're relying on all dbcs following this patterns which they likely don't
Archived author: stoneharry • Posted: 2022-11-08T18:13:38.086000+00:00
Original source
Yeah, like IHM said you should read it like a c string
Archived author: stoneharry • Posted: 2022-11-08T18:13:46.615000+00:00
Original source
That's the standard
Archived author: Rymercyble • Posted: 2022-11-08T18:14:36.937000+00:00
Original source
i dont see any way how it could be different in any dbc