Convertitr un code Hex to ascii
Bonjour,
Je cherche une fonction pour convertir un code Hexadécimal vers un Ascii.
Exemple :
Code:
0043007200650064006900740020007200650063006800610072006700650020003A002000340030003000440041002E00200046006F00720066006100690074002000520065007300740061006E00740020003A002000300020004D006F002000760061006C00610062006C00650020006A0075007300710075002700E00020006D0069006E007500690074002E
j'ai trouver cet fonction mais le résultat et vide :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| function HexToAsc(strData:string): string;
var sresult:string; sfinal:string; hexc:cardinal; i:integer;
begin
i:=1;
while i<=length(strData) do
begin
hexc := strtoint('$' + copy(strData,i,2));
sresult := inttostr(hexc);
sresult := chr(strtoint(sresult));
sfinal := sfinal + sresult;
i:=i+2;
end;
result := sfinal
end; |
Merci pour l'aide ;)