-
-
[原创]年底回馈,kbsync 计算
-
发表于:
2013-12-31 12:52
9211
-
5月份的时候花了两周,解决了itunes的kbsync的计算方法。后来闲得包装了一下通过远程tcp调用,传入dsid即可计算出kbsync,具体怎么算的,有点儿基础的,一看代码便知。这么多年了,一直从看雪索取,还没回馈过,到年底了就献个丑。
BOOL CRemoteSesrver::HookEncryptFunction(std::vector<char>&aoBuffer, int anDsid )
{
try
{
std::vector<byte> loDbuffer;
loDbuffer.resize(102400);
std::vector<byte> loBuffer2(10240);
int * lpThis =(int *) &loBuffer2.front();
std::vector<int> loBuffer1(10240);
int * v45 =&loBuffer1.front();
std::vector<int> loBuffer3(10240);
int * pV45 = &loBuffer3.front();
int lnRet = func803C50(lpThis);
if (!lnRet)
{
lnRet = fun804100(lpThis,0,0,0,pV45);
}
int a1=*(int *)lpKey/*0x32EFE43*/;
int a2 = 0x9C; //dsid
a2=0x60;
if (anDsid != 0)
{
a2 = anDsid;
}
int a3= 0;
int a4 = 0;
int a5 =1;
int lnDataSize =0;
byte * lpBuffer = &loDbuffer.front();
lnRet = funcDA39A0(a1,a2,a3,a4,a5,&lpBuffer,&lnDataSize);
TCHAR szPath[MAX_PATH + 1] = {0};
TCHAR szTargetDllPath[MAX_PATH*2+1] = {0};
int lnPath = GetCurrentPath(szPath,MAX_PATH);
char lpfileName[1024] = {0};
if (lnPath>0)
{
sprintf(lpfileName,"%skbsync_%d.dat",szPath,a2);
}else
{
sprintf(lpfileName,"c:/kbsync_%d.dat",a2);
}
writefile(lpBuffer,lnDataSize,lpfileName);
aoBuffer.resize(lnDataSize,0);
memcpy(&aoBuffer.front(),lpBuffer,lnDataSize);
if (lnRet == 0)
{
return TRUE;
}else
{
return FALSE;
}
}
catch (...)
{
return FALSE;
}
}
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!