Function at 0x412100
Capabilities:
Connect socket
Set socket configuration

Disassembly:
sub esp, 0x18
mov eax, dword [0x437070]
xor eax, esp
mov dword [esp + 0x14], eax
push ebx
mov bx, word [esp + 0x24]
push ebp
mov ebp, dword [esp + 0x38]
push edi
mov edi, dword [esp + 0x28]
mov dword [ebp], 0xffffffff
cmp dword [edi], 4
mov dword [esp + 0xc], 1
je 0x412156
push str.ERROR:_mDNSPlatformTCPConnect___attempt_to_connect_to_an_IPv6_address:_operation_not_supported
call fcn.00410870
add esp, 4
pop edi
pop ebp
mov eax, 0xfffeffff
pop ebx
mov ecx, dword [esp + 0x14]
xor ecx, esp
call fcn.00423888
add esp, 0x18
ret
push esi
push 0x18
call fcn.004236b5
mov esi, eax
add esp, 4
test esi, esi
jne 0x412181
mov edi, 0xfffefffd
pop esi
mov eax, edi
pop edi
pop ebp
pop ebx
mov ecx, dword [esp + 0x14]
xor ecx, esp
call fcn.00423888
add esp, 0x18
ret
mov ecx, dword [esp + 0x3c]
xor eax, eax
mov dword [esi + 4], eax
mov dword [esi + 0x10], eax
mov dword [esi + 0x14], eax
mov eax, dword [esp + 0x38]
mov dword [esi + 8], eax
xor eax, eax
mov dword [esi], 0xffffffff
mov dword [esi + 0xc], ecx
mov edx, dword [edi + 4]
push eax
push 1
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], eax
push 2
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], eax
mov word [esp + 0x20], 2
mov word [esp + 0x22], bx
mov dword [esp + 0x24], edx
call dword [sym.imp.WS2_32.dll_socket]
cmp eax, 0xffffffff
mov ebx, dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [esi], eax
jne 0x4121ef
call ebx
test eax, eax
je 0x412272
call ebx
mov edi, eax
test edi, edi
jne 0x412238
mov ecx, dword [esi]
lea eax, [esp + 0x10]
push eax
push 0x8004667e
push ecx
call dword [sym.imp.WS2_32.dll_ioctlsocket]
test eax, eax
je 0x412214
call ebx
test eax, eax
je 0x412272
call ebx
mov edi, eax
test edi, edi
jne 0x412238
mov eax, dword [esi]
push 0x10
lea edx, [esp + 0x18]
push edx
push eax
call dword [sym.imp.WS2_32.dll_connect]
mov edi, eax
test edi, edi
je 0x412279
call ebx
cmp eax, 0x2733
je 0x412279
mov edi, 0xfffeff04
mov eax, dword [esi + 0x10]
test eax, eax
je 0x412246
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esi]
cmp eax, 0xffffffff
je 0x412254
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
push esi
call fcn.004237fa
add esp, 4
pop esi
mov eax, edi
pop edi
pop ebp
pop ebx
mov ecx, dword [esp + 0x14]
xor ecx, esp
call fcn.00423888
add esp, 0x18
ret
mov edi, 0xfffeffff
jmp 0x412238
xor ecx, ecx
test edi, edi
push 0
sete cl
push 0
push 0
push 0
mov dword [esi + 4], ecx
call dword [sym.imp.KERNEL32.dll_CreateEventW]
test eax, eax
mov dword [esi + 0x10], eax
jne 0x4122ac
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
call edi
test eax, eax
je 0x412272
call edi
mov edi, eax
test edi, edi
jne 0x412238
mov edx, dword [esi + 0x10]
mov eax, dword [esi]
push 0x31
push edx
push eax
call dword [sym.imp.WS2_32.dll_WSAEventSelect]
mov edi, eax
test edi, edi
jne 0x412238
mov ecx, dword [0x4389c4]
mov edx, dword [esi]
mov eax, 1
add dword [0x4389c8], eax
mov dword [esi + 0x14], ecx
mov ecx, dword [esp + 0x24]
mov dword [0x4389d4], eax
xor eax, eax
mov dword [ebp], edx
cmp dword [esi + 4], eax
mov dword [0x4389c4], esi
sete al
pop esi
lea eax, [eax + eax - 0x100fd]
mov edi, eax
pop edi
pop ebp
pop ebx
xor ecx, esp
call fcn.00423888
add esp, 0x18
ret