I am trying to read a GUID value stored as a value binaryin a registry in Delphi. When I read it with BintoHex, but the result is in reverse order. It seems like I have to change bytes, but I thought BinToHex would do it.
I referred to this topic, but I can’t find the right solution:
how to convert an array of bytes to a hexadecimal representation in Delphi
It seems that this is due to a small event.
Below you can see the GUID stored in the registry
Here is my code:
var
s : string;
buffer : pointer;
...
begin
getmem(buffer, 1024*1024);
....
reg.ReadBinaryData(iValueOfregistry, buffer^, 1024*1024);
....
bintohex(pointer(longint(buffer)+14), PChar(s), 32);
Output for s:
90E24D373F126545916439C4925E467B
GUID must be FOLDERID_Downloads GUID:
{374DE290-123F-4565-9164-39C4925E467B}
Please, help
