首页
社区
课程
招聘
[旧帖] 那位大佬给小弟看看这段PB代码是怎么加密的 0.00雪花
发表于: 2011-12-25 16:45 3012

[旧帖] 那位大佬给小弟看看这段PB代码是怎么加密的 0.00雪花

2011-12-25 16:45
3012
那位大佬给小弟看看这段PB代码是怎么加密的,给个解密思路,先谢谢了,尽量详细点
ulong hcryptprov
ulong hhash
ulong hkey
string lsprovider
char data[]
integer i
char c
ulong size

hcryptprov = 0
hhash = 0
hkey = 0
lsprovider = "Microsoft Base Cryptographic Provider v1.0"

if not cryptacquirecontext(hcryptprov,"QM DS-ERP KING",lsprovider,1,0) then

        if getlasterror() <> -2146893802 then
                goto label_0
        end if

        if not cryptacquirecontext(hcryptprov,"QM DS-ERP KING",lsprovider,1,8) then
                goto label_0
        end if

end if

if not cryptcreatehash(hcryptprov,32771,0,0,hhash) then
else

        if not crypthashdata(hhash,password,len(password),0) then
        else

                if not cryptderivekey(hcryptprov,26625,hhash,0,hkey) then
                else

                        for i = 1 to len(ps_cry_data) / 2
                                c = mid(ps_cry_data,i * 2 - 1,1)

                                if isnumber(c) then
                                        data[i] = char(integer(c))
                                else
                                        data[i] = char(asc(c) - asc("A") + 10)
                                end if

                                c = mid(ps_cry_data,i * 2,1)

                                if isnumber(c) then
                                        data[i] = char(asc(data[i]) * 16 + integer(c))
                                else
                                        data[i] = char(asc(data[i]) * 16 - asc("A") + asc(c) + 10)
                                end if

                        next

                        size = upperbound(data)

                        if not cryptdecrypt(hkey,0,true,0,data,size) then
                        else
                                cryptdestroyhash(hhash)
                                cryptdestroykey(hkey)
                                cryptreleasecontext(hcryptprov,0)
                                return mid(data,1,size)
                        end if

                end if

        end if

end if

label_0:

if hhash <> 0 then
        cryptdestroyhash(hhash)
end if

if hkey <> 0 then
        cryptdestroykey(hkey)
end if

if hcryptprov <> 0 then
        cryptreleasecontext(hcryptprov,0)
end if

return ("X:" + string(getlasterror()))

string ls_cry_data
ulong hcryptprov
ulong hhash
ulong hkey
string lsprovider
char data[]
ulong size
integer i
long n

hcryptprov = 0
hhash = 0
hkey = 0
lsprovider = "Microsoft Base Cryptographic Provider v1.0"

if not cryptacquirecontext(hcryptprov,"QM DS-ERP KING",lsprovider,1,0) then

        if getlasterror() <> -2146893802 then
                goto label_0
        end if

        if not cryptacquirecontext(hcryptprov,"QM DS-ERP KING",lsprovider,1,8) then
                goto label_0
        end if

end if

if not cryptcreatehash(hcryptprov,32771,0,0,hhash) then
else

        if not crypthashdata(hhash,password,len(password),0) then
        else

                if not cryptderivekey(hcryptprov,26625,hhash,0,hkey) then
                else
                        data = ps_ori_data
                        size = upperbound(data)

                        if not cryptencrypt(hkey,0,true,0,data,size,upperbound(data)) then
                        else
                                ls_cry_data = ""

                                for i = 1 to size
                                        n = asc(data[i]) / 16

                                        if n < 10 then
                                                ls_cry_data = ls_cry_data + string(n)
                                        else
                                                ls_cry_data = ls_cry_data + char(asc("A") + n - 10)
                                        end if

                                        n = mod(asc(data[i]),16)

                                        if n < 10 then
                                                ls_cry_data = ls_cry_data + string(n)
                                        else
                                                ls_cry_data = ls_cry_data + char(asc("A") + n - 10)
                                        end if

                                next

                                cryptdestroyhash(hhash)
                                cryptdestroykey(hkey)
                                cryptreleasecontext(hcryptprov,0)
                                return ls_cry_data
                        end if

                end if

        end if

end if

label_0:

if hhash <> 0 then
        cryptdestroyhash(hhash)
end if

if hkey <> 0 then
        cryptdestroykey(hkey)
end if

if hcryptprov <> 0 then
        cryptreleasecontext(hcryptprov,0)
end if

return ("X:" + string(getlasterror()))

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

收藏
免费 0
支持
分享
最新回复 (1)
雪    币: 41
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
来看看哈
2011-12-25 17:19
0
游客
登录 | 注册 方可回帖
返回
//