S shopman Unregistered / Unconfirmed GUEST, unregistred user! 2004-01-20 #1 pp : Pointer; pp := TFileStream.Memory; 我需要对PP的内存地址每个字节进行 xor 操作。怎么办??
S shopman Unregistered / Unconfirmed GUEST, unregistred user! 2004-01-20 #2 Sorry!! pp : Pointer; pp := TMemoryStream.Memory; 我需要对PP的内存地址每个字节进行 xor 操作。怎么办??
F firstrose Unregistered / Unconfirmed GUEST, unregistred user! 2004-01-20 #3 Type Buffer=Array[1..1] Of Byte; Var Buf:^Buffer; Buf^:=1;
B beta Unregistered / Unconfirmed GUEST, unregistred user! 2004-01-27 #4 跟谁做 xor 啊? xor 是双操作数的啊 var pp: PByte; aMemoryStream: TMemoryStream; begin ... pp := aMemoryStream.Memory; for i := 1 to aMemoryStream.Size do begin pp^ := pp^ xor 5 // 假设和 5 做 xor pp := PByte(Integer(pp) + 1); end; end;
跟谁做 xor 啊? xor 是双操作数的啊 var pp: PByte; aMemoryStream: TMemoryStream; begin ... pp := aMemoryStream.Memory; for i := 1 to aMemoryStream.Size do begin pp^ := pp^ xor 5 // 假设和 5 做 xor pp := PByte(Integer(pp) + 1); end; end;
M masm Unregistered / Unconfirmed GUEST, unregistred user! 2004-01-27 #5 pp := PByte(Integer(pp) + 1);??? 很简单啊 inc(pp);就行了!
B beta Unregistered / Unconfirmed GUEST, unregistred user! 2004-01-29 #7 //pp := PByte(Integer(pp) + 1);??? //很简单啊 //inc(pp);就行了! 呵呵,习惯性动作,这样任何情况下都适用, 而 Inc 遇到 Pointer 等类型就不行了:)
//pp := PByte(Integer(pp) + 1);??? //很简单啊 //inc(pp);就行了! 呵呵,习惯性动作,这样任何情况下都适用, 而 Inc 遇到 Pointer 等类型就不行了:)