Function at 0x40245e
Capabilities:
Connect socket
Get local ipv4 addresses
Get socket information
Get socket status

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1b8
push ebx
lea eax, [ebp - 2]
push esi
push edi
push eax
mov esi, dword [ebp + 8]
mov ecx, esi
call fcn.00405708
test eax, eax
je 0x402895
push 2
mov ecx, esi
call fcn.004056a1
push 2
lea eax, [ebp - 0x94]
push eax
mov ecx, esi
call fcn.00405770
movzx eax, word [ebp - 0x94]
push eax
mov ecx, esi
call fcn.00405692
push 4
lea eax, [ebp - 0x94]
push eax
mov ecx, esi
call fcn.00405770
push dword [ebp - 0x94]
call sub.WSOCK32.dll_ntohl
mov byte [ebp - 1], 1
mov edi, eax
cmp byte [ebp - 1], 0
je 0x4024e3
lea eax, [ebp - 1]
mov ecx, esi
push eax
call fcn.00405708
test eax, eax
jne 0x4024c9
jmp 0x402895
xor ebx, ebx
test edi, edi
je 0x402555
cmp edi, 0x100
jae 0x402555
mov dword [ebp - 8], ebx
lea edi, [ebp + ebx - 0x88]
mov ecx, esi
push edi
call fcn.0040573c
test eax, eax
je 0x402895
cmp byte [edi], 0
je 0x402518
inc ebx
cmp ebx, 0x7f
jb 0x4024f4
jmp 0x40251f
mov dword [ebp - 8], 1
mov byte [ebp + ebx - 0x88], 0
cmp dword [ebp - 8], 0
je 0x402895
lea eax, [ebp - 0x88]
mov ecx, esi
push eax
call fcn.00405630
test eax, eax
jne 0x402565
push 0
mov ecx, esi
push 0
push 0x5b
call fcn.004057c8
jmp 0x402895
push 4
lea eax, [ebp - 0x94]
push eax
mov ecx, esi
call fcn.0040561d
movzx eax, byte [ebp - 2]
push eax
mov ecx, esi
call fcn.00405a0e
push esi
mov ecx, esi
call fcn.00405855
push eax
call fcn.00404d21
add esp, 8
test eax, eax
je 0x402895
movzx eax, byte [ebp - 2]
cmp eax, 1
je 0x4025ae
cmp eax, 2
je 0x402679
push 0
mov ecx, esi
push 0
push 0x5b
call fcn.004057c8
jmp 0x402895
lea eax, [ebp - 0x8c]
lea ecx, [ebp - 8]
push eax
push ecx
mov ecx, esi
call fcn.0040560a
push 0
mov ecx, dword [ebp - 8]
movzx edx, word [ecx]
push 1
push edx
call sub.WSOCK32.dll_socket
push dword [ebp - 0x8c]
push dword [ebp - 8]
push eax
mov edi, eax
call sub.WSOCK32.dll_connect
test eax, eax
je 0x402609
push 0
mov ecx, esi
push 0
push 0x5b
call fcn.004057c8
push dword [ebp - 8]
call dword [sym.imp.MSVCRT20.dll_free]
add esp, 4
push edi
call sub.WSOCK32.dll_closesocket
jmp 0x402895
push dword [ebp - 8]
call dword [sym.imp.MSVCRT20.dll_free]
add esp, 4
lea ecx, [ebp - 0x88]
mov dword [ebp - 0x88], 0x10
push ecx
lea eax, [ebp - 0xa4]
push eax
push edi
call sub.WSOCK32.dll_getsockname
test eax, eax
jne 0x402645
push dword [ebp - 0xa2]
push dword [ebp - 0xa0]
jmp 0x402649
push 0
push 0
push 0x5a
mov ecx, esi
call fcn.004057c8
push 0
push 1
push 0
push esi
call fcn.0040320d
add esp, 0x10
mov ecx, esi
push edi
call fcn.00405859
push edi
call sub.WSOCK32.dll_closesocket
mov eax, 1
jmp 0x402897
lea eax, [ebp - 0x8c]
lea ecx, [ebp - 8]
push eax
push ecx
mov ecx, esi
call fcn.0040560a
test eax, eax
je 0x402895
push 0
mov eax, dword [ebp - 8]
push 1
mov edi, 0x10
movzx ecx, word [eax]
push ecx
call sub.WSOCK32.dll_socket
mov ebx, eax
push edi
push 0
lea eax, [ebp - 0xb4]
push eax
call sub.MSVCRT20.dll_memset
add esp, 0xc
mov eax, dword [ebp - 8]
mov ax, word [eax]
push edi
mov word [ebp - 0xb4], ax
mov dword [ebp - 0x88], edi
lea eax, [ebp - 0xb4]
push eax
push ebx
call sub.WSOCK32.dll_bind
test eax, eax
jne 0x402876
push 2
push ebx
call sub.WSOCK32.dll_listen
test eax, eax
jne 0x402876
lea eax, [ebp - 0x88]
lea ecx, [ebp - 0xb4]
push eax
mov dword [ebp - 0x88], edi
push ecx
push ebx
call sub.WSOCK32.dll_getsockname
test eax, eax
jne 0x402721
push dword [ebp - 0xb2]
push dword [ebp - 0xb0]
jmp 0x402725
push 0
push 0
push 0x5a
mov ecx, esi
call fcn.004057c8
mov ecx, esi
call fcn.0040584e
cmp eax, ebx
mov edi, eax
jae 0x40273d
mov edi, ebx
mov dword [ebp - 0x1b8], 0
mov dword [ebp - 0x1b4], ebx
inc dword [ebp - 0x1b8]
cmp dword [ebp - 0x1b8], 0x40
jae 0x402776
mov ecx, esi
call fcn.0040584e
mov ecx, dword [ebp - 0x1b8]
mov dword [ebp + ecx*4 - 0x1b4], eax
inc dword [ebp - 0x1b8]
mov ecx, esi
call fcn.00405855
push eax
call fcn.00404d3d
add esp, 4
mov dword [ebp - 0xa4], eax
lea eax, [ebp - 0xa4]
lea ecx, [ebp - 0x1b8]
push eax
inc edi
mov dword [ebp - 0xa0], 0
push 0
push 0
push ecx
push edi
call sub.WSOCK32.dll_select
lea ecx, [ebp - 0x1b8]
push ecx
push ebx
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
je 0x402876
lea eax, [ebp - 0x88]
lea ecx, [ebp - 0xb4]
push eax
push ecx
push ebx
call sub.WSOCK32.dll_accept
mov edi, eax
push ebx
call sub.WSOCK32.dll_closesocket
mov cx, word [ebp - 0xb4]
mov eax, dword [ebp - 8]
cmp word [eax], cx
jne 0x402861
mov eax, dword [eax + 4]
test eax, eax
je 0x4027fe
cmp dword [ebp - 0xb0], eax
jne 0x402861
push dword [ebp - 8]
call dword [sym.imp.MSVCRT20.dll_free]
add esp, 4
lea ecx, [ebp - 0x88]
lea eax, [ebp - 0xb4]
push ecx
push eax
push edi
call sub.WSOCK32.dll_getsockname
test eax, eax
jne 0x402830
push dword [ebp - 0xb2]
push dword [ebp - 0xb0]
jmp 0x402834
push 0
push 0
push 0x5a
mov ecx, esi
call fcn.004057c8
push 0
push 1
push 0
push esi
call fcn.0040320d
add esp, 0x10
mov ecx, esi
push edi
call fcn.00405859
push edi
call sub.WSOCK32.dll_closesocket
mov eax, 1
jmp 0x402897
push 0
mov ecx, esi
push 0
push 0x5b
call fcn.004057c8
push edi
call sub.WSOCK32.dll_closesocket
jmp 0x402889
push ebx
call sub.WSOCK32.dll_closesocket
push 0
mov ecx, esi
push 0
push 0x5b
call fcn.004057c8
push dword [ebp - 8]
call dword [sym.imp.MSVCRT20.dll_free]
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret