Function at 0x40d3f0
Capabilities:
Encrypt or decrypt via wincrypt

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x44
mov eax, dword [0x420008]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
mov dword [ebp - 0x38], eax
xor ebx, ebx
mov eax, dword [ebp + 0xc]
push esi
mov esi, ecx
mov dword [ebp - 0x28], eax
xor eax, eax
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x34], eax
lea eax, [esi + 0x50]
push edi
xor edi, edi
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x40], eax
cmp dword [eax + 0x18], ebx
je 0x40d43a
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push ecx
push 0xa
lea eax, [ebp - 0x10]
mov ecx, esi
push eax
call fcn.0040ec40
test eax, eax
je 0x40d799
mov al, byte [ebp - 0x10]
cmp al, 0xac
jne 0x40d498
cmp byte [ebp - 0xf], 0x10
jne 0x40d774
push ecx
xorps xmm0, xmm0
mov word [ebp - 0x14], bx
push 0xa
lea eax, [ebp - 0x1c]
movq qword [ebp - 0x1c], xmm0
push eax
mov ecx, esi
mov word [ebp - 0x1c], 0x10ac
call fcn.0040eaf0
push ecx
push 0xa
lea eax, [ebp - 0x10]
mov ecx, esi
push eax
call fcn.0040ec40
test eax, eax
jne 0x40d450
jmp 0x40d799
cmp al, 0xfa
jne 0x40d774
cmp byte [ebp - 0xf], 0xe1
jne 0x40d774
mov eax, dword [ebp - 0x28]
mov dword [eax], ebx
mov ebx, dword [ebp - 0xe]
mov eax, dword [ebp - 0xa]
mov dword [ebp - 0x20], eax
test ebx, ebx
jle 0x40d750
test eax, eax
js 0x40d750
lea edi, [ebx + 1]
push edi
mov dword [ebp - 0x28], edi
call fcn.004168ef
add esp, 4
mov dword [ebp - 0x30], eax
test eax, eax
je 0x40d74a
push edi
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 8
mov ecx, esi
push ebx
push dword [ebp - 0x30]
call fcn.0040ec40
test eax, eax
je 0x40d74a
xor ecx, ecx
mov eax, edi
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.004168ef
add esp, 4
mov dword [ebp - 0x2c], eax
cmp dword [esi + 0x48], 0
je 0x40d5e8
mov eax, dword [esi + 0x44]
cmp dword [eax + 0x30], 0
lea edi, [eax + 0x18]
mov dword [ebp - 0x28], eax
je 0x40d53f
push edi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea ecx, [ebx + 1]
mov dword [ebp - 0x24], ebx
push ecx
call fcn.004168ef
mov ecx, eax
add esp, 4
mov eax, dword [ebp - 0x24]
inc eax
mov dword [ebp - 0x34], ecx
push eax
push 0
push ecx
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
push ebx
push dword [ebp - 0x30]
mov ebx, dword [ebp - 0x34]
push ebx
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
lea eax, [ebp - 0x24]
push eax
mov eax, dword [ebp - 0x28]
push ebx
push 0
push 1
push 0
push dword [eax + 0xc]
call dword [sym.imp.ADVAPI32.dll_CryptDecrypt]
cmp dword [edi + 0x18], 0
je 0x40d597
push edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebp - 0x24]
mov byte [ebx + eax], 0
test ebx, ebx
je 0x40d74a
mov eax, dword [ebp - 0x24]
mov edi, ebx
inc eax
mov dword [ebp - 0x28], eax
lea ecx, [edi + 1]
mov al, byte [edi]
inc edi
test al, al
jne 0x40d5b2
push 0
push 0
sub edi, ecx
push edi
push ebx
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov ebx, eax
lea eax, [ebx + 1]
cmp dword [ebp - 0x28], eax
jge 0x40d5dd
or ebx, 0xffffffff
jmp 0x40d639
mov eax, dword [ebp - 0x34]
push ebx
push dword [ebp - 0x2c]
push edi
push eax
jmp 0x40d623
mov ecx, dword [ebp - 0x30]
mov edi, ecx
lea edx, [edi + 1]
mov al, byte [edi]
inc edi
test al, al
jne 0x40d5f0
push 0
push 0
sub edi, edx
push edi
push ecx
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov ebx, eax
lea eax, [ebx + 1]
cmp dword [ebp - 0x28], eax
jge 0x40d61b
or ebx, 0xffffffff
jmp 0x40d639
push ebx
push dword [ebp - 0x2c]
push edi
push dword [ebp - 0x30]
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov eax, dword [ebp - 0x2c]
xor ecx, ecx
mov word [eax + ebx*2], cx
test ebx, ebx
jle 0x40d73d
mov ecx, dword [ebp - 0x38]
push dword [ebp - 0x2c]
mov eax, dword [ecx]
call dword [eax + 0x28]
test eax, eax
je 0x40d73d
mov ebx, dword [ebp - 0x20]
test ebx, ebx
jle 0x40d734
push ebx
call fcn.004168ef
mov edi, eax
mov ecx, esi
push ebx
push edi
mov dword [ebp - 0x28], edi
call fcn.0040ec40
test eax, eax
jne 0x40d689
push edi
call fcn.004168fd
add esp, 4
xor edi, edi
xor ebx, ebx
jmp 0x40d799
cmp dword [esi + 0x48], 0
je 0x40d723
mov edi, dword [esi + 0x44]
cmp dword [edi + 0x30], 0
lea esi, [edi + 0x18]
je 0x40d6a6
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea eax, [ebx + 1]
mov dword [ebp - 0x20], ebx
push eax
call fcn.004168ef
mov ecx, eax
add esp, 4
mov eax, dword [ebp - 0x20]
inc eax
mov dword [ebp - 0x3c], ecx
push eax
push 0
push ecx
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
push ebx
push dword [ebp - 0x28]
mov ebx, dword [ebp - 0x3c]
push ebx
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
lea eax, [ebp - 0x20]
push eax
push ebx
push 0
push 1
push 0
push dword [edi + 0xc]
call dword [sym.imp.ADVAPI32.dll_CryptDecrypt]
cmp dword [esi + 0x18], 0
je 0x40d6fb
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebp - 0x20]
mov byte [ebx + eax], 0
test ebx, ebx
je 0x40d796
push dword [ebp - 0x20]
mov ecx, dword [ebp - 0x38]
push ebx
call fcn.0040bfa0
mov edi, dword [ebp - 0x28]
mov esi, 1
jmp 0x40d79b
mov ecx, dword [ebp - 0x38]
push ebx
push edi
call fcn.0040bfa0
xor ebx, ebx
lea esi, [ebx + 1]
jmp 0x40d79b
xor ebx, ebx
xor edi, edi
lea esi, [ebx + 1]
jmp 0x40d79b
push str.Invalid_data_r_n
call fcn.004027f0
add esp, 4
xor ebx, ebx
xor edi, edi
jmp 0x40d799
push str.GetRequest_Error:_invalid_data_lenght._r_n
push 0x400
push dword [esi + 4]
call fcn.00404b30
add esp, 0xc
push dword [esi + 4]
call fcn.004027f0
add esp, 4
xor ebx, ebx
jmp 0x40d799
push str.GetRequest_Error:_Protocol_error_r_n
push 0x400
push dword [esi + 4]
call fcn.00404b30
add esp, 0xc
push dword [esi + 4]
call fcn.004027f0
add esp, 4
jmp 0x40d799
mov edi, dword [ebp - 0x28]
xor esi, esi
mov eax, dword [ebp - 0x40]
cmp dword [eax + 0x18], 0
je 0x40d7ab
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
test edi, edi
je 0x40d7b8
push edi
call fcn.004168fd
add esp, 4
mov eax, dword [ebp - 0x30]
test eax, eax
je 0x40d7c8
push eax
call fcn.004168fd
add esp, 4
mov eax, dword [ebp - 0x2c]
test eax, eax
je 0x40d7d8
push eax
call fcn.004168fd
add esp, 4
mov eax, dword [ebp - 0x34]
test eax, eax
je 0x40d7e8
push eax
call fcn.004168fd
add esp, 4
test ebx, ebx
je 0x40d7f5
push ebx
call fcn.004168fd
add esp, 4
mov ecx, dword [ebp - 4]
mov eax, esi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004168de
mov esp, ebp
pop ebp
ret 8