Ich schau mir gerade ein Beispiel aus der PB-Hilfe an.
Ich möchte den String$ aus der DataSection heraus ziehen.
Ich übe nur, bitte nicht den Sinn hinterfragen.
Code: Alles auswählen
; Verschlüsseln eines Strings
;String$ = "ABCDEFGHIJKLMNOP"
String$ = ?Txt
StringMemorySize = StringByteLength(String$) + SizeOf(Character) ; Platz für den null-terminierten String mit seiner abschließenden Null
*CipheredString = AllocateMemory(StringMemorySize)
*DecipheredString = AllocateMemory(StringMemorySize)
If AESEncoder(@String$, *CipheredString, StringByteLength(String$), ?Key, 128, ?InitializationVector)
Debug "Ciphered: "+PeekS(*CipheredString) ; Warning: wird beim ersten Null-Byte angehalten, nur für Demo-Zwecke
AESDecoder(*CipheredString, *DecipheredString, StringByteLength(String$), ?Key, 128, ?InitializationVector)
Debug "Deciphered: "+PeekS(*DecipheredString)
EndIf
DataSection
Txt:
Data.b $65, $66, $67, $68, $69, $70, $71, $72, $73, $74, $75, $76, $77, $78, $79, $80
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