首页
社区
课程
招聘
[旧帖] 请问这段代码是什么意思。。。 0.00雪花
发表于: 2010-1-19 00:35 3573

[旧帖] 请问这段代码是什么意思。。。 0.00雪花

2010-1-19 00:35
3573
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 探索篇!

收藏
免费 0
支持
分享
最新回复 (4)
雪    币: 18
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
&FE34是一个变量。。我临时记录下的,以上是我用OD跟踪的写的C语言。。不知道干嘛的。
貌似是给进程名加密的?还是给数字签名的。
我知道参数是从pe32.szFileName中过来的。。是进程名字。
2010-1-19 00:36
0
雪    币: 42
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
不懂  帮你顶一下
2010-1-19 01:08
0
雪    币: 56
活跃值: (276)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
关注学习中!
2010-1-21 22:31
0
雪    币: 808
活跃值: (10)
能力值: ( LV5,RANK:60 )
在线值:
发帖
回帖
粉丝
5
microsoft cryptAPI,i'm leaning.........
2010-2-1 14:19
0
游客
登录 | 注册 方可回帖
返回
//