Function at 0x40a380
Capabilities:
Connect socket
Get local ipv4 addresses
Get socket information
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
sub esp, 0x478
push ebx
push esi
push edi
push ebp
push 0x3e8
push 2
push 6
call fcn.00409ce0
mov dword [esp + 0x1c], eax
add esp, 0xc
cmp eax, 0xffffffff
jne 0x40a3b4
mov eax, 0x3f
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x478
ret
mov eax, dword [esp + 0x10]
push eax
call fcn.0040a290
add esp, 4
push 1
call fcn.0040a280
push eax
call fcn.0040b930
add esp, 8
cmp eax, 0xffffffff
jne 0x40a3e6
mov eax, 0x41
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x478
ret
cmp dword [0x4251ec], 0
je 0x40a4c4
push 0x426d98
call fcn.00405750
add esp, 4
push 0xe
call fcn.00413664
add esp, 4
mov esi, eax
test esi, esi
jne 0x40a43a
push 0
call fcn.0040a280
push eax
call fcn.0040b930
mov eax, dword [esp + 0x18]
add esp, 8
push eax
call sub.WSOCK32.dll_closesocket
mov eax, 0x40
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x478
ret
xor edi, edi
mov dword [esi], edi
mov dword [esi + 4], edi
mov dword [esi + 8], edi
mov word [esi + 0xc], di
mov word [esi], 6
call fcn.0040a2a0
push eax
call fcn.00409e10
mov word [esi + 0xc], ax
add esp, 4
lea eax, [esi + 6]
mov dword [esi + 2], edi
push esi
push 0x426d98
mov dword [eax], 0xffffffff
mov word [eax + 4], 0xffff
call fcn.00405760
add esp, 8
mov eax, dword [0x426d98]
push eax
call fcn.00405720
add esp, 4
test eax, eax
je 0x40a4ba
push edi
call fcn.0040a280
push eax
call fcn.0040b930
mov eax, dword [esp + 0x18]
add esp, 8
push eax
call sub.WSOCK32.dll_closesocket
mov eax, 0x41
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x478
ret
mov dword [0x4251ec], 0
push 0
call fcn.004138b4
add esp, 4
test eax, eax
jge 0x40a4e2
mov eax, 0x4a
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x478
ret
xor ebx, ebx
push ebx
call fcn.004138b4
cdq
add esp, 4
xor eax, edx
sub eax, edx
mov dword [esp + 0x4c], ebx
and eax, 0x1fff
lea edi, [esp + 0x54]
xor eax, edx
mov ecx, 0x64
mov dword [esp + 0x50], 0xffffffff
mov dword [esp + 0x44], 0x3f
sub eax, edx
mov dword [esp + 0x48], eax
xor eax, eax
rep stosd dword es:[edi], eax
mov esi, dword [esp + 0x490]
mov ecx, 0xffffffff
mov edi, esi
sub eax, eax
repne scasb al, byte es:[edi]
not ecx
mov eax, ecx
lea edi, [esp + 0x54]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [0x426d98]
push esi
call fcn.00405720
add esp, 4
test eax, eax
jne 0x40a615
mov edi, 0xe
push esi
call fcn.00405730
add esp, 4
push 0x10
push eax
call fcn.0040a280
push eax
call sub.WSOCK32.dll_connect
lea eax, [esp + 0x44]
push 0
push 0x1a0
push eax
call fcn.0040a280
push eax
call sub.WSOCK32.dll_send
cmp eax, 0x1a0
jne 0x40a59a
inc ebx
jmp 0x40a5f9
mov dword [esp + 0x14], edi
push 0x10
call fcn.00413664
add esp, 4
mov ebp, eax
test ebp, ebp
je 0x40a643
mov word [ebp], 6
call fcn.0040a2a0
push eax
call fcn.00409e10
mov word [ebp + 0xc], ax
add esp, 4
mov dword [esp + 0x14], 0x10
lea eax, [esp + 0x14]
push eax
push ebp
call fcn.0040a280
push eax
call sub.WSOCK32.dll_getsockname
push ebp
test eax, eax
jne 0x40a66d
push 0x426be8
call fcn.00405760
add esp, 8
push esi
call fcn.00405740
add esp, 4
mov esi, eax
push esi
call fcn.00405720
add esp, 4
test eax, eax
je 0x40a562
push 0
test ebx, ebx
jne 0x40a68f
call fcn.0040a280
push eax
call fcn.0040b930
mov eax, dword [esp + 0x18]
add esp, 8
push eax
call sub.WSOCK32.dll_closesocket
mov eax, 0x3e
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x478
ret
push 0
call fcn.0040a280
push eax
call fcn.0040b930
mov eax, dword [esp + 0x18]
add esp, 8
push eax
call sub.WSOCK32.dll_closesocket
mov eax, 1
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x478
ret
call fcn.00412dbf
mov eax, dword [esp + 0x14]
add esp, 4
push eax
call sub.WSOCK32.dll_closesocket
mov eax, 1
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x478
ret
xor edi, edi
call fcn.004138b4
add eax, dword [esp + 0x498]
mov esi, dword [esp + 0x4a8]
mov ebx, dword [esp + 0x49c]
mov dword [esp + 0x18], eax
add esp, 4
mov ebp, dword [esp + 0x14]
push 0
mov dword [esp + 0x24], 0
call fcn.004138b4
add esp, 4
sub ebp, eax
mov dword [esp + 0x1c], ebp
jns 0x40a6d8
mov dword [esp + 0x1c], 0
mov dword [esp + 0x1e4], 0
call fcn.0040a280
lea ecx, [esp + 0x1e4]
mov dword [esp + 0x1e8], eax
lea eax, [esp + 0x1c]
inc dword [esp + 0x1e4]
push eax
push 0
push 0
push ecx
call fcn.0040a280
inc eax
push eax
call fcn.00409d10
add esp, 0x14
cmp eax, 0xffffffff
je 0x40a7bc
test eax, eax
je 0x40a803
lea eax, [esp + 0x2e8]
push 0
mov dword [esp + 0x1c], 0xe
push 0x1a0
push eax
call fcn.0040a280
push eax
call sub.WSOCK32.dll_recv
cmp eax, 0x1a0
jne 0x40a808
lea eax, [esp + 0x18]
lea ecx, [esp + 0x34]
mov dword [esp + 0x18], 0x10
push eax
push ecx
call fcn.0040a280
push eax
call sub.WSOCK32.dll_getpeername
lea ecx, [esp + 0x24]
push ecx
call fcn.004090d0
mov ecx, dword [esp + 0x4a4]
mov edx, dword [esp + 0x4a0]
add esp, 4
push esi
push ecx
push edx
push ebx
push eax
lea eax, [esp + 0x30c]
push eax
call fcn.0040a860
add esp, 0x18
cmp ebx, 4
jne 0x40a7ad
cmp word [esi + 0x20], 0
ja 0x40a803
cmp eax, 0x40
je 0x40a837
test eax, eax
jne 0x40a808
jmp 0x40a803
call sub.WSOCK32.dll_WSAGetLastError
cmp eax, 0x2714
je 0x40a808
push 0
call fcn.0040a280
push eax
call fcn.0040b930
mov eax, dword [esp + 0x18]
add esp, 8
push eax
call sub.WSOCK32.dll_closesocket
mov ecx, dword [esp + 0x49c]
mov eax, 0
cmp dword [ecx], 0
jg 0x40a82c
pop ebp
mov eax, 1
pop edi
pop esi
pop ebx
add esp, 0x478
ret
mov edi, 1
test edi, edi
je 0x40a6b2
push 0
call fcn.0040a280
push eax
call fcn.0040b930
mov eax, dword [esp + 0x18]
add esp, 8
push eax
call sub.WSOCK32.dll_closesocket
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x478
ret
mov eax, dword [esp + 0x10]
push eax
call sub.WSOCK32.dll_closesocket
mov eax, 0x40
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x478
ret