Problème avec AllocateMemory
Publié : mer. 05/oct./2016 11:21
Bonjour tout le monde j'ai besoin d'un peu d'aide je coince encore avec la manipulation de la mémoire j'aimerais récupérer le contenu de *CipheredString sous une forme hexadécimale (string) dans une variable et je souhaite pouvoir faire le contraire par la même occasion
( le but c'est de retourner la valeur hexadécimale dans une procédure )
merci de vos réponses

( le but c'est de retourner la valeur hexadécimale dans une procédure )
merci de vos réponses


Code : Tout sélectionner
; Crypter une chaîne de caractères
;
String$ = "Hello voici un test pour AES"
StringMemorySize = StringByteLength(String$) + SizeOf(Character) ; Espace pour la chaîne et son caractère 'nul' de terminaison de chaîne
*CipheredString = AllocateMemory(StringMemorySize)
*DecipheredString = AllocateMemory(StringMemorySize)
If AESEncoder(@String$, *CipheredString, StringByteLength(String$), ?Key, 128, ?InitializationVector)
Debug "Codé : "+PeekS(*CipheredString) ; Attention, ça s'arrêtera sur le premier octet nul, uniquement à des fins de démonstration
AESDecoder(*CipheredString, *DecipheredString, StringByteLength(String$), ?Key, 128, ?InitializationVector)
Debug "Décodé : "+PeekS(*DecipheredString)
EndIf
DataSection
Key:
Data.b $06, $a9, $21, $40, $36, $b8, $a1, $5b, $51, $2e, $03, $d5, $34, $12, $00, $06
InitializationVector:
Data.b $3d, $af, $ba, $42, $9d, $9e, $b4, $30, $b4, $22, $da, $80, $2c, $9f, $ac, $41
EndDataSection