The use of `ptr` in Nim is always not safe. For pointer math operation, check this post: [https://forum.nim-lang.org/t/1188#7366](https://forum.nim-lang.org/t/1188#7366)
If it's sequence of bytes, you can use `seq[Byte]` or simply use `cstring` together with `cast`
