Function at 0x404f54
Capabilities:
Create new key via cryptacquirecontext
Encrypt data using des via winapi
Encrypt or decrypt via wincrypt

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
push ebx
push esi
push edi
push 0xf0000000
push 0x18
pop edi
push edi
xor ebx, ebx
push ebx
mov esi, eax
push ebx
lea eax, [ebp - 0x14]
push eax
mov dword [ebp - 0x18], ebx
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
je 0x4051c7
lea eax, [ebp - 0x20]
push eax
push ebx
push ebx
push dword [ebp + 0xc]
push dword [ebp + 8]
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_CryptImportKey]
test eax, eax
je 0x4051bd
mov eax, dword [esi + 4]
mov ebx, dword [sym.imp.KERNEL32.dll_LocalAlloc]
push eax
push 0x40
mov dword [ebp - 4], eax
call ebx
mov dword [ebp - 8], eax
test eax, eax
je 0x4051b2
push dword [ebp - 4]
push dword [esi + 0x1c]
push eax
call sub.msvcrt.dll_memcpy
add esp, 0xc
lea eax, [ebp - 4]
push eax
push dword [ebp - 8]
push 0
push 1
push 0
push dword [ebp - 0x20]
call dword [sym.imp.ADVAPI32.dll_CryptDecrypt]
test eax, eax
je 0x405196
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x10]
push eax
mov eax, dword [ebp - 8]
mov ecx, dword [eax]
push 0
lea eax, [ecx + eax + 8]
push eax
push 0x6603
push dword [ebp - 0x14]
call fcn.004029aa
add esp, 0x18
test eax, eax
je 0x4051a9
mov eax, dword [ebp - 8]
mov ecx, dword [eax]
push 0
lea eax, [ecx + eax + 0x20]
push eax
push 1
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_CryptSetKeyParam]
test eax, eax
je 0x40515f
mov eax, dword [esi + 8]
push eax
push 0x40
mov dword [ebp - 4], eax
call ebx
mov edi, eax
mov dword [ebp - 0xc], edi
test edi, edi
je 0x405172
push dword [ebp - 4]
push dword [esi + 0x20]
push edi
call sub.msvcrt.dll_memcpy
add esp, 0xc
lea eax, [ebp - 4]
push eax
push edi
xor eax, eax
push eax
push eax
push eax
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_CryptDecrypt]
test eax, eax
je 0x40514a
mov eax, dword [edi + 4]
lea eax, [eax + edi + 8]
mov dword [ebp - 0x1c], eax
push 0x14
lea eax, [ebp - 0x38]
push eax
mov eax, dword [ebp - 4]
add eax, 0xffffffec
push eax
push edi
push 0x8004
call fcn.00402875
add esp, 0x14
test eax, eax
je 0x405141
mov eax, dword [ebp - 4]
mov edx, dword [ebp - 0xc]
push 5
lea esi, [edx + eax - 0x14]
pop ecx
lea edi, [ebp - 0x38]
xor eax, eax
repe cmpsd dword [esi], dword es:[edi]
jne 0x40513e
mov eax, dword [ebp - 8]
mov eax, dword [eax]
mov edi, dword [ebp + 0x14]
push eax
push 0x40
mov dword [edi], eax
call ebx
mov ecx, dword [ebp + 0x10]
mov dword [ecx], eax
test eax, eax
je 0x40513e
push dword [edi]
mov ecx, dword [ebp - 8]
add ecx, 8
push ecx
push eax
call sub.msvcrt.dll_memcpy
mov esi, dword [ebp + 0x18]
and dword [esi], 0
and dword [ebp - 0x18], 0
add esp, 0xc
push dword [ebp - 0x1c]
call dword [sym.imp.ADVAPI32.dll_GetLengthSid]
push eax
push 0x40
mov dword [ebp - 4], eax
call ebx
mov dword [esi], eax
test eax, eax
je 0x40511a
push dword [ebp - 0x1c]
push eax
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_CopySid]
mov dword [ebp - 0x18], eax
test eax, eax
jne 0x40513e
mov ebx, dword [ebp + 0x10]
mov eax, dword [ebx]
test eax, eax
je 0x40512c
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [ebx], eax
mov eax, dword [esi]
test eax, eax
je 0x40513b
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [esi], eax
and dword [edi], 0
mov edi, dword [ebp - 0xc]
push edi
call dword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x405172
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ERROR_kull_m_dpapi_unprotect_domainkey_with_key___CryptDecrypt__0x_08x__n
call fcn.00407017
pop ecx
pop ecx
jmp 0x405141
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ERROR_kull_m_dpapi_unprotect_domainkey_with_key___CryptSetKeyParam__0x_08x__n
call fcn.00407017
pop ecx
pop ecx
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
push dword [ebp - 0x24]
call fcn.00402b01
pop ecx
test eax, eax
jne 0x4051a9
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ERROR_kull_m_dpapi_unprotect_domainkey_with_key___kull_m_crypto_close_hprov_delete_container__0x_08x__n
jmp 0x4051a2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ERROR_kull_m_dpapi_unprotect_domainkey_with_key___CryptDecrypt__0x_08x__n
call fcn.00407017
pop ecx
pop ecx
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_LocalFree]
push dword [ebp - 0x20]
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
xor ebx, ebx
push ebx
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
mov eax, dword [ebp - 0x18]
pop edi
pop esi
pop ebx
leave
ret