请高手帮忙翻译,本人C++太菜,谢谢 ( 积分: 50 )

  • 主题发起人 主题发起人 冬月
  • 开始时间 开始时间

冬月

Unregistered / Unconfirmed
GUEST, unregistred user!
void XBOX(BYTE *p_buff,int len,DWORD dwKey)
{
int templen = len &amp
3;
DWORD dwecx = dwKey;
len = len >&gt
2;
if(len &gt
1)
{
while(len &gt
0)
{
dwecx = XPBox[(dwecx+len-1)%0x162F]+0x2E6D23C1;
*(DWORD *)p_buff = *(DWORD *)p_buff ^ dwecx;
p_buff += 4;
len--;
}
}
dwecx ^= XPBox[templen%0x162F];
if(templen &gt
0)
{
for(int i=0;i<templen;i++)
{
p_buff = p_buff ^ (BYTE)(dwecx &amp
0xFF);
dwecx = dwecx >&gt
8;
}
}
}
 
void XBOX(BYTE *p_buff,int len,DWORD dwKey)
{
int templen = len &amp
3;
DWORD dwecx = dwKey;
len = len >&gt
2;
if(len &gt
1)
{
while(len &gt
0)
{
dwecx = XPBox[(dwecx+len-1)%0x162F]+0x2E6D23C1;
*(DWORD *)p_buff = *(DWORD *)p_buff ^ dwecx;
p_buff += 4;
len--;
}
}
dwecx ^= XPBox[templen%0x162F];
if(templen &gt
0)
{
for(int i=0;i<templen;i++)
{
p_buff = p_buff ^ (BYTE)(dwecx &amp
0xFF);
dwecx = dwecx >&gt
8;
}
}
}
 
procedure xbox(p_buff: pchar
len: integer
dwkey: dword);
var
templen: integer;
dwecx: dword;
i: integer;
begin
templen := len and 3;
dwecx := dwkey;
len := len shr 2;
if len &gt
1 then
begin
while len >0 do
begin
dwecx := XPBox[(dwecx+len-1) mod 0x162F] + $2E6D23C1;
((pinteger)p_buff)^ = ((pinteger)p_buff)^ and dwecx;
inc(p_buff, 4);
dec(len);
end
//while
end
//if len>1
dwecx := dwecx and XPBox[templen mod $162F];
if templen &gt
0 then
begin
for i := 0 to templen-1 do
begin
p_buff = p_buff and (BYTE)(dwecx and $FF);
dwecx = dwecx shr 8;
end;//for
end;
end;
 

Similar threads

I
回复
0
查看
778
import
I
I
回复
0
查看
730
import
I
I
回复
0
查看
851
import
I
后退
顶部