S
sunnysheng
Unregistered / Unconfirmed
GUEST, unregistred user!
function xor_xor(data1,data2,data:array of Char):integer;<br>var<br> tmp,tmp1,tmp2:array [0..8] of byte;<br> //data1,data2,data3:array [0..8] of Char;<br> i:integer;<br> str:string;<br>begin<br> str := '';<br> FillChar(tmp1,SizeOf(tmp1),$0);<br> FillChar(tmp2,SizeOf(tmp2),$0);<br> FillChar(tmp,SizeOf(tmp),$0);<br><br> tmp1[0]:= StrToInt('$'+data1[0]+data1[1]);<br> tmp1[1]:= StrToInt('$'+data1[2]+data1[3]);<br> tmp1[2]:= StrToInt('$'+data1[4]+data1[5]);<br> tmp1[3]:= StrToInt('$'+data1[6]+data1[7]);<br> tmp1[4]:= StrToInt('$'+data1[8]+data1[9]);<br> tmp1[5]:= StrToInt('$'+data1[10]+data1[11]);<br> tmp1[6]:= StrToInt('$'+data1[12]+data1[13]);<br> tmp1[7]:= StrToInt('$'+data1[14]+data1[15]);<br><br> tmp2[0]:= StrToInt('$'+data2[0]+data2[1]);<br> tmp2[1]:= StrToInt('$'+data2[2]+data2[3]);<br> tmp2[2]:= StrToInt('$'+data2[4]+data2[5]);<br> tmp2[3]:= StrToInt('$'+data2[6]+data2[7]);<br> tmp2[4]:= StrToInt('$'+data2[8]+data2[9]);<br> tmp2[5]:= StrToInt('$'+data2[10]+data2[11]);<br> tmp2[6]:= StrToInt('$'+data2[12]+data2[13]);<br> tmp2[7]:= StrToInt('$'+data2[14]+data2[15]);<br><br> for i:= 0 to 7 do<br> begin<br> tmp:= tmp1 xor tmp2;<br> str:= str + IntToHex(tmp,2);<br> end;<br> StrCopy(data,PChar(str));<br> Result:=1;<br><br>end;<br>变量为:<br>tmp_data:array [0..8] of Char;<br>d1,d2,d3: array [ 0.. 8]of Char;<br>tmp_data里的值为:'12345678'<br>d1里的值为:'12345678'<br>请问我这个tmp_data,d1里的值怎么传不进啊<br>xor_xor(tmp_data,d1,d2);<br>