Function at 0x420520
Capabilities:
Encrypt or decrypt data via bcrypt

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x44
mov eax, dword [0x4e500c]
xor eax, ebp
mov dword [ebp - 4], eax
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x1c], 0
mov dword [ebp - 8], 0
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x30], 0xc00000e5
mov dword [ebp - 0x3c], 0
push 0
push 0x4e5d28
push 0x4e5d20
lea eax, [ebp - 0x18]
push eax
call dword [sym.imp.bcrypt.dll_BCryptOpenAlgorithmProvider]
mov dword [ebp - 0x30], eax
cmp dword [ebp - 0x30], 0
jge 0x4205a1
jmp 0x420720
push 0
lea ecx, [ebp - 8]
push ecx
push 4
lea edx, [ebp - 0x2c]
push edx
push 0x4e5d04
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.bcrypt.dll_BCryptGetProperty]
mov dword [ebp - 0x30], eax
cmp dword [ebp - 0x30], 0
jge 0x4205ca
jmp 0x420720
push 0
lea ecx, [ebp - 8]
push ecx
push 4
lea edx, [ebp - 0x1c]
push edx
push 0x4e5cec
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.bcrypt.dll_BCryptGetProperty]
mov dword [ebp - 0x30], eax
cmp dword [ebp - 0x30], 0
jge 0x4205f3
jmp 0x420720
push 0
lea ecx, [ebp - 8]
push ecx
push 0xc
lea edx, [ebp - 0x14]
push edx
push 0x4e5cd4
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.bcrypt.dll_BCryptGetProperty]
mov dword [ebp - 0x30], eax
cmp dword [ebp - 0x30], 0
jge 0x42061c
jmp 0x420720
mov ecx, dword [ebp - 0x2c]
push ecx
lea edx, [ebp - 0x28]
push edx
call fcn.00420e40
add esp, 8
mov dword [ebp - 0x40], eax
cmp dword [ebp - 0x40], 0
jne 0x420641
mov dword [ebp - 0x30], 0xc0000017
jmp 0x420720
mov eax, dword [ebp - 0x1c]
push eax
lea ecx, [ebp - 0x24]
push ecx
call fcn.00420e40
add esp, 8
mov dword [ebp - 0x38], eax
cmp dword [ebp - 0x38], 0
jne 0x420666
mov dword [ebp - 0x30], 0xc0000017
jmp 0x420720
mov edx, dword [ebp - 0x10]
shr edx, 3
mov dword [ebp - 0x44], edx
mov eax, dword [ebp + 0xc]
cmp eax, dword [ebp - 0x44]
jae 0x420683
mov dword [ebp - 0x30], 0xc0000023
jmp 0x420720
push 0
mov ecx, dword [ebp - 0x44]
push ecx
mov edx, dword [ebp + 8]
push edx
mov eax, dword [ebp - 0x2c]
push eax
mov ecx, dword [ebp - 0x40]
push ecx
lea edx, [ebp - 0x20]
push edx
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.bcrypt.dll_BCryptGenerateSymmetricKey]
mov dword [ebp - 0x30], eax
cmp dword [ebp - 0x30], 0
jge 0x4206ae
jmp 0x420720
mov dword [ebp - 0x34], 0
jmp 0x4206c0
mov ecx, dword [ebp - 0x34]
add ecx, 1
mov dword [ebp - 0x34], ecx
mov edx, dword [ebp - 0x34]
cmp edx, dword [ebp - 0x1c]
jae 0x4206d5
mov eax, dword [ebp - 0x38]
add eax, dword [ebp - 0x34]
mov cl, byte [ebp - 0x34]
mov byte [eax], cl
jmp 0x4206b7
push 0
lea edx, [ebp - 8]
push edx
mov eax, dword [ebp + 0x14]
push eax
mov ecx, dword [ebp + 0x10]
push ecx
mov edx, dword [ebp - 0x1c]
push edx
mov eax, dword [ebp - 0x38]
push eax
push 0
mov ecx, dword [ebp + 0x1c]
push ecx
mov edx, dword [ebp + 0x18]
push edx
mov eax, dword [ebp - 0x20]
push eax
call dword [sym.imp.bcrypt.dll_BCryptDecrypt]
mov dword [ebp - 0x30], eax
cmp dword [ebp - 0x30], 0
jge 0x42070a
jmp 0x420720
cmp dword [ebp + 0x20], 0
je 0x420718
mov ecx, dword [ebp + 0x20]
mov edx, dword [ebp - 8]
mov dword [ecx], edx
xor eax, eax
jne 0x42057d
cmp dword [ebp - 0x20], 0
je 0x420733
mov ecx, dword [ebp - 0x20]
push ecx
call dword [sym.imp.bcrypt.dll_BCryptDestroyKey]
mov dword [ebp - 0x3c], eax
cmp dword [ebp - 0x24], 0
je 0x420745
mov edx, dword [ebp - 0x24]
push edx
call fcn.00420e80
add esp, 4
cmp dword [ebp - 0x28], 0
je 0x420757
mov eax, dword [ebp - 0x28]
push eax
call fcn.00420e80
add esp, 4
cmp dword [ebp - 0x18], 0
je 0x42076c
push 0
mov ecx, dword [ebp - 0x18]
push ecx
call dword [sym.imp.bcrypt.dll_BCryptCloseAlgorithmProvider]
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp - 0x30]
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0043a792
mov esp, ebp
pop ebp
ret