Function at 0x4068aa
Capabilities:
Encrypt or decrypt via wincrypt

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
mov eax, dword [esi + 0x38]
xor edx, edx
xor ecx, ecx
cmp dword [ebp + 0x18], edx
push ebx
push edi
mov edi, dword [esi + 0x50]
sete cl
shr edi, 3
shr eax, 3
cmp dword [esi + 0x34], 0x6603
mov dword [ebp - 0x14], edx
mov dword [ebp - 4], edx
mov dword [ebp - 0x18], edi
mov dword [ebp - 8], eax
jne 0x4068e7
push 0x18
pop ebx
cmp eax, ebx
jae 0x4068e7
mov dword [ebp - 8], ebx
cmp ecx, edx
jne 0x40694d
mov eax, 0x800e
cmp dword [esi + 0x4c], eax
jne 0x4068fc
mov dword [ebp - 0xc], eax
mov ebx, edi
jmp 0x406906
push 0x14
mov dword [ebp - 0xc], 0x8004
pop ebx
push ebx
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [ebp - 4], eax
test eax, eax
je 0x406aa0
mov eax, dword [ebp + 0x18]
lea ecx, [eax + 2]
mov dx, word [eax]
inc eax
inc eax
test dx, dx
jne 0x406920
sub eax, ecx
push ebx
push dword [ebp - 4]
sar eax, 1
add eax, eax
push eax
push dword [ebp + 0x18]
push dword [ebp - 0xc]
call fcn.0040325b
add esp, 0x14
test eax, eax
je 0x406a91
jmp 0x406950
mov ebx, dword [ebp + 0x18]
push edi
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [ebp - 0xc], eax
test eax, eax
je 0x406a91
push edi
push eax
push dword [esi + 0x4c]
mov eax, dword [ebp - 4]
mov edi, dword [esi + 0x3c]
neg eax
sbb eax, eax
and eax, ebx
mov ebx, dword [ebp + 0x14]
push eax
push dword [ebp - 4]
push dword [ebp + 0x10]
push dword [esi + 0x40]
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.004067a0
add esp, 0x24
test eax, eax
je 0x406a88
push dword [ebp - 8]
mov edi, dword [sym.imp.KERNEL32.dll_LocalAlloc]
push 0x40
call edi
xor ebx, ebx
mov dword [ebp + 0x18], eax
cmp eax, ebx
je 0x406a88
push dword [ebp - 8]
push eax
push dword [ebp - 0xc]
mov eax, dword [ebp - 0x18]
push dword [esi + 0x4c]
call fcn.00403421
add esp, 0x10
test eax, eax
je 0x406a7f
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0x10]
push eax
push ebx
push dword [ebp - 8]
push dword [ebp + 0x18]
push dword [esi + 0x34]
call fcn.00403b70
add esp, 0x18
test eax, eax
je 0x406a6c
push dword [esi + 0x5c]
push 0x40
call edi
mov edi, dword [ebp + 0x1c]
mov dword [edi], eax
cmp eax, ebx
je 0x406a48
push dword [esi + 0x5c]
push dword [esi + 0x60]
push eax
call sub.msvcrt.dll_memcpy
mov eax, dword [ebp + 0x20]
mov ecx, dword [esi + 0x5c]
add esp, 0xc
push eax
mov dword [eax], ecx
push dword [edi]
push ebx
push 1
push ebx
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_CryptDecrypt]
mov dword [ebp - 0x14], eax
cmp eax, ebx
jne 0x406a48
push dword [edi]
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [edi], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ERROR_kull_m_dpapi_unprotect_blob___CryptDecrypt__0x_08x__n
call fcn.00409709
pop ecx
pop ecx
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
push dword [ebp - 0x1c]
call fcn.004034e7
pop ecx
test eax, eax
jne 0x406a7f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ERROR_kull_m_dpapi_unprotect_blob___kull_m_crypto_close_hprov_delete_container__0x_08x__n
jmp 0x406a78
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ERROR_kull_m_dpapi_unprotect_blob___kull_m_crypto_hkey_session__0x_08x__n
call fcn.00409709
pop ecx
pop ecx
push dword [ebp + 0x18]
call dword [sym.imp.KERNEL32.dll_LocalFree]
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_LocalFree]
cmp dword [ebp - 4], 0
je 0x406aa0
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [ebp - 0x14]
pop edi
pop ebx
leave
ret