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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4285c5
mov eax, dword fs:[0]
push eax
sub esp, 0x84
mov eax, dword [0x434014]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov dword [ebp - 0x40], edi
mov eax, dword [ebp + 0x20]
mov dword [ebp - 0x8c], eax
mov eax, dword [ebp + 0x24]
mov dword [ebp - 0x88], edi
mov dword [ebp - 0x88], eax
mov dword [ebp - 4], 0
xorps xmm0, xmm0
mov esi, dword [ebp + 0x18]
movq qword [ebp - 0x34], xmm0
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x3c], 0
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x84], esi
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x2c], 0
test esi, esi
je 0x4061f9
push esi
lea ecx, [ebp - 0x34]
call fcn.0040c340
push dword [ebp - 0x84]
mov eax, dword [ebp - 0x34]
add esi, eax
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
mov dword [ebp - 0x30], esi
xorps xmm0, xmm0
mov dword [ebp - 0x14], 0
movq qword [ebp - 0x1c], xmm0
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x28]
movq qword [ebp - 0x28], xmm0
mov dword [ebp - 0x20], 0
push 0xc
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x20], 0
call fcn.0040c340
mov eax, dword [ebp - 0x28]
xorps xmm0, xmm0
movq qword [eax], xmm0
lea ecx, [eax + 0xc]
mov eax, dword [ebp - 0x28]
mov dword [eax + 8], 0
mov dword [ebp - 0x24], ecx
mov byte [ebp - 4], 3
lea esi, [ebp + 8]
cmp dword [ebp + 0x1c], 0x10
lea eax, [ebp + 8]
cmovae esi, dword [ebp + 8]
add esi, 0xf
cmp dword [ebp + 0x1c], 0x10
cmovae eax, dword [ebp + 8]
add eax, 3
sub esi, eax
push esi
push eax
push dword [ebp - 0x28]
call sub.VCRUNTIME140.dll_memmove
cmp dword [ebp + 0x1c], 0x10
lea eax, [ebp + 8]
mov esi, dword [ebp - 0x84]
cmovae eax, dword [ebp + 8]
add esi, eax
cmp dword [ebp + 0x1c], 0x10
lea eax, [ebp + 8]
cmovae eax, dword [ebp + 8]
add eax, 0xf
sub esi, eax
push esi
push eax
push dword [ebp - 0x34]
call sub.VCRUNTIME140.dll_memmove
add esp, 0x18
lea eax, [ebp - 0x3c]
push 0
push 0
push 0x42c97c
push eax
call dword [sym.imp.bcrypt.dll_BCryptOpenAlgorithmProvider]
push 0
test eax, eax
jns 0x40642b
xorps xmm0, xmm0
mov ecx, edi
movups xmmword [edi], xmm0
mov dword [edi + 0x14], 0
push 0x42b82e
mov dword [edi + 0x10], 0
call fcn.00402010
mov ecx, dword [ebp - 0x28]
test ecx, ecx
je 0x406348
mov edx, dword [ebp - 0x20]
mov eax, ecx
sub edx, ecx
cmp edx, 0x1000
jb 0x406329
mov ecx, dword [eax - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4066f2
push edx
push ecx
call fcn.004270a2
add esp, 8
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x20], 0
mov ecx, dword [ebp - 0x1c]
test ecx, ecx
je 0x406391
mov edx, dword [ebp - 0x14]
mov eax, ecx
sub edx, ecx
cmp edx, 0x1000
jb 0x406372
mov ecx, dword [eax - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4066f2
push edx
push ecx
call fcn.004270a2
add esp, 8
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x1c], 0
mov ecx, dword [ebp - 0x34]
test ecx, ecx
je 0x4063da
mov edx, dword [ebp - 0x2c]
mov eax, ecx
sub edx, ecx
cmp edx, 0x1000
jb 0x4063bb
mov ecx, dword [eax - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4066f2
push edx
push ecx
call fcn.004270a2
add esp, 8
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x34], 0
mov ecx, dword [ebp + 0x1c]
cmp ecx, 0x10
jb 0x40640e
mov edx, dword [ebp + 8]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x406404
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4066f2
push ecx
push edx
call fcn.004270a2
add esp, 8
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00426c11
mov esp, ebp
pop ebp
ret
push 0x20
push str.ChainingModeGCM
push str.ChainingMode
push dword [ebp - 0x3c]
call dword [sym.imp.bcrypt.dll_BCryptSetProperty]
push 0
test eax, eax
jns 0x4064a6
push dword [ebp - 0x3c]
call dword [sym.imp.bcrypt.dll_BCryptCloseAlgorithmProvider]
xorps xmm0, xmm0
mov ecx, edi
movups xmmword [edi], xmm0
push 0
mov dword [edi + 0x10], 0
push 0x42b82e
mov dword [edi + 0x14], 0
call fcn.00402010
mov edx, dword [ebp - 0x28]
test edx, edx
je 0x406348
mov ecx, dword [ebp - 0x20]
mov eax, edx
sub ecx, edx
cmp ecx, 0x1000
jb 0x40649f
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4066f2
push ecx
push edx
jmp 0x40632b
push dword [ebp - 0x8c]
lea eax, [ebp - 0x40]
push dword [ebp - 0x88]
push 0
push 0
push eax
push dword [ebp - 0x3c]
call dword [sym.imp.bcrypt.dll_BCryptGenerateSymmetricKey]
push 0
test eax, eax
js 0x406446
mov edx, dword [ebp - 0x84]
xorps xmm0, xmm0
mov ecx, dword [ebp - 0x34]
add edx, 0xffffffe1
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x78], eax
movlpd qword [ebp - 0x70], xmm0
lea eax, [ecx + edx]
movlpd qword [ebp - 0x60], xmm0
mov dword [ebp - 0x68], eax
lea eax, [ebp - 0x38]
push eax
push 0
push 0
push 0
push 0
lea eax, [ebp - 0x80]
movlpd qword [ebp - 0x58], xmm0
push eax
push edx
push ecx
push dword [ebp - 0x40]
movlpd qword [ebp - 0x50], xmm0
movlpd qword [ebp - 0x48], xmm0
mov dword [ebp - 0x80], 0x40
mov dword [ebp - 0x7c], 1
mov dword [ebp - 0x88], edx
mov dword [ebp - 0x74], 0xc
mov dword [ebp - 0x64], 0x10
call dword [sym.imp.bcrypt.dll_BCryptDecrypt]
test eax, eax
jns 0x406549
push 0
jmp 0x4062df
mov eax, dword [ebp - 0x18]
mov edx, eax
mov ecx, dword [ebp - 0x1c]
sub edx, ecx
mov esi, dword [ebp - 0x38]
mov dword [ebp - 0x84], eax
cmp esi, edx
jae 0x406565
lea eax, [ecx + esi]
jmp 0x4065a3
jbe 0x4065a6
mov eax, dword [ebp - 0x14]
sub eax, ecx
cmp esi, eax
jbe 0x406582
push ecx
push esi
lea ecx, [ebp - 0x1c]
call fcn.0040d710
mov esi, dword [ebp - 0x38]
mov ecx, dword [ebp - 0x1c]
jmp 0x4065a6
sub esi, edx
push esi
push 0
push dword [ebp - 0x84]
call sub.VCRUNTIME140.dll_memset
mov eax, dword [ebp - 0x84]
add esp, 0xc
mov ecx, dword [ebp - 0x1c]
add eax, esi
mov esi, dword [ebp - 0x38]
mov dword [ebp - 0x18], eax
push 0
lea eax, [ebp - 0x38]
push eax
push esi
push ecx
push 0
push 0
lea eax, [ebp - 0x80]
push eax
push dword [ebp - 0x88]
push dword [ebp - 0x34]
push dword [ebp - 0x40]
call dword [sym.imp.bcrypt.dll_BCryptDecrypt]
push 0
test eax, eax
js 0x4062df
push dword [ebp - 0x3c]
call dword [sym.imp.bcrypt.dll_BCryptCloseAlgorithmProvider]
push ecx
push dword [ebp - 0x18]
mov ecx, edi
push dword [ebp - 0x1c]
call fcn.0040a210
mov edx, dword [ebp - 0x28]
test edx, edx
je 0x406632
mov ecx, dword [ebp - 0x20]
mov eax, edx
sub ecx, edx
cmp ecx, 0x1000
jb 0x406613
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4066f2
push ecx
push edx
call fcn.004270a2
add esp, 8
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x20], 0
mov ecx, dword [ebp - 0x1c]
test ecx, ecx
je 0x40667b
mov edx, dword [ebp - 0x14]
mov eax, ecx
sub edx, ecx
cmp edx, 0x1000
jb 0x40665c
mov ecx, dword [eax - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4066f2
push edx
push ecx
call fcn.004270a2
add esp, 8
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0
mov ecx, dword [ebp - 0x34]
test ecx, ecx
je 0x4066c0
mov edx, dword [ebp - 0x2c]
mov eax, ecx
sub edx, ecx
cmp edx, 0x1000
jb 0x4066a1
mov ecx, dword [eax - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4066f2
push edx
push ecx
call fcn.004270a2
add esp, 8
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x2c], 0
mov ecx, dword [ebp + 0x1c]
cmp ecx, 0x10
jb 0x40640e
mov edx, dword [ebp + 8]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x406404
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x406404
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3