Don use array of char for buffer, use "array of byte" instead of "array of char", it automatically makes your code independent from size of char. Alternatively you can use RawBinaryString type for binary data.
SizeOf(buff) is size of pointer (4 or 8 bytes depending of target), you should use something like "Length(buff)*SizeOf(buff[0])"
Don't forget that size of char is 2 in new Delphi compilers by default, it is highly recommended to read something about char/string types in Delphi.
UPDATE: You can convert String<->RawBinaryString for example like this:
function BinToString(const s: RawByteString): String;
begin
assert(length(s) mod SizeOf(result[1])=0);
setlength(result, length(s) div SizeOf(result[1]));
move(s[1], result[1], length(result)*SizeOf(result[1]));
end;
function StringToBin(const s: String): RawByteString;
begin
setlength(result, length(s)*SizeOf(s[1]));
move(s[1], result[1], length(result));
end;