Function at 0x406d28
Capabilities:
Encrypt or decrypt via wincrypt

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
and dword [ebp - 0x1c], 0
push ebx
push esi
mov esi, eax
mov eax, dword [esi + 0x18]
push edi
mov dword [ebp - 4], 0x8004
cmp eax, 0x8009
je 0x406d4b
mov dword [ebp - 4], eax
push dword [ebp - 4]
call fcn.00403d6c
push dword [esi + 0x1c]
mov dword [ebp - 0x20], eax
call fcn.00403e3e
push dword [esi + 0x1c]
mov edi, eax
mov dword [ebp - 0x10], edi
call fcn.00403dcf
mov ebx, dword [sym.imp.KERNEL32.dll_LocalAlloc]
add esp, 0xc
add edi, eax
push edi
push 0x40
call ebx
mov dword [ebp - 0x18], eax
test eax, eax
je 0x406f41
push 1
push edi
push eax
push dword [esi + 0x14]
lea eax, [esi + 4]
push eax
push dword [ebp + 0xc]
push dword [ebp + 8]
push dword [ebp - 4]
push 0x10
pop eax
call fcn.004036a9
add esp, 0x20
test eax, eax
je 0x406f38
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x14]
push eax
xor edi, edi
push edi
push dword [ebp - 0x10]
push dword [ebp - 0x18]
push dword [esi + 0x1c]
call fcn.00403b70
add esp, 0x18
test eax, eax
je 0x406f25
mov ecx, dword [ebp - 0x10]
mov eax, dword [ebp - 0x18]
push edi
add eax, ecx
push eax
push 1
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_CryptSetKeyParam]
test eax, eax
je 0x406f01
mov eax, dword [esi + 0x24]
push eax
push 0x40
mov dword [ebp - 8], eax
call ebx
mov dword [ebp - 0xc], eax
cmp eax, edi
je 0x406f01
push dword [ebp - 8]
push dword [esi + 0x20]
push eax
call sub.msvcrt.dll_memcpy
add esp, 0xc
lea eax, [ebp - 8]
push eax
push dword [ebp - 0xc]
push edi
push edi
push edi
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_CryptDecrypt]
test eax, eax
je 0x406ef8
cmp dword [esi + 0x1c], 0x6603
jne 0x406e3a
push 4
pop edi
mov eax, dword [ebp - 8]
mov esi, dword [ebp - 0x20]
sub eax, edi
mov edi, dword [ebp + 0x14]
sub eax, esi
push esi
sub eax, 0x10
push 0x40
mov dword [edi], eax
call ebx
mov dword [ebp - 0x20], eax
test eax, eax
je 0x406ef8
push esi
push eax
mov eax, dword [ebp - 4]
push 0x10
push dword [ebp - 0xc]
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.00403588
add esp, 0x18
test eax, eax
je 0x406eef
push esi
push 0x40
call ebx
mov dword [ebp - 0x10], eax
test eax, eax
je 0x406eef
mov eax, dword [edi]
mov edi, dword [ebp - 0xc]
push esi
push dword [ebp - 0x10]
mov ecx, edi
sub ecx, eax
add ecx, dword [ebp - 8]
push eax
mov eax, dword [ebp - 4]
push ecx
push esi
push dword [ebp - 0x20]
call fcn.00403588
add esp, 0x18
test eax, eax
je 0x406ee6
add edi, 0x10
xor eax, eax
mov ecx, esi
mov esi, dword [ebp - 0x10]
repe cmpsb byte [esi], byte es:[edi]
sete al
mov dword [ebp - 0x1c], eax
test eax, eax
je 0x406ee6
mov esi, dword [ebp + 0x14]
push dword [esi]
push 0x40
call ebx
mov ecx, dword [ebp + 0x10]
mov dword [ecx], eax
test eax, eax
je 0x406ee6
mov esi, dword [esi]
mov ecx, dword [ebp - 0xc]
sub ecx, esi
add ecx, dword [ebp - 8]
push esi
push ecx
push eax
call sub.msvcrt.dll_memcpy
add esp, 0xc
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_LocalFree]
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_LocalFree]
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_LocalFree]
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
push dword [ebp - 0x24]
call fcn.004034e7
pop ecx
test eax, eax
jne 0x406f38
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 0x406f31
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.00409709
pop ecx
pop ecx
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [ebp - 0x1c]
pop edi
pop esi
pop ebx
leave
ret