Function at 0x417250
Capabilities:
Connect socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
push ebx
push esi
mov esi, dword [ebp + 8]
mov eax, ecx
mov ecx, dword [esi + 0x24]
xor ebx, ebx
cmp ecx, ebx
push edi
mov dword [ebp - 4], eax
jne 0x4172e6
add eax, 0x518
mov dword [ebp - 0x18], eax
add eax, 0x10
push eax
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0xc], ebx
mov dword [ebp - 8], ebx
call dword [sym.imp.kernel32.dll_EnterCriticalSection]
mov ecx, dword [ebp - 0x14]
cmp ecx, ebx
jne 0x41729a
lea ecx, [ebp - 0x18]
call fcn.0041d8d0
mov ecx, dword [ebp - 0x14]
cmp ecx, ebx
mov dword [ebp - 0xc], ecx
mov edi, ecx
je 0x4172d2
mov eax, dword [ecx]
call dword [eax + 4]
test eax, eax
jne 0x4172b4
mov ecx, dword [edi + 0x10]
cmp ecx, dword [esi + 0x20]
je 0x4172cc
lea ecx, [ebp - 0x18]
call fcn.0041d8d0
mov ecx, dword [ebp - 0x14]
cmp ecx, dword [ebp - 0xc]
je 0x4172d2
cmp ecx, ebx
mov edi, ecx
jne 0x4172a3
jmp 0x4172d2
mov edx, dword [edi + 0x14]
mov dword [esi + 0x24], edx
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 0x18]
lea eax, [eax + eax*2]
lea eax, [ecx + eax*8 + 0x10]
push eax
call dword [sym.imp.kernel32.dll_LeaveCriticalSection]
cmp dword [esi + 0x24], ebx
jne 0x417328
mov eax, dword [esi + 0x14]
cmp eax, ebx
mov dword [esi], 0x44b73c
je 0x417309
push ebx
push 0x3a3
push str.E:Drive1_temp_buildwar3xengineSourceOsW32OsTcp.cpp
push eax
call sub.storm.dll_Ordinal_403
lea ecx, [esi + 8]
call fcn.0041d450
push ebx
push 0xffffffffffffffff
push 0x452480
push esi
call sub.storm.dll_Ordinal_403
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
push ebx
mov edi, 1
push edi
push 2
call dword [sym.imp.wsock32.dll_socket]
cmp eax, 0xffffffff
mov dword [esi + 4], eax
je 0x4173b7
lea edx, [ebp + 8]
push edx
push 0x8004667e
push eax
mov dword [ebp + 8], edi
call dword [sym.imp.wsock32.dll_ioctlsocket]
xor ecx, ecx
mov cx, word [esi + 0x20]
xor eax, eax
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x10], eax
mov dword [ebp - 0xc], eax
mov dword [ebp - 8], eax
mov word [ebp - 0x14], 2
push ecx
call dword [sym.imp.wsock32.dll_htons]
mov ecx, dword [esi + 4]
mov edx, dword [esi + 0x1c]
mov word [ebp - 0x12], ax
push 0x10
lea eax, [ebp - 0x14]
push eax
push ecx
mov dword [ebp - 0x10], edx
call dword [sym.imp.wsock32.dll_connect]
cmp eax, 0xffffffff
jne 0x4173b7
call dword [sym.imp.wsock32.dll_WSAGetLastError]
cmp eax, 0x2733
je 0x4173b2
mov edx, dword [esi + 4]
push edx
call dword [sym.imp.wsock32.dll_closesocket]
mov dword [esi + 4], 0xffffffff
jmp 0x4173b7
mov edi, 2
mov ecx, dword [ebp - 4]
lea eax, [edi + edi*2]
shl eax, 4
lea edi, [eax + ecx + 0x558]
lea edx, [edi + 0x28]
push edx
call dword [sym.imp.kernel32.dll_InterlockedIncrement]
lea eax, [edi + 0x10]
push eax
call dword [sym.imp.kernel32.dll_EnterCriticalSection]
lea ecx, [edi + 4]
push esi
call fcn.0041d970
mov ebx, eax
cmp dword [ebx], 0
je 0x4173f2
mov ecx, ebx
call fcn.0041d450
mov eax, dword [edi + 8]
mov dword [ebx], eax
mov ecx, dword [eax + 4]
mov dword [ebx + 4], ecx
mov dword [eax + 4], esi
lea eax, [edi + 0x10]
push eax
mov dword [edi + 8], ebx
call dword [sym.imp.kernel32.dll_LeaveCriticalSection]
add edi, 0x2c
push edi
call dword [sym.imp.kernel32.dll_InterlockedIncrement]
mov edx, dword [ebp - 4]
mov eax, dword [edx + 0x54c]
push eax
call dword [sym.imp.kernel32.dll_SetEvent]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4