Function at 0x4048f6
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 0x404933
push 0x18
pop ebx
cmp eax, ebx
jae 0x404933
mov dword [ebp - 8], ebx
cmp ecx, edx
jne 0x404999
mov eax, 0x800e
cmp dword [esi + 0x4c], eax
jne 0x404948
mov dword [ebp - 0xc], eax
mov ebx, edi
jmp 0x404952
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 0x404aea
mov eax, dword [ebp + 0x18]
lea ecx, [eax + 2]
mov dx, word [eax]
inc eax
inc eax
test dx, dx
jne 0x40496c
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.00402875
add esp, 0x14
test eax, eax
je 0x404adb
jmp 0x40499c
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 0x404adb
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.004047ec
add esp, 0x24
test eax, eax
je 0x404ad2
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 0x404ad2
push dword [ebp - 8]
push eax
push dword [ebp - 0xc]
mov eax, dword [ebp - 0x18]
push dword [esi + 0x4c]
call fcn.00402a3b
add esp, 0x10
test eax, eax
je 0x404ac9
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.004031c3
add esp, 0x18
test eax, eax
je 0x404ab6
push dword [esi + 0x5c]
push 0x40
call edi
mov edi, dword [ebp + 0x1c]
mov dword [edi], eax
cmp eax, ebx
je 0x404a92
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 0x404a92
push dword [edi]
call dword [sym.imp.KERNEL32.dll_LocalFree]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ERROR_kull_m_dpapi_unprotect_blob___CryptDecrypt__0x_08x__n
call fcn.00407017
pop ecx
pop ecx
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
push dword [ebp - 0x1c]
call fcn.00402b01
pop ecx
test eax, eax
jne 0x404ac9
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 0x404ac2
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.00407017
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 0x404aea
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [ebp - 0x14]
pop edi
pop ebx
leave
ret