Function at 0x4bdf10
Capabilities:
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x14
mov eax, dword [0x53c074]
xor eax, esp
mov dword [esp + 0x10], eax
push ebx
push ebp
push esi
mov esi, ecx
push edi
mov edi, dword [esi + 0x1c]
cmp dword [edi + 0xc], 0
je 0x4be157
mov ecx, dword [esi + 0x60]
test ecx, ecx
jne 0x4bdf86
mov eax, dword [esi + 0x10]
mov ecx, 0x2000016
mov eax, dword [eax + 0x6c]
cmp eax, ecx
cmovb ecx, eax
nop dword [eax + eax]
shr ecx, 1
cmp ecx, 0x80
jb 0x4bdf99
lea eax, [ecx + 7]
and eax, 0xfffffff8
jne 0x4bdf66
test ecx, ecx
jne 0x4bdf50
mov edx, dword [esi + 0x20]
mov ebx, dword [edx + 8]
add eax, ebx
cmp eax, dword [edx + 0xc]
ja 0x4bdf50
cmp eax, ebx
jb 0x4bdf50
mov dword [edx + 8], eax
mov eax, dword [edx]
add eax, ebx
je 0x4bdf50
mov dword [esi + 0x60], ecx
mov dword [esi + 0x40], eax
cmp dword [edi + 0x38], 0
jne 0x4bdfd4
cmp dword [edi + 0x3c], 0
jne 0x4bdfd4
xor ebx, ebx
jmp 0x4be070
lea eax, [edi + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push str.Closing_connection__out_of_memory__n
push dword [esi + 0x10]
call fcn.004c1e90
add esp, 8
mov edx, 1
mov ecx, esi
call fcn.004bdd20
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x10]
xor ecx, esp
call fcn.004c3717
add esp, 0x14
ret
mov eax, dword [edi + 0x44]
mov edx, dword [esi + 0x78]
cmp eax, dword [esi + 0x7c]
ja 0x4be026
jb 0x4bdfe6
cmp dword [edi + 0x40], edx
ja 0x4be026
mov ebp, dword [edi + 0x50]
xor eax, eax
mov ebx, ebp
add ebx, dword [edi + 0x40]
adc eax, dword [edi + 0x44]
cmp eax, dword [esi + 0x7c]
jb 0x4be026
ja 0x4bdffe
cmp ebx, edx
jbe 0x4be026
sub edx, dword [edi + 0x40]
lea eax, [ecx - 0xc]
sub ebp, edx
lea ebx, [ecx - 0xc]
cmp ebp, eax
mov eax, dword [edi + 4]
cmovbe ebx, ebp
add eax, edx
push ebx
push eax
mov eax, dword [esi + 0x40]
add eax, 0xa
push eax
call fcn.004c5650
add esp, 0xc
jmp 0x4be042
lea eax, [ecx - 0xc]
push eax
mov eax, dword [esi + 0x40]
add eax, 0xa
push eax
push dword [esi + 0x7c]
mov eax, dword [edi + 0xc]
push edx
push dword [edi + 8]
call eax
add esp, 0x14
mov ebx, eax
cmp ebx, 0xfffffffe
jne 0x4be067
mov eax, dword [esi + 0x78]
mov dword [edi + 0x38], eax
mov eax, dword [esi + 0x7c]
mov dword [edi + 0x3c], eax
lea eax, [edi + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push str.Closing_connection__application_error_generating_response__n
jmp 0x4bdfa8
cmp ebx, 0xffffffff
je 0x4be134
cmp dword [edi + 0x38], 0
jne 0x4be080
cmp dword [edi + 0x3c], 0
je 0x4be134
test ebx, ebx
jne 0x4be0ad
lea eax, [edi + 0x1c]
mov dword [esi + 0xac], 0xf
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x10]
xor ecx, esp
call fcn.004c3717
add esp, 0x14
ret
mov eax, 0xffffff
cmp ebx, eax
cmovg ebx, eax
lea eax, [esp + 0x14]
push ebx
push str._X_r_n
push 0xa
push eax
call fcn.00401160
mov edi, eax
add esp, 0x10
test edi, edi
jle 0x4be16f
cmp edi, 0xa
jb 0x4be0f4
push str._size_t_cblen___sizeof_cbuf_
push 0x4d1
push 0x542d9c
push 0x542d6c
jmp 0x4be183
push edi
lea eax, [esp + 0x18]
push eax
mov eax, dword [esi + 0x40]
sub eax, edi
add eax, 0xa
push eax
call fcn.004c5650
mov ax, word [0x542d68]
add esp, 0xc
mov ecx, dword [esi + 0x40]
mov word [ecx + ebx + 0xa], ax
mov eax, ebx
cdq
add dword [esi + 0x78], eax
mov eax, 0xa
adc dword [esi + 0x7c], edx
sub eax, edi
mov dword [esi + 0x64], eax
lea eax, [ebx + 0xc]
mov dword [esi + 0x68], eax
jmp 0x4be157
mov eax, dword [esi + 0x40]
mov dword [eax], 0xa0d30
mov eax, dword [esi + 0x78]
mov dword [esi + 0x68], 3
mov dword [esi + 0x64], 0
mov dword [edi + 0x38], eax
mov eax, dword [esi + 0x7c]
mov dword [edi + 0x3c], eax
mov ecx, dword [esp + 0x20]
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.004c3717
add esp, 0x14
ret
push str.cblen___0
push 0x4d0
push 0x542e28
push 0x542df8
push 2
call fcn.004cb8fa
add esp, 4
push eax
call fcn.004038b0
add esp, 0x14
push 2
call fcn.004cb8fa
add esp, 4
push eax
call fcn.004cd32e
add esp, 4
call fcn.004cebb9
int3