Hi , pascal guys

,
I'm writing a unit to read/write to Elf Object binary files , ok , I read the 64 bytes into an array of bytes lets call it "ElfHdr",
this is the situation :
7F 45 4C 46 02 01 01 03 00 00 00 00 00 00 00 00 02 00 3E 00 01 00 00 00 20 F6 59 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00
Now if the bytes from ElfHdr[24..32] should be interpreted as a 64bit address , I guessed A pointer to an int64 could solve this ,I wrote :
function GetEntryPointAddr(ElfHdr : array of Byte):Int64;
var int64Ptr : PInt64;
begin
GetMem(int64Ptr,SizeOf(Int64));
case ElfHdr[4] of 2 :
begin
int64Ptr^ := ElfHdr[24];
result := int64Ptr^ ;
end;
end;
end;
Where is the wrong step here ? Is there a better way to do ?