Function at 0x4070d8
Capabilities:
Encrypt or decrypt via wincrypt

Disassembly:
sub esp, 0x24
push ebx
push ebp
push esi
mov esi, ecx
mov dword [esp + 0x20], edx
push edi
xor ebx, ebx
mov dword [esp + 0x20], esi
mov eax, 0x8004
mov edi, dword [esi + 0x18]
cmp edi, 0x8009
cmove edi, eax
mov ecx, edi
mov dword [esp + 0x28], edi
call fcn.00403ed9
mov ecx, dword [esi + 0x1c]
mov ebp, eax
call fcn.00403fb0
mov ecx, dword [esi + 0x1c]
mov dword [esp + 0x14], eax
call fcn.00403f3e
add eax, dword [esp + 0x14]
push eax
push 0x40
mov dword [esp + 0x34], eax
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [esp + 0x1c], eax
test eax, eax
je 0x407325
mov edx, dword [esp + 0x24]
mov ecx, edi
push 1
push dword [esp + 0x30]
push eax
push dword [esi + 0x14]
lea eax, [esi + 4]
push 0x10
push eax
push dword [esp + 0x50]
call fcn.00403785
mov edi, dword [sym.imp.KERNEL32.dll_LocalFree]
add esp, 0x1c
test eax, eax
je 0x40731f
mov edx, dword [esp + 0x1c]
lea eax, [esp + 0x30]
mov ecx, dword [esi + 0x1c]
push eax
lea eax, [esp + 0x1c]
push eax
push ebx
push dword [esp + 0x20]
call fcn.00403cc7
add esp, 0x10
test eax, eax
je 0x40730c
mov eax, dword [esp + 0x1c]
add eax, dword [esp + 0x14]
push ebx
push eax
push 1
push dword [esp + 0x24]
call dword [sym.imp.ADVAPI32.dll_CryptSetKeyParam]
test eax, eax
je 0x4072e7
mov eax, dword [esi + 0x24]
push eax
push 0x40
mov dword [esp + 0x18], eax
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov esi, eax
test esi, esi
je 0x4072e7
mov eax, dword [esp + 0x20]
push dword [esp + 0x10]
push dword [eax + 0x20]
push esi
call fcn.0049fa90
add esp, 0xc
lea eax, [esp + 0x10]
push eax
push esi
push ebx
push ebx
push ebx
push dword [esp + 0x2c]
call dword [sym.imp.ADVAPI32.dll_CryptDecrypt]
test eax, eax
je 0x4072e4
mov ecx, dword [esp + 0x20]
xor eax, eax
push 4
pop edx
push ebp
cmp dword [ecx + 0x1c], 0x6603
mov ecx, dword [esp + 0x14]
cmove eax, edx
sub ecx, eax
mov eax, dword [esp + 0x44]
sub ecx, ebp
sub ecx, 0x10
push 0x40
mov dword [eax], ecx
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [esp + 0x20], eax
test eax, eax
je 0x4072e4
mov edx, dword [esp + 0x24]
mov ecx, dword [esp + 0x28]
push ebp
push eax
push 0x10
push esi
push dword [esp + 0x48]
call fcn.0040364a
add esp, 0x14
test eax, eax
je 0x4072de
push ebp
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [esp + 0x24], eax
test eax, eax
je 0x4072de
mov ecx, dword [esp + 0x40]
mov edx, dword [esp + 0x20]
push ebp
push eax
push dword [ecx]
mov eax, esi
sub eax, dword [ecx]
add eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x34]
push eax
push ebp
call fcn.0040364a
add esp, 0x14
test eax, eax
je 0x4072d7
push ebp
mov ebp, dword [esp + 0x28]
lea eax, [esi + 0x10]
push eax
push ebp
call fcn.004bec95
add esp, 0xc
test eax, eax
sete bl
test ebx, ebx
je 0x4072db
mov eax, dword [esp + 0x40]
push dword [eax]
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov ecx, eax
mov eax, dword [esp + 0x3c]
mov dword [eax], ecx
test ecx, ecx
je 0x4072db
mov edx, dword [esp + 0x40]
mov eax, esi
push dword [edx]
sub eax, dword [edx]
add eax, dword [esp + 0x14]
push eax
push ecx
call fcn.0049fa90
add esp, 0xc
jmp 0x4072db
mov ebp, dword [esp + 0x24]
push ebp
call edi
push dword [esp + 0x20]
call edi
push esi
call edi
push dword [esp + 0x18]
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov ecx, dword [esp + 0x30]
call fcn.004035a7
test eax, eax
jne 0x40731f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ERROR_kull_m_dpapi_unprotect_masterkey_with_shaDerivedkey___kull_m_crypto_close_hprov_delete_container__0x_08x__n
jmp 0x407318
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ERROR_kull_m_dpapi_unprotect_masterkey_with_shaDerivedkey___kull_m_crypto_hkey_session__0x_08x__n
call fcn.00409cda
pop ecx
pop ecx
push dword [esp + 0x1c]
call edi
pop edi
pop esi
pop ebp
mov eax, ebx
pop ebx
add esp, 0x24
ret