Function at 0x404d33
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 0x404d56
mov dword [ebp - 4], eax
push dword [ebp - 4]
call fcn.004033c1
push dword [esi + 0x1c]
mov dword [ebp - 0x20], eax
call fcn.00403493
push dword [esi + 0x1c]
mov edi, eax
mov dword [ebp - 0x10], edi
call fcn.00403424
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 0x404f4c
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.00402cfc
add esp, 0x20
test eax, eax
je 0x404f43
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.004031c3
add esp, 0x18
test eax, eax
je 0x404f30
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 0x404f0c
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 0x404f0c
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 0x404f03
cmp dword [esi + 0x1c], 0x6603
jne 0x404e45
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 0x404f03
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.00402bdb
add esp, 0x18
test eax, eax
je 0x404efa
push esi
push 0x40
call ebx
mov dword [ebp - 0x10], eax
test eax, eax
je 0x404efa
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.00402bdb
add esp, 0x18
test eax, eax
je 0x404ef1
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 0x404ef1
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 0x404ef1
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.00402b01
pop ecx
test eax, eax
jne 0x404f43
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 0x404f3c
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.00407017
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