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