Menu

#2 How change decode value in QAMF3, and back encode.

1.0
open
nobody
None
2017-10-21
2017-10-21
Sergei
No

Hi, I want in amf to change the value to send, how this can be done using QAMF3?
And found error

var
AMF: TQAMF;
data: Tstringstream;
datastring: ansistring;
buf:Tbytes;
i:integer;
Begin
AMF := TQAMF.Create;
data := Tstringstream.Create('');
data.WriteString(#0#3#0#0#0#1#0#$13'UserLeague.infoView'#0#3'/22'#0#0#0'U'#$A#0#0#0#1#$11#$A#$B#1#7'key'#6#1#5'id'#4'Ѓ9'#$D'userid'#6')1742454006860000046_'#$F'version'#6#$19'201709291435'#5'ts'#5'AЦz†‘@'#0#0#1);
data.Seek(0, soBeginning);
amf.LoadFromStream(data);
data.free;
//get decode string, work good
datastring:=amf.AsString;
//next I need to change the value id, and encode back for send

//encoding
buf:=amf.encode;
datastring:='';
for I := 0 to length(buf)-1 do
      datastring:=datastring+char(buf[i]);
//get no full string in datastring //#0#3#0#0#0#1#0#$13'UserLeague.infoView'#0#3'/22'#0#0#0#5#$11 why?
freeandnil(AMF);
End;

Discussion


Log in to post a comment.

MongoDB Logo MongoDB