Function at 0x502140
Capabilities:
Connect socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xdc
mov eax, dword [0x7b2214]
xor eax, ebp
mov dword [ebp - 4], eax
mov ecx, dword [ebp + 0x10]
mov eax, dword [ebp + 0xc]
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
mov dword [ebp - 0xd8], ecx
mov byte [ebp - 0xc5], 0
mov esi, dword [edi]
mov dword [ecx], 0xffffffff
lea ecx, [ebp - 0xd4]
push ecx
lea ecx, [ebp - 0xc4]
mov dword [ebp - 0xcc], esi
push ecx
push eax
push edi
call fcn.00501880
mov ebx, eax
add esp, 0x10
test ebx, ebx
jne 0x502445
lea eax, [ebp - 0xdc]
push eax
lea eax, [ebp - 0x34]
push eax
lea eax, [ebp - 0xb4]
push eax
call fcn.005020e0
add esp, 0xc
test al, al
jne 0x5021fe
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
push esi
push edi
call fcn.0050ce50
push eax
mov eax, dword [ebp - 0xcc]
push esi
push str.sa_addr_inet_ntop___failed_with_errno__d:__s
push eax
call fcn.00500b70
push dword [ebp - 0xd4]
push edi
call fcn.00501150
add esp, 0x20
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00629f1d
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x34]
push eax
push str.__Trying__s..._n
push esi
call fcn.00500c10
add esp, 0xc
cmp dword [ebp - 0xc4], 2
jne 0x502229
cmp dword [ebp - 0xc0], 1
jne 0x502229
mov eax, 1
jmp 0x50222b
xor eax, eax
mov esi, dword [ebp - 0xd4]
test eax, eax
setne al
mov byte [ebp - 0xcd], al
test al, al
je 0x502259
mov eax, dword [ebp - 0xcc]
cmp byte [eax + 0x2e6], 0
je 0x502259
push esi
push edi
call fcn.00502540
add esp, 8
push esi
call fcn.00501770
mov eax, dword [ebp - 0xcc]
add esp, 4
cmp byte [ebp - 0xcd], 0
je 0x50228a
cmp byte [eax + 0x3dc], 0
je 0x50228a
push esi
push eax
call fcn.00502460
mov eax, dword [ebp - 0xcc]
add esp, 8
mov ecx, dword [eax + 0x198]
test ecx, ecx
je 0x5022ae
push 0
push esi
push dword [eax + 0x19c]
call ecx
add esp, 0xc
cmp eax, 2
jne 0x502302
mov byte [ebp - 0xc5], 1
cmp dword [ebp - 0xc4], 2
jne 0x502326
lea eax, [ebp - 0xb4]
push eax
call fcn.00523300
push eax
push dword [ebp - 0xc4]
push esi
push edi
call fcn.00501bf0
mov ebx, eax
add esp, 0x14
test ebx, ebx
je 0x502326
push esi
push edi
call fcn.00501150
add esp, 8
mov eax, 7
cmp ebx, 1
cmove ebx, eax
pop edi
pop esi
mov eax, ebx
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00629f1d
mov esp, ebp
pop ebp
ret
test eax, eax
je 0x5022ae
push esi
push edi
call fcn.00501150
add esp, 8
mov eax, 0x2a
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00629f1d
mov esp, ebp
pop ebp
ret
push 1
push esi
call fcn.00523310
add esp, 8
call fcn.004f7920
cmp dword [edi + 0x204], 1
mov dword [edi + 0x1fc], eax
mov dword [edi + 0x200], edx
jle 0x502360
push dword [edi + 0x208]
mov eax, dword [ebp - 0xcc]
push eax
call fcn.004f3c50
add esp, 8
cmp byte [ebp - 0xc5], 0
jne 0x50243d
cmp dword [edi + 0x8c], 1
jne 0x50243d
push dword [ebp - 0xb8]
lea eax, [ebp - 0xb4]
push eax
push esi
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x50241e
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [ebp - 0xd4], eax
cmp eax, 0xb
je 0x502401
cmp eax, 0x2732
jle 0x5023b6
cmp eax, 0x2734
jle 0x502401
push eax
push edi
call fcn.0050ce50
mov ebx, dword [ebp - 0xcc]
push eax
lea eax, [ebp - 0x34]
push eax
push str.Immediate_connect_fail_for__s:__s_n
push ebx
call fcn.00500c10
mov eax, dword [ebp - 0xd4]
push esi
push edi
mov dword [ebx + 0x8574], eax
call fcn.00501150
add esp, 0x20
mov ebx, 7
mov eax, ebx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00629f1d
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0xd8]
xor ebx, ebx
pop edi
mov dword [eax], esi
mov eax, ebx
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00629f1d
mov esp, ebp
pop ebp
ret
test ebx, ebx
jne 0x50242a
mov eax, dword [ebp - 0xd8]
mov dword [eax], esi
pop edi
pop esi
mov eax, ebx
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00629f1d
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0xd8]
mov dword [eax], esi
mov ecx, dword [ebp - 4]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00629f1d
mov esp, ebp
pop ebp
ret