L
legoog
Unregistered / Unconfirmed
GUEST, unregistred user!
unsigned char*_K_Param;
unsigned char*_T_Param;
unsigned char*LoginPack;
unsigned char*EncodeKeyStru;
SOCKET g_ClientSocket;
RXNetCommCore::RXNetCommCore(void)
{
_K_Param = new unsigned char[$10];
_T_Param = new unsigned char[$10];
EncodeKeyStru = new unsigned char[$200];
LoginPack = new unsigned char[$50];
memset(_K_Param,$00,$10);
memset(_T_Param,$00,$10);
memset(EncodeKeyStru,$00,$200);
memset(LoginPack,$00,$50);
*(DWORD*)LoginPack = $458000;
}
unsigned long RXNetCommCore::Lgoin(char* sz_UserName, char* sz_Passwd)
{
Sub1_ASMInit();
Sub2_ASMInit();
Sub3_ASMInit();
Sub4_ASMInit();
Sub5_ASMInit();
unsigned char sz_output[$20] = {0};
makeLoginPack(sz_Passwd,sz_output);
int AccountLen = strlen(sz_UserName);
LoginPack[4] = AccountLen;
for (int i = 0 ;
i <AccountLen ;
i++)
{
LoginPack[i+6] = sz_UserName;
}
LoginPack[AccountLen+6] = '/x28';
int MD5Offset = AccountLen+8;
char printMd5[$41] = {0};
for (int i_2 = 0 ;
i_2 < 20 ;
i_2++)
{
wsprintfA(printMd5+i_2*2,"%.2X",sz_output[i_2]);
}
CharLowerA(printMd5);
for (int i_3 = MD5Offset ;
i_3 < 40+MD5Offset ;
i_3 ++)
{
LoginPack[i_3] = printMd5[i_3-MD5Offset];
}
LoginPack[2] = MD5Offset+40+16-4;
SendLoginPack(LoginPack,(long)(MD5Offset+40+16));
return 0;
}
int RXNetCommCore::InitKeyStruct(DWORD _KEY_T,DWORD _KEY_K)
{
*(DWORD*)(EncodeKeyStru+$DE) = $00;
*(DWORD*)(EncodeKeyStru+$EF) = _KEY_K;
*(DWORD*)(EncodeKeyStru+$FC) = _KEY_T;
*(DWORD*)(EncodeKeyStru+$100) = $e0;
*(DWORD*)(EncodeKeyStru+$104) = $02a3;
*(DWORD*)(EncodeKeyStru+$10D) = $1;
*(DWORD*)(EncodeKeyStru+$115) = $4;
*(DWORD*)(EncodeKeyStru+$11D) =$01;
*(DWORD*)(EncodeKeyStru+$125) =$3a254698;
*(DWORD*)(EncodeKeyStru+$170) =$00170017;
return 0;
}
请帮我把以上代码翻译成delphi版的谢谢。
unsigned char*_T_Param;
unsigned char*LoginPack;
unsigned char*EncodeKeyStru;
SOCKET g_ClientSocket;
RXNetCommCore::RXNetCommCore(void)
{
_K_Param = new unsigned char[$10];
_T_Param = new unsigned char[$10];
EncodeKeyStru = new unsigned char[$200];
LoginPack = new unsigned char[$50];
memset(_K_Param,$00,$10);
memset(_T_Param,$00,$10);
memset(EncodeKeyStru,$00,$200);
memset(LoginPack,$00,$50);
*(DWORD*)LoginPack = $458000;
}
unsigned long RXNetCommCore::Lgoin(char* sz_UserName, char* sz_Passwd)
{
Sub1_ASMInit();
Sub2_ASMInit();
Sub3_ASMInit();
Sub4_ASMInit();
Sub5_ASMInit();
unsigned char sz_output[$20] = {0};
makeLoginPack(sz_Passwd,sz_output);
int AccountLen = strlen(sz_UserName);
LoginPack[4] = AccountLen;
for (int i = 0 ;
i <AccountLen ;
i++)
{
LoginPack[i+6] = sz_UserName;
}
LoginPack[AccountLen+6] = '/x28';
int MD5Offset = AccountLen+8;
char printMd5[$41] = {0};
for (int i_2 = 0 ;
i_2 < 20 ;
i_2++)
{
wsprintfA(printMd5+i_2*2,"%.2X",sz_output[i_2]);
}
CharLowerA(printMd5);
for (int i_3 = MD5Offset ;
i_3 < 40+MD5Offset ;
i_3 ++)
{
LoginPack[i_3] = printMd5[i_3-MD5Offset];
}
LoginPack[2] = MD5Offset+40+16-4;
SendLoginPack(LoginPack,(long)(MD5Offset+40+16));
return 0;
}
int RXNetCommCore::InitKeyStruct(DWORD _KEY_T,DWORD _KEY_K)
{
*(DWORD*)(EncodeKeyStru+$DE) = $00;
*(DWORD*)(EncodeKeyStru+$EF) = _KEY_K;
*(DWORD*)(EncodeKeyStru+$FC) = _KEY_T;
*(DWORD*)(EncodeKeyStru+$100) = $e0;
*(DWORD*)(EncodeKeyStru+$104) = $02a3;
*(DWORD*)(EncodeKeyStru+$10D) = $1;
*(DWORD*)(EncodeKeyStru+$115) = $4;
*(DWORD*)(EncodeKeyStru+$11D) =$01;
*(DWORD*)(EncodeKeyStru+$125) =$3a254698;
*(DWORD*)(EncodeKeyStru+$170) =$00170017;
return 0;
}
请帮我把以上代码翻译成delphi版的谢谢。