Function at 0x40e450
Capabilities:
Encrypt or decrypt via wincrypt

Disassembly:
push ebp
mov ecx, 0x28
mov eax, 0x6602
mov ebp, esp
push edi
push esi
lea edx, [ebp - 0x30]
push ebx
sub esp, 0x54
call fcn.00407220
test eax, eax
jne 0x40e480
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
lea ebx, [ebp - 0x28]
lea eax, [ebp - 0x2c]
mov edx, dword [sym.imp.advapi32.dll_CryptGetKeyParam]
mov dword [ebp - 0x14], 0x13121110
mov dword [ebp - 0x24], 0x3020100
mov dword [ebp - 0x20], 0x7060504
mov dword [ebp - 0x1c], 0xb0a0908
mov dword [ebp - 0x18], 0xf0e0d0c
mov dword [ebp - 0x11], 0x16151413
mov dword [ebp - 0x2c], 0xdeadbeef
mov dword [ebp - 0x28], 4
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], ebx
mov dword [esp + 8], eax
mov dword [esp + 4], 4
mov eax, dword [ebp - 0x30]
mov esi, dword fs:[0x18]
mov dword [esp], eax
mov dword [ebp - 0x34], edx
call edx
sub esp, 0x14
mov edi, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0x2e1
mov eax, dword [esi + 0x34]
mov dword [esp], edi
mov dword [esp + 8], eax
mov dword [esp + 4], str._08lx_n
call fcn.00401ac0
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0x2e2
xor eax, eax
mov dword [esp + 4], str.Wrong_default_chaining_mode_n
cmp dword [ebp - 0x2c], 1
sete al
mov dword [esp], eax
call fcn.00401ac0
lea eax, [ebp - 0x2c]
mov dword [ebp - 0x2c], 2
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
mov dword [esp + 4], 4
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
mov eax, dword [sym.imp.advapi32.dll_CryptSetKeyParam]
mov dword [ebp - 0x3c], eax
call eax
sub esp, 0x10
mov edi, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0x2e6
mov eax, dword [esi + 0x34]
mov dword [esp], edi
mov dword [esp + 8], eax
mov dword [esp + 4], str._08lx_n
call fcn.00401ac0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 0
mov dword [esp + 4], 2
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
mov edx, dword [ebp - 0x34]
call edx
sub esp, 0x14
mov edi, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0x2e9
mov eax, dword [esi + 0x34]
mov dword [esp + 4], str._08lx_n
mov dword [esp + 8], eax
mov dword [esp], edi
call fcn.00401ac0
mov eax, 0x2ea
call fcn.00401310
mov eax, dword [ebp - 0x28]
mov edx, 1
cmp eax, 0xb
je 0x40e61c
xor edx, edx
mov esi, eax
or esi, dword [0x42b050]
sete dl
mov dword [esp], edx
mov dword [esp + 8], eax
mov dword [esp + 4], str.unexpected_salt_length__ld_n
mov edi, dword fs:[0x18]
call fcn.00401ac0
mov dword [ebp - 0x28], 0x17
mov dword [esp + 0x18], 0x18
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
mov eax, dword [sym.imp.advapi32.dll_CryptEncrypt]
mov dword [ebp - 0x34], eax
call eax
sub esp, 0x1c
mov esi, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0x2ee
mov eax, dword [edi + 0x34]
mov dword [esp], esi
lea esi, [ebp - 0x24]
mov dword [esp + 8], eax
mov dword [esp + 4], str.CryptEncrypt_failed:__08lx_n
call fcn.00401ac0
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0x2ef
mov eax, dword [ebp - 0x28]
mov dword [esp + 4], str.Unexpected_length__ld_n
cmp eax, 0x18
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00401ac0
mov dword [edi + 0x34], 0
mov dword [ebp - 0x28], 0x17
mov dword [esp + 0x18], 0x18
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
mov eax, dword [ebp - 0x34]
call eax
sub esp, 0x1c
mov dword [ebp - 0x38], eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov ecx, dword [ebp - 0x28]
mov dword [eax + 4], 0x2f4
mov edx, dword [edi + 0x34]
cmp ecx, 0x18
jne 0x40e74c
mov edi, dword [ebp - 0x38]
test edi, edi
jne 0x40ee58
xor eax, eax
mov dword [esp + 0xc], ecx
mov dword [esp + 8], edx
mov dword [esp], eax
mov dword [esp + 4], str._08lx__dwLen:__ld_n
call fcn.00401ac0
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
mov eax, dword [sym.imp.advapi32.dll_CryptDecrypt]
mov dword [ebp - 0x38], eax
call eax
sub esp, 0x18
mov edi, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov edx, dword [ebp - 0x28]
mov dword [eax + 4], 0x2f8
mov eax, dword fs:[0x18]
mov ecx, dword [eax + 0x34]
cmp edx, 0x17
jne 0x40e7c6
test edi, edi
jne 0x40ee20
xor eax, eax
mov dword [esp + 8], ecx
mov dword [esp + 0xc], edx
mov dword [esp], eax
mov dword [esp + 4], str._08lx__dwLen:__ld_n
call fcn.00401ac0
lea eax, [ebp - 0x2c]
mov dword [ebp - 0x2c], 1
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
mov dword [esp + 4], 4
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
mov eax, dword [ebp - 0x3c]
call eax
sub esp, 0x10
mov edi, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov edx, dword fs:[0x18]
mov dword [eax + 4], 0x2fd
mov eax, dword [edx + 0x34]
mov dword [ebp - 0x40], edx
mov dword [esp + 8], eax
mov dword [esp], edi
mov dword [esp + 4], str._08lx_n
call fcn.00401ac0
mov dword [ebp - 0x28], 0x17
mov dword [esp + 0x18], 0x18
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
mov eax, dword [ebp - 0x34]
call eax
sub esp, 0x1c
mov edi, eax
call fcn.00412e10
mov edx, dword [ebp - 0x40]
mov dword [eax], 0x41605d
mov dword [eax + 4], 0x301
mov eax, dword [edx + 0x34]
mov dword [esp], edi
mov dword [esp + 8], eax
mov dword [esp + 4], str.CryptEncrypt_failed:__08lx_n
call fcn.00401ac0
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0x302
mov eax, dword [ebp - 0x28]
mov dword [esp + 4], str.Unexpected_length__ld_n
cmp eax, 0x18
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00401ac0
mov dword [ebp - 0x28], 0x17
mov dword [esp + 0x18], 0x18
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
mov eax, dword [ebp - 0x34]
call eax
sub esp, 0x1c
mov edi, eax
call fcn.00412e10
mov edx, dword [ebp - 0x40]
mov dword [eax], 0x41605d
mov ecx, dword [ebp - 0x28]
mov dword [eax + 4], 0x306
mov edx, dword [edx + 0x34]
cmp ecx, 0x18
jne 0x40e949
test edi, edi
jne 0x40ede8
xor eax, eax
mov dword [esp + 0xc], ecx
mov dword [esp + 8], edx
mov dword [esp], eax
mov dword [esp + 4], str._08lx__dwLen:__ld_n
call fcn.00401ac0
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
mov eax, dword [ebp - 0x38]
call eax
sub esp, 0x18
mov edi, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov edx, dword [ebp - 0x28]
mov dword [eax + 4], 0x30a
mov eax, dword fs:[0x18]
mov ecx, dword [eax + 0x34]
cmp edx, 0x17
jne 0x40e9be
test edi, edi
jne 0x40edb0
xor eax, eax
mov dword [esp + 8], ecx
mov dword [esp + 0xc], edx
mov dword [esp], eax
mov dword [esp + 4], str._08lx__dwLen:__ld_n
call fcn.00401ac0
lea eax, [ebp - 0x2c]
mov dword [ebp - 0x2c], 4
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
mov dword [esp + 4], 4
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
mov eax, dword [ebp - 0x3c]
call eax
sub esp, 0x10
mov edi, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov edx, dword fs:[0x18]
mov dword [eax + 4], 0x30f
mov eax, dword [edx + 0x34]
mov dword [ebp - 0x40], edx
mov dword [esp + 8], eax
mov dword [esp], edi
mov dword [esp + 4], str._08lx_n
call fcn.00401ac0
mov dword [ebp - 0x28], 0x10
mov dword [esp + 0x18], 0x18
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
mov eax, dword [ebp - 0x34]
call eax
sub esp, 0x1c
mov edi, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0x313
mov eax, dword [ebp - 0x28]
mov dword [esp + 0xc], eax
mov edx, dword [ebp - 0x40]
cmp eax, 0x10
mov ecx, dword [edx + 0x34]
mov dword [esp + 4], str._08lx__dwLen:__ld_n
mov dword [esp + 8], ecx
sete cl
xor eax, eax
test edi, edi
setne al
and eax, ecx
mov dword [esp], eax
call fcn.00401ac0
lea eax, [ebp - 0x14]
mov dword [ebp - 0x28], 7
mov dword [esp + 0x18], 8
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
mov eax, dword [ebp - 0x34]
call eax
sub esp, 0x1c
mov edi, eax
call fcn.00412e10
mov edx, dword [ebp - 0x40]
mov dword [eax], 0x41605d
mov ecx, dword [ebp - 0x28]
mov dword [eax + 4], 0x317
mov edx, dword [edx + 0x34]
cmp ecx, 8
jne 0x40eb24
test edi, edi
jne 0x40ed78
xor eax, eax
mov dword [esp + 0xc], ecx
mov dword [esp + 8], edx
mov dword [esp], eax
mov dword [esp + 4], str._08lx__dwLen:__ld_n
call fcn.00401ac0
mov dword [ebp - 0x28], 8
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
mov eax, dword [ebp - 0x38]
call eax
sub esp, 0x18
mov edi, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0x31c
mov eax, dword [ebp - 0x28]
mov edx, dword fs:[0x18]
mov dword [esp + 0xc], eax
mov ecx, dword [edx + 0x34]
test edi, edi
mov dword [ebp - 0x40], edx
mov dword [esp + 8], ecx
setne cl
cmp eax, 8
sete al
mov dword [esp + 4], str._08lx__dwLen:__ld_n
movzx eax, al
and eax, ecx
mov dword [esp], eax
call fcn.00401ac0
lea eax, [ebp - 0x1c]
mov dword [ebp - 0x28], 0x10
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
mov eax, dword [ebp - 0x38]
call eax
sub esp, 0x18
mov edi, eax
call fcn.00412e10
mov edx, dword [ebp - 0x40]
mov dword [eax], 0x41605d
mov ecx, dword [ebp - 0x28]
mov dword [eax + 4], 0x320
mov edx, dword [edx + 0x34]
test edi, edi
je 0x40ec21
cmp ecx, 0xf
je 0x40ed40
xor eax, eax
mov dword [esp], eax
mov dword [esp + 0xc], ecx
mov dword [esp + 8], edx
mov dword [esp + 4], str._08lx__dwLen:__ld_n
call fcn.00401ac0
lea eax, [ebp - 0x2c]
mov dword [ebp - 0x2c], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
mov dword [esp + 4], 4
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
mov eax, dword [ebp - 0x3c]
call eax
sub esp, 0x10
mov edi, eax
test eax, eax
jne 0x40ec80
mov eax, dword fs:[0x18]
cmp dword [eax + 0x34], 0x54f
je 0x40ee90
mov eax, 0x32b
call fcn.00401310
mov edx, dword fs:[0x18]
mov eax, dword [edx + 0x34]
mov dword [ebp - 0x38], edx
mov dword [esp + 4], str._08lx_n
mov dword [esp + 8], eax
mov dword [esp], edi
call fcn.00401ac0
mov dword [ebp - 0x28], 0x17
mov dword [esp + 0x14], ebx
mov dword [esp + 0x18], 0x18
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
mov eax, dword [ebp - 0x34]
call eax
sub esp, 0x1c
mov ebx, eax
mov eax, 0x32f
call fcn.00401310
mov edx, dword [ebp - 0x38]
xor eax, eax
mov ecx, dword [edx + 0x34]
test ebx, ebx
jne 0x40ed0b
xor eax, eax
cmp ecx, 0x80090008
sete al
mov dword [esp + 8], ecx
mov dword [esp + 4], str._08lx_n
mov dword [esp], eax
call fcn.00401ac0
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_CryptDestroyKey]
sub esp, 4
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [ebp - 0x40], edx
mov dword [ebp - 0x38], ecx
mov dword [esp + 8], 0x17
mov dword [esp + 4], esi
mov dword [esp], 0x418e7c
call sub.msvcrt.dll_memcmp
mov ecx, dword [ebp - 0x38]
mov edx, dword [ebp - 0x40]
test eax, eax
sete al
movzx eax, al
jmp 0x40ec23
mov dword [ebp - 0x44], edx
mov dword [ebp - 0x40], ecx
mov dword [esp + 8], 0x18
mov dword [esp + 4], esi
mov dword [esp], 0x418e34
call sub.msvcrt.dll_memcmp
mov ecx, dword [ebp - 0x40]
mov edx, dword [ebp - 0x44]
test eax, eax
sete al
movzx eax, al
jmp 0x40eb26
mov dword [ebp - 0x44], ecx
mov dword [ebp - 0x40], edx
mov dword [esp + 8], 0x17
mov dword [esp + 4], esi
mov dword [esp], 0x418e7c
call sub.msvcrt.dll_memcmp
mov edx, dword [ebp - 0x40]
mov ecx, dword [ebp - 0x44]
test eax, eax
sete al
movzx eax, al
jmp 0x40e9c0
mov dword [ebp - 0x44], edx
mov dword [ebp - 0x40], ecx
mov dword [esp + 8], 0x18
mov dword [esp + 4], esi
mov dword [esp], 0x418e4c
call sub.msvcrt.dll_memcmp
mov ecx, dword [ebp - 0x40]
mov edx, dword [ebp - 0x44]
test eax, eax
sete al
movzx eax, al
jmp 0x40e94b
mov dword [ebp - 0x44], ecx
mov dword [ebp - 0x40], edx
mov dword [esp + 8], 0x17
mov dword [esp + 4], esi
mov dword [esp], 0x418e7c
call sub.msvcrt.dll_memcmp
mov edx, dword [ebp - 0x40]
mov ecx, dword [ebp - 0x44]
test eax, eax
sete al
movzx eax, al
jmp 0x40e7c8
mov dword [ebp - 0x40], edx
mov dword [ebp - 0x38], ecx
mov dword [esp + 8], 0x18
mov dword [esp + 4], esi
mov dword [esp], 0x418e64
call sub.msvcrt.dll_memcmp
mov ecx, dword [ebp - 0x38]
mov edx, dword [ebp - 0x40]
test eax, eax
sete al
movzx eax, al
jmp 0x40e74e
mov eax, 0x327
call fcn.00401310
mov dword [esp + 4], str.OFB_mode_not_supported_n
xor eax, eax
mov edx, dword [0x42b050]
test edx, edx
sete al
mov dword [esp], eax
call fcn.00401ac0
jmp 0x40ed1f