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

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x1a8
mov edi, dword [esp + 0x1bc]
call 0x4c16e6
pop ebp
mov bl, 0x10
test edi, edi
je 0x4c1bb4
mov bh, byte [edx]
mov al, bh
not al
test al, 0x1f
sete al
cmp edi, 1
sete ah
or ah, al
jne 0x4c1bb4
movsx eax, byte [edx + 1]
test eax, eax
js 0x4c1904
mov esi, 2
cmp bh, 0x30
jne 0x4c1bb4
mov dword [esp + 0xc], ebp
lea ebp, [eax + esi]
cmp ebp, edi
mov dword [esp + 0x10], ebp
ja 0x4c1bb4
add esi, edx
mov bh, 0x1a
test eax, eax
mov dword [esp + 0x2c], esi
mov dword [esp + 0x30], eax
je 0x4c1bb2
mov bl, byte [esi]
mov byte [esp], bl
not bl
test bl, 0x1f
je 0x4c1bb2
cmp eax, 1
je 0x4c1bb2
movsx ebx, byte [esi + 1]
test ebx, ebx
js 0x4c1a21
mov ebp, 2
mov dword [esp + 4], ebx
mov bl, 0x10
mov bh, 0x1a
mov edi, dword [esp + 4]
mov dword [esp + 8], ebp
add edi, ebp
cmp edi, eax
ja 0x4c1bb2
cmp byte [esp], 0x30
mov dword [esp + 0x34], edi
jne 0x4c1bb2
mov dword [esp + 0x18], edx
mov dword [esp], ecx
mov dword [esp + 0xb4], edi
lea ecx, [esp + 0xc0]
lea edx, [esp + 0x2c]
push 0x30
call fcn.004c0d80
add esp, 4
mov edi, dword [esp + 0xc0]
test edi, edi
je 0x4c1a91
mov eax, dword [esp + 0xc4]
lea ecx, [esp + 0xc0]
lea edx, [esp + 0x2c]
mov dword [esp + 0x28], eax
call fcn.004c2880
mov edx, dword [esp + 0xc0]
test edx, edx
je 0x4c1a91
mov eax, dword [esp + 0x34]
mov ecx, dword [esp]
cmp eax, dword [esp + 0x30]
mov eax, dword [esp + 0x1bc]
jne 0x4c1bb4
cmp dword [esp + 0x10], eax
mov bl, 2
jne 0x4c1bb4
mov ebx, dword [esp + 8]
mov eax, dword [esp + 0xc4]
add ebx, esi
mov dword [esp + 0x10], eax
mov ah, 0x39
mov dword [esp + 8], ebx
mov dword [esp + 0x1c], ebx
mov ebx, dword [esp + 4]
test ebx, ebx
mov dword [esp + 0x20], ebx
je 0x4c1d85
cmp ebx, 1
mov dword [esp + 0xb0], edx
je 0x4c1d85
mov ebx, dword [esp + 8]
mov al, byte [ebx]
mov edx, eax
and dl, 0x1f
cmp dl, 0x1f
je 0x4c1d85
movsx ecx, byte [ebx + 1]
mov dword [esp + 0x14], esi
test ecx, ecx
js 0x4c1bcc
mov edx, 2
lea esi, [ecx + edx]
cmp esi, dword [esp + 4]
ja 0x4c1ce2
cmp al, 0xa0
mov dword [esp + 0x24], esi
jne 0x4c1ce2
mov eax, dword [esp + 8]
add eax, edx
lea edx, [esp + 0x2c]
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], ecx
lea ecx, [esp + 0xb8]
mov dword [esp + 0x34], 0
push 2
call fcn.004c0d80
add esp, 4
mov ecx, dword [esp + 0xb8]
test ecx, ecx
je 0x4c1ced
mov esi, dword [esp + 0xbc]
mov al, 0x1a
test esi, esi
je 0x4c1d9f
movzx edx, byte [ecx]
test dl, dl
je 0x4c1d8d
js 0x4c1d9f
cmp esi, 1
je 0x4c1cf5
jmp 0x4c1d9f
movzx eax, al
add eax, 0xffffff7f
cmp eax, 3
ja 0x4c1bb4
mov eax, dword [eax*4 + 0x4c207c]
add eax, ebp
jmp eax
mov edi, dword [esp + 0xc]
mov dword [esp + 0x14], esi
movzx esi, bl
mov bl, 0x10
add esi, 0xffffff7f
cmp esi, 3
ja 0x4c1bc8
mov esi, dword [esi*4 + 0x4c208c]
add esi, edi
jmp esi
mov bh, byte [esp + 0xc4]
mov ecx, dword [esp]
jmp 0x4c1bb2
mov bl, bh
mov byte [ecx + 4], bl
mov dword [ecx], reloc.WS2_32.dll_accept
add esp, 0x1a8
pop esi
pop edi
pop ebx
pop ebp
ret
mov bl, 0x1a
jmp 0x4c1bb4
movzx ecx, cl
add ecx, 0xffffff7f
cmp ecx, 3
ja 0x4c1ce2
mov edx, dword [esp + 0xc]
add edx, dword [ecx*4 + 0x4c209c]
jmp edx
mov ecx, dword [esp]
mov byte [ecx + 4], ah
jmp 0x4c1bb7
movzx edx, byte [esp + 0xbc]
cmp dl, 2
mov eax, 0x46
mov esi, 0x39
cmove esi, eax
test ecx, ecx
movzx eax, dl
cmovne eax, esi
cmp al, 0x46
jne 0x4c1d9f
mov eax, dword [esp + 0x34]
mov ecx, dword [esp]
cmp eax, dword [esp + 0x30]
mov ah, 0x39
jne 0x4c1d85
lea ecx, [esp + 0x2c]
lea edx, [esp + 0x1c]
push 2
call fcn.004c0d80
add esp, 4
mov esi, dword [esp + 0x2c]
test esi, esi
je 0x4c1f66
mov ebp, dword [esp + 0x30]
lea ecx, [esp + 0x2c]
lea edx, [esp + 0x1c]
push 0x30
call fcn.004c0d80
add esp, 4
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x4c1f66
mov ecx, dword [esp + 0x28]
cmp dword [esp + 0x30], ecx
jne 0x4c1daa
push dword [esp + 0x28]
push edi
push eax
call sub.VCRUNTIME140.dll_memcmp
add esp, 0xc
mov ecx, dword [esp]
test eax, eax
mov ah, 0x35
je 0x4c1db7
mov byte [ecx + 4], ah
jmp 0x4c1bb7
dec esi
je 0x4c1d9d
movzx edx, byte [ecx + 1]
test dl, dl
jns 0x4c1d9f
jmp 0x4c18f6
mov al, 0x39
mov ecx, dword [esp]
mov byte [ecx + 4], al
jmp 0x4c1bb7
mov ecx, dword [esp]
mov ah, 0x35
mov byte [ecx + 4], ah
jmp 0x4c1bb7
lea ecx, [esp + 0x2c]
lea edx, [esp + 0x1c]
push 0x30
call fcn.004c0d80
add esp, 4
mov ebx, dword [esp + 0x2c]
test ebx, ebx
je 0x4c1f66
mov eax, dword [esp + 0x30]
lea ecx, [esp + 0x2c]
lea edx, [esp + 0x1c]
mov dword [esp + 0xc], eax
push 0x30
call fcn.004c0d80
add esp, 4
mov eax, dword [esp + 0x2c]
test eax, eax
mov dword [esp + 4], eax
je 0x4c1f66
mov eax, dword [esp + 0x30]
lea ecx, [esp + 0x2c]
lea edx, [esp + 0x1c]
mov dword [esp + 8], eax
push 0x30
call fcn.004c0d80
add esp, 4
mov eax, dword [esp + 0x2c]
test eax, eax
mov dword [esp + 0xac], eax
je 0x4c1f66
mov eax, dword [esp + 0x30]
lea ecx, [esp + 0x2c]
lea edx, [esp + 0x1c]
mov dword [esp + 0xa8], eax
push 0x30
call fcn.004c0d80
add esp, 4
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x4c1f66
mov edx, dword [esp + 0x14]
mov ecx, dword [esp + 0x30]
mov dword [esp + 0x38], esi
mov dword [esp + 0x3c], ebp
mov esi, dword [esp + 0x24]
mov dword [esp + 0x40], edx
mov edx, dword [esp + 0xb4]
cmp esi, dword [esp + 0x20]
mov dword [esp + 0x44], edx
mov edx, dword [esp + 0x28]
mov dword [esp + 0x48], edi
lea edi, [esp + 0x34]
mov dword [esp + 0x4c], edx
mov edx, dword [esp + 0xb0]
mov dword [esp + 0x50], edx
mov edx, dword [esp + 0x10]
mov dword [esp + 0x54], edx
mov edx, dword [esp + 0xc]
mov dword [esp + 0x58], ebx
mov dword [esp + 0x5c], edx
mov edx, dword [esp + 4]
mov dword [esp + 0x60], edx
mov edx, dword [esp + 8]
mov dword [esp + 0x64], edx
mov edx, dword [esp + 0xac]
mov dword [esp + 0x68], edx
mov edx, dword [esp + 0xa8]
mov dword [esp + 0x6c], edx
mov dword [esp + 0x70], eax
mov dword [esp + 0x74], ecx
mov edx, dword [esp + 0x18]
mov ecx, dword [esp + 0x1bc]
mov dword [esp + 0x78], 0
mov dword [esp + 0x80], 0
mov dword [esp + 0x88], 0
mov dword [esp + 0x90], 0
mov dword [esp + 0x98], 0
mov dword [esp + 0xa0], 0
mov dword [esp + 0x2c], getsockopt
mov dword [esp + 0x30], edx
mov dword [esp + 0x34], ecx
jne 0x4c1f75
mov ebp, dword [esp + 0x18]
mov ebx, ebp
shr ebx, 8
push 0x74
push edi
lea eax, [esp + 0xc8]
push eax
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
mov eax, ebp
mov dword [esp + 0xc], getsockopt
mov edi, esi
mov byte [esp + 0x10], al
jmp 0x4c2000
mov ah, byte [esp + 0x30]
mov ecx, dword [esp]
mov byte [ecx + 4], ah
jmp 0x4c1bb7
lea ecx, [esp + 0x1c]
lea edx, [esp + 0x2c]
call fcn.004c20b0
mov ecx, dword [esp + 0x2c]
mov ebx, eax
cmp al, 0x46
mov dword [esp + 0xc], ecx
jne 0x4c1fcf
movzx eax, byte [esp + 0x30]
movzx esi, byte [esp + 0x33]
movzx ebx, word [esp + 0x31]
mov byte [esp + 0x10], al
push 0x74
push edi
lea eax, [esp + 0xc8]
push eax
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
cmp dword [esp + 0xc], 0x80000001
jne 0x4c1ff3
mov ecx, dword [esp]
mov ah, byte [esp + 0x10]
mov byte [ecx + 4], ah
jmp 0x4c1bb7
test dword [esp + 0xc], 0x7fffffff
je 0x4c1feb
push dword [esp + 0x30]
push 0
push dword [0x623140]
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov ecx, dword [esp]
jmp 0x4c1bb4
shl esi, 0x10
mov edi, dword [esp + 0x24]
or ebx, esi
mov esi, dword [esp + 0x20]
lea eax, [esp + 0x134]
push 0x74
lea ecx, [esp + 0xc4]
push ecx
push eax
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
movzx eax, byte [esp + 0x10]
shl ebx, 8
or ebx, eax
cmp edi, esi
jne 0x4c204a
mov eax, dword [esp]
lea esi, [esp + 0x134]
mov ecx, 0x1d
lea edi, [eax + 8]
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [esp + 0xc]
mov dword [eax], ecx
mov dword [eax + 4], ebx
jmp 0x4c1bbd
mov eax, dword [esp]
test dword [esp + 0xc], 0x7fffffff
mov byte [eax + 4], 4
mov dword [eax], reloc.WS2_32.dll_accept
je 0x4c1bbd
push ebx
push 0
push dword [0x623140]
call dword [sym.imp.KERNEL32.dll_HeapFree]
jmp 0x4c1bbd