Function at 0x401990
Capabilities:
Create new key via cryptacquirecontext
Encrypt data using aes via winapi
Encrypt or decrypt via wincrypt
Hash data via wincrypt
Initialize hashing via wincrypt

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x507608
mov eax, dword fs:[0]
push eax
sub esp, 0x48
mov eax, dword [0x557188]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, dword [ebp + 8]
mov ebx, dword [ebp + 0xc]
xor edi, edi
xor eax, eax
mov dword [ebp - 0x50], edi
mov dword [ebp - 0x40], edi
mov dword [ebp - 0x48], edi
mov dword [ebp - 0x44], edi
mov dword [ebp - 0x54], 1
mov dword [ebp - 0x28], 7
mov dword [ebp - 0x2c], edi
mov word [ebp - 0x3c], ax
push 0xf0000000
push 0x18
push edi
push edi
lea ecx, [ebp - 0x40]
push ecx
mov dword [ebp - 4], edi
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], eax
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextA]
test eax, eax
jne 0x401a43
push edi
xor edx, edx
mov dword [esi + 0x14], 7
mov dword [esi + 0x10], edi
push 0x514d24
mov ecx, esi
mov word [esi], dx
call fcn.00401650
cmp dword [ebp - 0x28], 8
jb 0x401c47
mov eax, dword [ebp - 0x3c]
push eax
call fcn.0040232a
add esp, 4
jmp 0x401c47
mov edx, dword [ebp - 0x40]
lea ecx, [ebp - 0x44]
push ecx
push edi
push edi
push 0x800c
push edx
call dword [sym.imp.ADVAPI32.dll_CryptCreateHash]
push edi
test eax, eax
jne 0x401a9e
mov eax, dword [ebp - 0x40]
push eax
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
xor ecx, ecx
mov dword [esi + 0x14], 7
mov dword [esi + 0x10], edi
push edi
mov word [esi], cx
push 0x514d24
mov ecx, esi
call fcn.00401650
cmp dword [ebp - 0x28], 8
jb 0x401c47
mov edx, dword [ebp - 0x3c]
push edx
call fcn.0040232a
add esp, 4
jmp 0x401c47
mov eax, dword [ebp - 0x44]
push 8
push str.password
push eax
call dword [sym.imp.ADVAPI32.dll_CryptHashData]
test eax, eax
jne 0x401ad9
mov ecx, dword [ebp - 0x44]
push ecx
call dword [sym.imp.ADVAPI32.dll_CryptDestroyHash]
mov edx, dword [ebp - 0x40]
push edi
push edx
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
push 0x514d24
mov ecx, esi
call fcn.00401740
jmp 0x401a28
mov edx, dword [ebp - 0x44]
mov eax, dword [ebp - 0x40]
lea ecx, [ebp - 0x48]
push ecx
push 0x1000001
push edx
push 0x6610
push eax
call dword [sym.imp.ADVAPI32.dll_CryptDeriveKey]
test eax, eax
jne 0x401b1f
mov ecx, dword [ebp - 0x44]
push ecx
call dword [sym.imp.ADVAPI32.dll_CryptDestroyHash]
mov edx, dword [ebp - 0x40]
push edi
push edx
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
push 0x514d24
mov ecx, esi
call fcn.00401740
jmp 0x401c3f
mov ecx, dword [ebp - 0x48]
push edi
lea eax, [ebp - 0x54]
push eax
push 4
push ecx
call dword [sym.imp.ADVAPI32.dll_CryptSetKeyParam]
mov eax, dword [ebp - 0x48]
push edi
lea edx, [ebp - 0x20]
push edx
push 1
push eax
call dword [sym.imp.ADVAPI32.dll_CryptSetKeyParam]
mov eax, dword [ebx + 0x10]
add eax, eax
mov dword [ebp - 0x4c], eax
add eax, 0x10
push eax
mov dword [ebp - 0x50], eax
call fcn.00402335
add esp, 4
cmp dword [ebx + 0x14], 8
mov edi, eax
jb 0x401b62
mov ebx, dword [ebx]
mov ecx, dword [ebp - 0x4c]
push ecx
push ebx
push edi
call fcn.004f0e20
add esp, 0xc
cmp byte [ebp + 0x10], 0
je 0x401bbb
mov edx, dword [ebp - 0x50]
mov ecx, dword [ebp - 0x48]
push edx
lea eax, [ebp - 0x4c]
push eax
push edi
push 0
push 1
push 0
push ecx
call dword [sym.imp.ADVAPI32.dll_CryptEncrypt]
test eax, eax
jne 0x401bfc
push edi
call fcn.0040232a
mov edx, dword [ebp - 0x48]
add esp, 4
push edx
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov eax, dword [ebp - 0x44]
push eax
call dword [sym.imp.ADVAPI32.dll_CryptDestroyHash]
mov ecx, dword [ebp - 0x40]
push 0
push ecx
jmp 0x401b08
mov eax, dword [ebp - 0x48]
lea edx, [ebp - 0x4c]
push edx
push edi
push 0
push 1
push 0
push eax
call dword [sym.imp.ADVAPI32.dll_CryptDecrypt]
test eax, eax
jne 0x401bfc
push edi
call fcn.0040232a
mov ecx, dword [ebp - 0x48]
add esp, 4
push ecx
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov edx, dword [ebp - 0x44]
push edx
call dword [sym.imp.ADVAPI32.dll_CryptDestroyHash]
mov eax, dword [ebp - 0x40]
push 0
push eax
jmp 0x401b08
mov ecx, dword [ebp - 0x4c]
shr ecx, 1
push ecx
push edi
lea ecx, [ebp - 0x3c]
call fcn.00401650
push edi
call fcn.0040232a
mov edx, dword [ebp - 0x48]
add esp, 4
push edx
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov eax, dword [ebp - 0x44]
push eax
call dword [sym.imp.ADVAPI32.dll_CryptDestroyHash]
mov ecx, dword [ebp - 0x40]
push 0
push ecx
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
lea edx, [ebp - 0x3c]
push edx
mov ecx, esi
call fcn.004018b0
lea ecx, [ebp - 0x3c]
call fcn.00401110
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004f1a90
mov esp, ebp
pop ebp
ret