Solved.
The problem was, that the binary chunk, which string.dump
returns, was handled as a string. So it was cut at the first null byte in the string, which was after 5 bytes. Changed the call of DoString
, so that it handles byte arrays correct.