-
-
[旧帖]
请问这段代码是什么意思。。。
0.00雪花
-
发表于:
2010-1-19 00:35
3574
-
[旧帖] 请问这段代码是什么意思。。。
0.00雪花
int crypt(char* processName)
{
HCRYPTPROV hCrypt = 0;
HCRYPTHASH hHash = 0;
DWORD dwDataLen = 0x10;
// [out] Pointer to a handle of a CSP. When you have finished using the CSP, release the handle by calling the CryptReleaseContext function.
// [in] Key container name.密钥容器名,若为NULL,则使用缺省容器名,缺省直可以使用函数CryptGetDefaultProvider函数获取相应的参数。
// [in] A null-terminated string that specifies the name of the CSP to be used. 若为NULL,则使用缺省CSP.
// [in] 具体的CSP类型
// 最后参数就是一个形式。。呃
BOOL b = CryptAcquireContext(&hCrypt, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT);
if (b)
{
b = CryptCreateHash(hCrypt, 0x8003, NULL, 0, &hHash);
if (b)
{
b = CryptHashData(hHash, (const unsigned char*)processName, strlen(processName), NULL);
if (b)
{
b = CryptGetHashParam(hHash, 2, &FE34, &dwDataLen, 0);
}
CryptReleaseContext(hCrypt ,0);
CryptDestroyHash(hHash);
}
}
return 0;
}
[课程]Linux pwn 探索篇!