那位大佬给小弟看看这段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()))
[课程]Linux pwn 探索篇!