Function at 0x405cc4
Capabilities:
Get local ipv4 addresses
Get socket information
Get socket status
Receive data
Receive data on socket
Resolve dns
Send data
Send data on socket

Disassembly:
push ebp
lea ebp, [esp - 0x74]
sub esp, 0x404
push ebx
push esi
push edi
xor esi, esi
push esi
lea eax, [ebp + 0x73]
push eax
push dword [ebp + 0x7c]
xor eax, eax
inc eax
call fcn.00405512
test al, al
je 0x405f27
cmp byte [ebp + 0x73], 0
je 0x405f27
movzx eax, byte [ebp + 0x73]
push esi
lea ecx, [ebp - 0x290]
push ecx
push dword [ebp + 0x7c]
call fcn.00405512
test al, al
je 0x405f27
movzx eax, byte [ebp + 0x73]
jmp 0x405d23
dec eax
cmp byte [ebp + eax - 0x290], 0
je 0x405d64
cmp eax, esi
jne 0x405d18
xor eax, eax
neg eax
sbb eax, eax
and eax, 0xffff0100
mov edi, 0xff05
add eax, edi
push 2
movzx eax, ax
pop ebx
mov dword [ebp + 0x54], eax
push ebx
lea eax, [ebp + 0x54]
push eax
push dword [ebp + 0x7c]
call fcn.00405573
test al, al
je 0x405f27
cmp word [ebp + 0x54], di
jne 0x405d6d
mov al, 1
jmp 0x405f29
lea eax, [ebp + eax - 0x290]
jmp 0x405d29
push esi
lea eax, [ebp + 0x44]
push eax
push dword [ebp + 0x7c]
mov byte [ebp + 0x6f], 0
push 4
pop eax
call fcn.00405512
test al, al
je 0x405f27
cmp byte [ebp + 0x44], 5
jne 0x405f27
movzx eax, byte [ebp + 0x47]
dec eax
push 0x10
mov dword [ebp + 4], ebx
mov dword [ebp + 8], 0x17
mov dword [ebp + 0x60], esi
mov dword [ebp + 0x68], esi
pop edi
je 0x405ecd
sub eax, ebx
je 0x405dff
dec eax
jne 0x405f27
push esi
lea eax, [ebp - 0x3c]
push eax
push dword [ebp + 0x7c]
mov eax, edi
call fcn.00405512
test al, al
je 0x405f27
push 0x1c
pop eax
call fcn.00403db0
mov dword [ebp + 0x60], eax
cmp eax, esi
je 0x405eef
push 0x17
pop ecx
mov word [eax], cx
mov dword [ebp + 0x68], 0x1c
push edi
lea ecx, [ebp - 0x3c]
add eax, 8
jmp 0x405f05
push esi
lea eax, [ebp + 0x6e]
push eax
push dword [ebp + 0x7c]
xor eax, eax
inc eax
call fcn.00405512
test al, al
je 0x405f27
cmp byte [ebp + 0x6e], 0
je 0x405f27
movzx eax, byte [ebp + 0x6e]
push esi
lea ecx, [ebp - 0x290]
push ecx
push dword [ebp + 0x7c]
call fcn.00405512
test al, al
je 0x405f27
movzx eax, byte [ebp + 0x6e]
mov byte [ebp + eax - 0x290], 0
lea eax, [ebp + 0x4c]
push eax
push esi
push esi
lea eax, [ebp - 0x290]
push eax
mov dword [ebp + 0x4c], esi
call dword [sym.imp.WS2_32.dll_getaddrinfo]
test eax, eax
je 0x405e6c
mov byte [ebp + 0x6f], 4
jmp 0x405f0c
xor cl, cl
mov edi, dword [ebp + 0x4c]
cmp edi, esi
je 0x405e88
movzx eax, cl
mov eax, dword [ebp + eax*4 + 4]
cmp dword [edi + 4], eax
je 0x405ea1
mov edi, dword [edi + 0x1c]
cmp edi, esi
jne 0x405e7c
inc cl
cmp cl, 2
jb 0x405e6e
mov byte [ebp + 0x6f], 4
push dword [ebp + 0x4c]
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
push 0x10
pop edi
jmp 0x405f0c
push dword [edi + 0x10]
push dword [edi + 0x18]
call fcn.00403e1b
mov dword [ebp + 0x60], eax
cmp eax, esi
jne 0x405eb9
mov byte [ebp + 0x6f], 1
jmp 0x405e93
cmp word [eax], 0x17
mov ecx, dword [edi + 0x10]
mov dword [ebp + 0x68], ecx
jne 0x405e93
mov dword [eax + 0x18], esi
mov dword [eax + 4], esi
jmp 0x405e93
push esi
lea eax, [ebp - 4]
push eax
push dword [ebp + 0x7c]
push 4
pop eax
call fcn.00405512
test al, al
je 0x405f27
mov eax, edi
call fcn.00403db0
mov dword [ebp + 0x60], eax
cmp eax, esi
jne 0x405ef5
mov byte [ebp + 0x6f], 1
jmp 0x405f0c
mov ecx, ebx
mov word [eax], cx
mov dword [ebp + 0x68], edi
push 4
lea ecx, [ebp - 4]
add eax, 4
push ecx
push eax
call fcn.00403e04
push esi
lea eax, [ebp + 0x3c]
push eax
push dword [ebp + 0x7c]
mov eax, ebx
call fcn.00405512
test al, al
jne 0x405f33
push dword [ebp + 0x60]
call fcn.00403dc8
xor al, al
pop edi
pop esi
pop ebx
add ebp, 0x74
leave
ret 4
cmp byte [ebp + 0x6f], 0
mov byte [ebp + 0x73], 1
jne 0x4064f5
mov ax, word [ebp + 0x3c]
mov ecx, dword [ebp + 0x60]
mov word [ecx + 2], ax
movzx eax, byte [ebp + 0x45]
dec eax
je 0x4064a8
dec eax
je 0x4063db
dec eax
je 0x405f6a
mov byte [ebp + 0x6f], 7
jmp 0x4064f5
push 0x26
pop eax
mov dword [ebp + 0x10], eax
mov dword [ebp], eax
lea eax, [ebp + 0x10]
push eax
lea eax, [ebp + 0x14]
push eax
push dword [ebp + 0x7c]
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x406458
lea eax, [ebp]
push eax
lea eax, [ebp - 0x64]
push eax
push dword [ebp + 0x7c]
call dword [sym.imp.WS2_32.dll_getpeername]
test eax, eax
jne 0x406458
cmp word [ebp + 0x14], 0x17
mov word [ebp + 0x16], ax
jne 0x405fb6
mov dword [ebp + 0x2c], esi
mov dword [ebp + 0x18], esi
push dword [ebp + 0x10]
lea edi, [ebp + 0x14]
call fcn.00405a19
mov dword [ebp + 0x58], eax
cmp eax, 0xffffffff
je 0x406458
mov eax, 0xffff
call fcn.00403db0
mov ebx, eax
cmp ebx, esi
jne 0x405fe6
mov byte [ebp + 0x6f], 1
jmp 0x4063d3
mov edi, dword [ebp + 0x7c]
push esi
push esi
push dword [ebp + 0x58]
push edi
call fcn.00405bc6
cmp eax, 1
jne 0x4063be
mov eax, dword [ebp + 0x58]
or dword [ebp + 0x5c], 0xffffffff
or dword [ebp - 0x184], 0xffffffff
mov dword [ebp + 0x50], esi
mov dword [ebp + 0x68], esi
mov dword [ebp + 0x54], esi
mov dword [ebp - 0x190], 2
mov dword [ebp - 0x188], eax
jmp 0x406395
push edi
lea eax, [ebp - 0x190]
call fcn.00405479
test al, al
je 0x40604f
push esi
push 0xffff
push ebx
push edi
call dword [sym.imp.WS2_32.dll_recv]
test eax, eax
jle 0x4063b4
push dword [ebp + 0x58]
lea eax, [ebp - 0x190]
mov dword [ebp + 0x64], 0x26
call fcn.00405479
test al, al
je 0x4062c1
lea eax, [ebp + 0x64]
push eax
lea eax, [ebp + 0x14]
push eax
push esi
push 0xffff
push ebx
push dword [ebp + 0x58]
call dword [sym.imp.WS2_32.dll_recvfrom]
mov edi, eax
cmp edi, esi
mov dword [ebp + 0xc], edi
jle 0x4063b4
cmp edi, 6
jb 0x4062c1
mov ax, word [ebp + 0x14]
cmp word [ebp - 0x64], ax
jne 0x4062c1
cmp ax, 2
jne 0x4060b6
mov eax, dword [ebp - 0x60]
cmp eax, dword [ebp + 0x18]
jmp 0x4060cb
cmp ax, 0x17
jne 0x4060d1
push 0x10
lea eax, [ebp + 0x1c]
lea ecx, [ebp - 0x5c]
call fcn.00403e39
test eax, eax
jne 0x4062c1
cmp byte [ebx + 2], 0
jne 0x4062c1
cmp word [ebx], si
jne 0x4062c1
cmp dword [ebp + 0x54], esi
jne 0x40610c
push dword [ebp + 0x64]
lea eax, [ebp + 0x14]
push eax
lea eax, [ebp - 0x2c]
push eax
call fcn.00403e04
cmp word [ebp - 0x2c], 0x17
jne 0x406106
mov dword [ebp - 0x14], esi
mov dword [ebp - 0x28], esi
mov eax, dword [ebp + 0x64]
mov dword [ebp + 0x54], eax
push 0x26
lea eax, [ebp + 0x14]
push eax
call fcn.00403e69
movzx eax, byte [ebx + 3]
dec eax
je 0x406200
dec eax
dec eax
je 0x40615a
dec eax
jne 0x4062c1
cmp edi, 0x16
jle 0x4062c1
push 0x17
pop eax
mov word [ebp + 0x14], ax
push 0x10
lea eax, [ebx + 4]
push eax
lea eax, [ebp + 0x1c]
push eax
mov dword [ebp + 0x64], 0x1c
call fcn.00403e04
push 0x14
jmp 0x406228
mov al, byte [ebx + 4]
test al, al
je 0x4062c1
movzx eax, al
lea ecx, [eax + 7]
cmp edi, ecx
jle 0x4062c1
push eax
lea ecx, [ebx + 5]
push ecx
lea ecx, [ebp - 0x390]
push ecx
call fcn.00403e04
mov byte [ebp + eax - 0x390], 0
lea edi, [eax + 5]
lea eax, [ebp + 0x48]
push eax
push esi
push esi
lea eax, [ebp - 0x390]
push eax
mov dword [ebp + 0x48], esi
call dword [sym.imp.WS2_32.dll_getaddrinfo]
test eax, eax
jne 0x4062c1
xor dl, dl
mov eax, dword [ebp + 0x48]
cmp eax, esi
je 0x4061c9
movzx ecx, dl
mov ecx, dword [ebp + ecx*4 + 4]
cmp dword [eax + 4], ecx
je 0x4061d5
mov eax, dword [eax + 0x1c]
cmp eax, esi
jne 0x4061bd
inc dl
cmp dl, 2
jb 0x4061af
jmp 0x4062c1
mov ecx, dword [eax + 0x10]
push ecx
mov dword [ebp + 0x64], ecx
push dword [eax + 0x18]
lea eax, [ebp + 0x14]
push eax
call fcn.00403e04
cmp word [ebp + 0x14], 0x17
jne 0x4061f5
mov dword [ebp + 0x2c], esi
mov dword [ebp + 0x18], esi
push dword [ebp + 0x48]
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
jmp 0x406229
cmp edi, 0xa
jle 0x4062c1
push 2
pop eax
mov word [ebp + 0x14], ax
push 4
lea eax, [ebx + 4]
push eax
lea eax, [ebp + 0x18]
push eax
mov dword [ebp + 0x64], 0x10
call fcn.00403e04
push 8
pop edi
mov ax, word [edi + ebx]
inc edi
inc edi
cmp dword [ebp + 0x5c], 0xffffffff
mov word [ebp + 0x16], ax
mov dword [ebp + 0x40], edi
jne 0x406299
push 0x26
push esi
lea eax, [ebp - 0x8c]
push eax
call fcn.00403e7b
mov ax, word [ebp + 0x14]
mov word [ebp - 0x8c], ax
movzx eax, ax
xor ecx, ecx
cmp eax, 0x17
setne cl
lea edi, [ebp - 0x8c]
mov dword [ebp + 0x68], eax
dec ecx
and ecx, 0xc
add ecx, 0x10
push ecx
call fcn.00405a19
mov dword [ebp + 0x5c], eax
cmp eax, 0xffffffff
je 0x4063b4
mov edi, dword [ebp + 0x40]
xor eax, eax
cmp dword [ebp + 0x68], 0x17
setne al
dec eax
and eax, 0xc
add eax, 0xa
mov dword [ebp + 0x50], eax
cmp dword [ebp + 0xc], edi
jle 0x4062c1
movzx eax, word [ebp + 0x14]
cmp dword [ebp + 0x68], eax
jne 0x4062c1
push dword [ebp + 0x64]
lea eax, [ebp + 0x14]
push eax
mov eax, dword [ebp + 0xc]
push esi
sub eax, edi
push eax
add edi, ebx
push edi
push dword [ebp + 0x5c]
call dword [sym.imp.WS2_32.dll_sendto]
cmp dword [ebp + 0x5c], 0xffffffff
je 0x406370
push dword [ebp + 0x5c]
lea eax, [ebp - 0x190]
call fcn.00405479
test al, al
je 0x406370
mov edi, dword [ebp + 0x50]
lea eax, [ebp + 0x64]
push eax
lea eax, [ebp + 0x14]
push eax
push esi
mov eax, 0xffff
sub eax, edi
push eax
lea eax, [edi + ebx]
push eax
push dword [ebp + 0x5c]
call dword [sym.imp.WS2_32.dll_recvfrom]
cmp eax, esi
jg 0x40630f
movzx ecx, word [ebp + 0x14]
cmp dword [ebp + 0x68], ecx
jne 0x406370
xor ecx, ecx
mov word [ebx], cx
mov byte [ebx + 2], cl
cmp word [ebp + 0x14], 0x17
setne cl
dec cl
and cl, 3
inc cl
cmp dword [ebp + 0x68], 0x17
mov byte [ebx + 3], cl
jne 0x406336
push 0x10
lea ecx, [ebp + 0x1c]
jmp 0x406341
cmp dword [ebp + 0x68], 2
jne 0x406370
push 4
lea ecx, [ebp + 0x18]
push ecx
lea ecx, [ebx + 4]
push ecx
call fcn.00403e04
push 2
lea ecx, [ebp + 0x16]
push ecx
lea ecx, [edi + ebx - 2]
push ecx
call fcn.00403e04
push dword [ebp + 0x54]
lea ecx, [ebp - 0x2c]
push ecx
push esi
add eax, edi
push eax
push ebx
push dword [ebp + 0x58]
call dword [sym.imp.WS2_32.dll_sendto]
mov eax, dword [ebp + 0x5c]
mov edi, dword [ebp + 0x7c]
xor ecx, ecx
cmp eax, 0xffffffff
setne cl
mov dword [ebp - 0x184], eax
inc ecx
inc ecx
mov dword [ebp - 0x190], ecx
mov ecx, dword [ebp + 0x58]
mov dword [ebp - 0x188], ecx
push esi
push esi
push esi
lea eax, [ebp - 0x190]
push eax
push esi
mov dword [ebp - 0x18c], edi
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jg 0x406029
mov esi, dword [ebp + 0x5c]
call fcn.004059dd
jmp 0x4063cd
cmp eax, 0xffffffff
jne 0x4063c9
mov byte [ebp + 0x6f], 1
jmp 0x4063cd
mov byte [ebp + 0x73], 0
push ebx
call fcn.00403dc8
mov esi, dword [ebp + 0x58]
jmp 0x4064f0
xor eax, eax
cmp word [ecx], 0x17
mov word [ecx + 2], ax
jne 0x4063f3
push edi
add ecx, 8
push ecx
call fcn.00403e69
jmp 0x4063f6
mov dword [ecx + 4], esi
mov edi, dword [ebp + 0x60]
push 1
push dword [ebp + 0x68]
call fcn.004056a2
mov edi, eax
mov dword [ebp + 0x50], edi
cmp edi, 0xffffffff
jne 0x406416
mov byte [ebp + 0x6f], 5
jmp 0x4064f5
push esi
push esi
push edi
push dword [ebp + 0x7c]
call fcn.00405bc6
mov ebx, eax
cmp ebx, 1
jne 0x406491
lea eax, [ebp + 0x7c]
push eax
push esi
lea eax, [ebp + 0x50]
push eax
xor eax, eax
inc eax
call fcn.004058d2
mov edi, eax
cmp edi, 0xffffffff
je 0x40644b
push esi
push esi
push edi
call dword [sym.imp.WS2_32.dll_accept]
mov edi, eax
mov esi, dword [ebp + 0x50]
call fcn.004059dd
cmp edi, 0xffffffff
jne 0x406461
mov byte [ebp + 0x6f], 1
jmp 0x4064f5
push edi
call fcn.004059f3
push 2
push 0
push edi
push dword [ebp + 0x7c]
call fcn.00405bc6
mov dword [ebp + 0x40], eax
cmp eax, 1
jne 0x406485
mov ebx, dword [ebp + 0x7c]
push edi
call fcn.00405743
mov esi, edi
call fcn.004059dd
mov ebx, dword [ebp + 0x40]
jmp 0x406498
mov esi, edi
call fcn.004059dd
cmp ebx, 0xffffffff
je 0x406458
cmp ebx, 1
je 0x4064f5
mov byte [ebp + 0x73], 0
jmp 0x4064f5
push dword [ebp + 0x68]
mov edi, dword [ebp + 0x60]
call fcn.00405591
mov edi, eax
cmp edi, 0xffffffff
je 0x40640d
push edi
call fcn.004059f3
push esi
push esi
push edi
push dword [ebp + 0x7c]
call fcn.00405bc6
cmp eax, 1
jne 0x4064df
mov ebx, dword [ebp + 0x7c]
push edi
call fcn.00405743
jmp 0x4064ee
cmp eax, 0xffffffff
jne 0x4064ea
mov byte [ebp + 0x6f], 1
jmp 0x4064ee
mov byte [ebp + 0x73], 0
mov esi, edi
call fcn.004059dd
push dword [ebp + 0x60]
call fcn.00403dc8
mov al, byte [ebp + 0x73]
cmp al, 1
jne 0x405f29
cmp byte [ebp + 0x6f], 0
je 0x405f29
push 0
push dword [ebp + 0x6f]
push 0xffffffffffffffff
push dword [ebp + 0x7c]
call fcn.00405bc6
test eax, eax
setne al
jmp 0x405f29