Function at 0x419880
Capabilities:
Connect socket
Resolve dns

Disassembly:
push ebp
mov eax, 0x4b87d0
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x3c
call fcn.004169f0
test eax, eax
mov ebx, eax
je 0x419a0b
mov eax, dword [0x4f3454]
test eax, eax
je 0x419a21
mov eax, dword [ebp + 8]
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_gethostbyname]
sub esp, 4
test eax, eax
mov esi, eax
je 0x419a04
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x1c], 0
movzx eax, word [eax + 8]
mov word [ebp - 0x28], ax
movzx eax, word [ebp + 0xc]
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_htons]
mov edx, dword [esi + 0xc]
movsx ecx, word [esi + 0xa]
mov word [ebp - 0x26], ax
mov edx, dword [edx]
sub esp, 4
lea eax, [ebp - 0x24]
mov dword [esp + 8], ecx
mov dword [esp], eax
mov dword [esp + 4], edx
call sub.msvcrt.dll_memcpy
mov eax, dword [ebp + 0x10]
mov dword [esp + 8], 0
mov dword [esp + 4], eax
movsx eax, word [esi + 8]
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_socket]
sub esp, 0xc
cmp eax, 0xffffffff
je 0x419a04
lea edi, [ebp - 0x28]
mov dword [ebx + 0xc], eax
mov dword [esp + 8], 0x10
mov dword [esp + 4], edi
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_connect]
sub esp, 0xc
test eax, eax
js 0x419a04
mov esi, dword [ebx + 4]
mov edx, 0x4b77f9
mov eax, str.udp:
cmp dword [ebp + 0x10], 1
cmove eax, edx
test esi, esi
mov edx, 0xffffffff
je 0x4199a6
cmp ebx, 0x4f3460
jb 0x4199a6
cmp ebx, 0x4f5060
jae 0x4199a6
mov edx, ebx
sub edx, 0x4f3460
sar edx, 3
imul edx, edx, 0xb6db6db7
add edx, 0x64
mov edi, dword [ebp + 0xc]
mov dword [esp + 0x10], eax
lea eax, [ebx + 0x18]
mov dword [esp + 0xc], edx
mov dword [esp + 8], str._d_net_client:_s_d_
mov dword [esp + 0x14], edi
mov dword [esp + 4], 0x20
mov dword [esp], eax
call fcn.0049fc60
test byte [0x4f3060], 0x80
jne 0x419a30
mov eax, dword [ebx + 4]
test eax, eax
je 0x419a0b
cmp ebx, 0x4f3460
jb 0x419a0b
cmp ebx, 0x4f5060
jae 0x419a0b
sub ebx, 0x4f3460
sar ebx, 3
imul ebx, ebx, 0xb6db6db7
lea eax, [ebx + 0x64]
jmp 0x419a10
mov edi, dword [ebx + 4]
test edi, edi
jne 0x419a18
mov eax, 0xffffffff
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, ebx
call fcn.00416160
jmp 0x419a0b
call fcn.004163e0
jmp 0x4198aa
mov esi, dword [sym.imp.msvcrt.dll__errno]
call esi
mov edi, dword [eax]
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
sub esp, 4
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [ebp - 0x2c], eax
call sub.msvcrt.dll__getpid
mov edx, dword [ebp - 0x2c]
mov dword [esp + 8], str.socket_network_client
mov dword [esp + 4], 0x4b7278
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
call esi
mov edx, 0xffffffff
mov dword [eax], edi
mov ecx, dword [ebx + 4]
test ecx, ecx
je 0x419ab6
cmp ebx, 0x4f3460
jb 0x419ab6
cmp ebx, 0x4f5060
jae 0x419ab6
mov eax, ebx
sub eax, 0x4f3460
sar eax, 3
imul eax, eax, 0xb6db6db7
lea edx, [eax + 0x64]
cmp dword [ebp + 0x10], 1
mov ecx, 0x4b77f0
mov eax, 0x4b77ec
mov dword [esp + 0x14], edx
cmove eax, ecx
mov dword [esp + 0x10], eax
mov eax, dword [ebp + 0xc]
mov dword [esp + 4], str.socket_network_client:_host__s_port__d_type__s___fd__d_n
mov dword [esp + 0xc], eax
mov eax, dword [ebp + 8]
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
sub esp, 4
call esi
mov dword [eax], edi
jmp 0x4199d9