Oh, and of course your code will be clearer if you use a variable to get rid of all the typecasts later, perhaps like this:

[pascal]var
Blah: Pointer;
Another: PByteArray;
begin
Blah := DoSomethingToGetPointer;

Another := PByteArray(Blah); // here, the important bit

// now, it's clear all the way -- just like an array...
Another[0] := 1;
Another[1] := 23;
Another[2] := $FF;
end;[/pascal]

EDIT: And another thought. Are you sure you can't just use a dynamic array? It would make your life easier, you know! If you desperately need a pointer then it's not difficult to get one (just the address of element 0 after all).