Function at 0x40fa82
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
mov ebp, esp
sub esp, 0x4f0
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
push edi
call fcn.004221e8
xor ecx, ecx
cmp ax, 0x17
sete cl
xor ebx, ebx
push ebx
lea eax, [ebp - 5]
push eax
xor eax, eax
inc eax
mov dword [ebp - 0x28], ecx
mov ecx, edi
call fcn.00421be3
test al, al
je 0x40fcea
cmp byte [ebp - 5], bl
je 0x40fcea
movzx eax, byte [ebp - 5]
push ebx
lea ecx, [ebp - 0x36c]
push ecx
mov ecx, edi
call fcn.00421be3
test al, al
je 0x40fcea
movzx eax, byte [ebp - 5]
jmp 0x40faf0
dec eax
cmp byte [ebp + eax - 0x36c], bl
je 0x40fb2d
cmp eax, ebx
jne 0x40fae6
xor eax, eax
neg eax
sbb eax, eax
and eax, 0xffff0100
mov esi, 0xff05
add eax, esi
movzx eax, ax
mov dword [ebp - 0x24], eax
push 2
lea eax, [ebp - 0x24]
push eax
push edi
call fcn.00421c5a
test al, al
je 0x40fcea
cmp word [ebp - 0x24], si
jne 0x40fb36
mov al, 1
jmp 0x40fcec
lea eax, [ebp + eax - 0x36c]
jmp 0x40faf6
push ebx
lea eax, [ebp - 0x34]
push eax
push 4
pop eax
mov ecx, edi
mov byte [ebp - 9], bl
call fcn.00421be3
test al, al
je 0x40fcea
cmp byte [ebp - 0x34], 5
jne 0x40fcea
test byte [ebp - 0x28], 1
push 0x17
pop esi
je 0x40fb6f
mov dword [ebp - 0x48], esi
mov dword [ebp - 0x44], 2
jmp 0x40fb79
mov dword [ebp - 0x48], 2
mov dword [ebp - 0x44], esi
movzx eax, byte [ebp - 0x31]
dec eax
mov dword [ebp - 0x1c], ebx
je 0x40fc92
dec eax
dec eax
je 0x40fbd2
dec eax
jne 0x40fcea
push ebx
lea eax, [ebp - 0xe4]
push eax
push 0x10
pop eax
mov ecx, edi
call fcn.00421be3
test al, al
je 0x40fcea
push 0x1c
pop eax
call fcn.0041e7d1
mov dword [ebp - 0x1c], eax
cmp eax, ebx
je 0x40fcb4
mov word [eax], si
push 0x10
lea ecx, [ebp - 0xe4]
add eax, 8
jmp 0x40fcc8
push ebx
lea eax, [ebp - 0xa]
push eax
xor eax, eax
inc eax
mov ecx, edi
call fcn.00421be3
test al, al
je 0x40fcea
cmp byte [ebp - 0xa], bl
je 0x40fcea
movzx eax, byte [ebp - 0xa]
push ebx
lea ecx, [ebp - 0x4ec]
push ecx
mov ecx, edi
call fcn.00421be3
test al, al
je 0x40fcea
movzx eax, byte [ebp - 0xa]
mov byte [ebp + eax - 0x4ec], bl
lea eax, [ebp - 0x38]
push eax
push ebx
push ebx
lea eax, [ebp - 0x4ec]
push eax
mov dword [ebp - 0x38], ebx
call dword [sym.imp.WS2_32.dll_getaddrinfo]
test eax, eax
je 0x40fc3b
mov byte [ebp - 9], 4
jmp 0x40fccf
xor dl, dl
mov eax, dword [ebp - 0x38]
cmp eax, ebx
je 0x40fc57
movzx ecx, dl
mov ecx, dword [ebp + ecx*4 - 0x48]
cmp dword [eax + 4], ecx
je 0x40fc6d
mov eax, dword [eax + 0x1c]
cmp eax, ebx
jne 0x40fc4b
inc dl
cmp dl, 2
jb 0x40fc3d
mov byte [ebp - 9], 4
push dword [ebp - 0x38]
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
jmp 0x40fccf
push dword [eax + 0x10]
push dword [eax + 0x18]
call fcn.0041e854
mov dword [ebp - 0x1c], eax
cmp eax, ebx
jne 0x40fc85
mov byte [ebp - 9], 1
jmp 0x40fc62
cmp word [eax], si
jne 0x40fc62
mov dword [eax + 0x18], ebx
mov dword [eax + 4], ebx
jmp 0x40fc62
push ebx
lea eax, [ebp - 0x50]
push eax
push 4
pop eax
mov ecx, edi
call fcn.00421be3
test al, al
je 0x40fcea
push 0x10
pop eax
call fcn.0041e7d1
mov dword [ebp - 0x1c], eax
cmp eax, ebx
jne 0x40fcba
mov byte [ebp - 9], 1
jmp 0x40fccf
push 2
pop ecx
mov word [eax], cx
push 4
lea ecx, [ebp - 0x50]
add eax, 4
push ecx
push eax
call fcn.0041e83d
push ebx
lea eax, [ebp - 0x3c]
push eax
push 2
pop eax
mov ecx, edi
call fcn.00421be3
test al, al
jne 0x40fcf3
push dword [ebp - 0x1c]
call fcn.0041e801
xor al, al
pop edi
pop esi
pop ebx
leave
ret 4
mov byte [ebp - 5], 1
cmp byte [ebp - 9], bl
jne 0x41031c
mov ax, word [ebp - 0x3c]
mov ecx, dword [ebp - 0x1c]
mov word [ecx + 2], ax
movzx eax, byte [ebp - 0x33]
dec eax
je 0x4102d1
dec eax
je 0x410221
dec eax
je 0x40fd29
mov byte [ebp - 9], 7
jmp 0x41031c
mov eax, 0x80
mov dword [ebp - 0x4c], eax
mov dword [ebp - 0x54], eax
lea eax, [ebp - 0x4c]
push eax
lea eax, [ebp - 0xd4]
push eax
push dword [ebp + 8]
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x410218
lea eax, [ebp - 0x54]
push eax
lea eax, [ebp - 0x3ec]
push eax
push dword [ebp + 8]
call dword [sym.imp.WS2_32.dll_getpeername]
test eax, eax
jne 0x410218
cmp word [ebp - 0xd4], 0x17
mov word [ebp - 0xd2], ax
jne 0x40fd89
mov dword [ebp - 0xbc], ebx
mov dword [ebp - 0xd0], ebx
lea esi, [ebp - 0xd4]
call fcn.00422050
mov dword [ebp - 0x20], eax
cmp eax, 0xffffffff
je 0x410218
mov eax, 0xffff
call fcn.0041e7d1
mov edi, eax
cmp edi, ebx
jne 0x40fdb9
mov byte [ebp - 9], 1
jmp 0x410210
push dword [ebp - 0x28]
mov esi, dword [ebp + 8]
push ebx
push dword [ebp - 0x20]
push esi
call fcn.0040f96a
cmp eax, 1
jne 0x4101fc
mov eax, dword [ebp - 0x20]
or dword [ebp - 0x18], 0xffffffff
or dword [ebp - 0x1e0], 0xffffffff
mov dword [ebp - 0x2c], ebx
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x1ec], 2
mov dword [ebp - 0x1e8], esi
mov dword [ebp - 0x1e4], eax
jmp 0x4101d9
push dword [ebp + 8]
lea eax, [ebp - 0x1ec]
call fcn.00421b4d
test al, al
je 0x40fe2e
push ebx
push 0xffff
push edi
push dword [ebp + 8]
call dword [sym.imp.WS2_32.dll_recv]
test eax, eax
jle 0x4101f2
push dword [ebp - 0x20]
lea eax, [ebp - 0x1ec]
mov dword [ebp - 0x14], 0x80
call fcn.00421b4d
test al, al
je 0x4100e3
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0xd4]
push eax
push ebx
push 0xffff
push edi
push dword [ebp - 0x20]
call dword [sym.imp.WS2_32.dll_recvfrom]
mov esi, eax
mov dword [ebp - 0x40], esi
cmp esi, ebx
jle 0x4101f2
cmp esi, 6
jb 0x4100e3
mov ax, word [ebp - 0xd4]
cmp word [ebp - 0x3ec], ax
jne 0x4100e3
cmp ax, 2
jne 0x40fea4
mov eax, dword [ebp - 0x3e8]
cmp eax, dword [ebp - 0xd0]
jmp 0x40febf
cmp ax, 0x17
jne 0x40fec5
push 0x10
lea eax, [ebp - 0xcc]
lea ecx, [ebp - 0x3e4]
call fcn.0041e872
test eax, eax
jne 0x4100e3
cmp byte [edi + 2], 0
jne 0x4100e3
cmp word [edi], bx
jne 0x4100e3
cmp dword [ebp - 0x24], ebx
jne 0x40ff0f
push dword [ebp - 0x14]
lea eax, [ebp - 0xd4]
push eax
lea eax, [ebp - 0x26c]
push eax
call fcn.0041e83d
cmp word [ebp - 0x26c], 0x17
jne 0x40ff09
mov dword [ebp - 0x254], ebx
mov dword [ebp - 0x268], ebx
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x24], eax
push 0x80
push ebx
lea eax, [ebp - 0xd4]
push eax
call fcn.0041e8b4
movzx eax, byte [edi + 3]
dec eax
je 0x410020
dec eax
dec eax
je 0x40ff6a
dec eax
jne 0x4100e3
cmp esi, 0x16
jle 0x4100e3
push 0x17
pop eax
mov word [ebp - 0xd4], ax
push 0x10
lea eax, [edi + 4]
push eax
lea eax, [ebp - 0xcc]
push eax
mov dword [ebp - 0x14], 0x1c
call fcn.0041e83d
push 0x14
jmp 0x41004e
mov al, byte [edi + 4]
test al, al
je 0x4100e3
movzx eax, al
lea ecx, [eax + 7]
cmp esi, ecx
jle 0x4100e3
push eax
lea ecx, [edi + 5]
push ecx
lea ecx, [ebp - 0x36c]
push ecx
call fcn.0041e83d
mov byte [ebp + eax - 0x36c], 0
lea ebx, [eax + 5]
xor eax, eax
lea ecx, [ebp - 0x30]
push ecx
push eax
push eax
mov dword [ebp - 0x30], eax
lea eax, [ebp - 0x36c]
push eax
call dword [sym.imp.WS2_32.dll_getaddrinfo]
test eax, eax
jne 0x4100e3
xor dl, dl
xor esi, esi
mov eax, dword [ebp - 0x30]
cmp eax, esi
je 0x40ffdd
movzx ecx, dl
mov ecx, dword [ebp + ecx*4 - 0x48]
cmp dword [eax + 4], ecx
je 0x40ffe9
mov eax, dword [eax + 0x1c]
cmp eax, esi
jne 0x40ffd1
inc dl
cmp dl, 2
jb 0x40ffc3
jmp 0x4100e3
mov ecx, dword [eax + 0x10]
push ecx
mov dword [ebp - 0x14], ecx
push dword [eax + 0x18]
lea eax, [ebp - 0xd4]
push eax
call fcn.0041e83d
cmp word [ebp - 0xd4], 0x17
jne 0x410015
mov dword [ebp - 0xbc], esi
mov dword [ebp - 0xd0], esi
push dword [ebp - 0x30]
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
jmp 0x41004f
cmp esi, 0xa
jle 0x4100e3
push 2
pop eax
mov word [ebp - 0xd4], ax
push 4
lea eax, [edi + 4]
push eax
lea eax, [ebp - 0xd0]
push eax
mov dword [ebp - 0x14], 0x10
call fcn.0041e83d
push 8
pop ebx
mov ax, word [ebx + edi]
add ebx, 2
cmp dword [ebp - 0x18], 0xffffffff
mov word [ebp - 0xd2], ax
jne 0x4100b4
push 0x80
push 0
lea eax, [ebp - 0x2ec]
push eax
call fcn.0041e8b4
mov ax, word [ebp - 0xd4]
mov word [ebp - 0x2ec], ax
movzx eax, ax
lea esi, [ebp - 0x2ec]
mov dword [ebp - 0x10], eax
call fcn.00422050
mov dword [ebp - 0x18], eax
cmp eax, 0xffffffff
je 0x4101f2
xor eax, eax
cmp dword [ebp - 0x10], 0x17
setne al
dec eax
and eax, 0xc
add eax, 0xa
mov dword [ebp - 0x2c], eax
cmp dword [ebp - 0x40], ebx
jle 0x4100e3
movzx eax, word [ebp - 0xd4]
cmp dword [ebp - 0x10], eax
jne 0x4100e3
push dword [ebp - 0x14]
lea eax, [ebp - 0xd4]
push eax
mov eax, dword [ebp - 0x40]
push 0
sub eax, ebx
push eax
add ebx, edi
push ebx
push dword [ebp - 0x18]
call dword [sym.imp.WS2_32.dll_sendto]
cmp dword [ebp - 0x18], 0xffffffff
je 0x4101ab
push dword [ebp - 0x18]
lea eax, [ebp - 0x1ec]
call fcn.00421b4d
test al, al
je 0x4101ab
mov esi, dword [ebp - 0x2c]
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0xd4]
push eax
xor ebx, ebx
push ebx
mov eax, 0xffff
sub eax, esi
push eax
lea eax, [esi + edi]
push eax
push dword [ebp - 0x18]
call dword [sym.imp.WS2_32.dll_recvfrom]
cmp eax, ebx
jg 0x410139
movzx ecx, word [ebp - 0xd4]
cmp dword [ebp - 0x10], ecx
jne 0x4101ad
xor ecx, ecx
mov word [edi], cx
mov byte [edi + 2], cl
cmp word [ebp - 0xd4], 0x17
setne cl
dec cl
and cl, 3
inc cl
cmp dword [ebp - 0x10], 0x17
mov byte [edi + 3], cl
jne 0x410166
push 0x10
lea ecx, [ebp - 0xcc]
jmp 0x410174
cmp dword [ebp - 0x10], 2
jne 0x4101ad
push 4
lea ecx, [ebp - 0xd0]
push ecx
lea ecx, [edi + 4]
push ecx
call fcn.0041e83d
push 2
lea ecx, [ebp - 0xd2]
push ecx
lea ecx, [esi + edi - 2]
push ecx
call fcn.0041e83d
push dword [ebp - 0x24]
lea ecx, [ebp - 0x26c]
push ecx
push ebx
add eax, esi
push eax
push edi
push dword [ebp - 0x20]
call dword [sym.imp.WS2_32.dll_sendto]
jmp 0x4101ad
xor ebx, ebx
mov eax, dword [ebp - 0x18]
xor ecx, ecx
cmp eax, 0xffffffff
setne cl
mov dword [ebp - 0x1e0], eax
add ecx, 2
mov dword [ebp - 0x1ec], ecx
mov ecx, dword [ebp + 8]
mov dword [ebp - 0x1e8], ecx
mov ecx, dword [ebp - 0x20]
mov dword [ebp - 0x1e4], ecx
push ebx
push ebx
push ebx
lea eax, [ebp - 0x1ec]
push eax
push ebx
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jg 0x40fe04
mov esi, dword [ebp - 0x18]
call fcn.00421fd3
jmp 0x41020a
cmp eax, 0xffffffff
jne 0x410207
mov byte [ebp - 9], 1
jmp 0x41020a
mov byte [ebp - 5], bl
push edi
call fcn.0041e801
mov esi, dword [ebp - 0x20]
jmp 0x410317
mov byte [ebp - 9], 1
jmp 0x41031c
xor eax, eax
cmp word [ecx], 0x17
mov word [ecx + 2], ax
jne 0x41023b
push 0x10
push ebx
add ecx, 8
push ecx
call fcn.0041e8b4
jmp 0x41023e
mov dword [ecx + 4], ebx
mov esi, dword [ebp - 0x1c]
push 1
call fcn.00421d72
mov esi, eax
mov dword [ebp - 0x2c], esi
cmp esi, 0xffffffff
je 0x4102e0
push dword [ebp - 0x28]
push ebx
push esi
push dword [ebp + 8]
call fcn.0040f96a
mov edi, eax
cmp edi, 1
jne 0x4102b8
lea eax, [ebp + 8]
push eax
lea eax, [ebp - 0x2c]
push eax
call fcn.00421fa3
mov esi, dword [ebp - 0x2c]
mov dword [ebp - 0x10], eax
call fcn.00421fd3
cmp dword [ebp - 0x10], 0xffffffff
je 0x410218
push dword [ebp - 0x10]
call fcn.0042202b
mov eax, dword [ebp - 0x28]
or eax, 2
push eax
push ebx
push dword [ebp - 0x10]
push dword [ebp + 8]
call fcn.0040f96a
mov edi, eax
cmp edi, 1
jne 0x4102b5
push dword [ebp - 0x10]
mov ebx, dword [ebp + 8]
call fcn.00421e2c
mov esi, dword [ebp - 0x10]
call fcn.00421fd3
cmp edi, 0xffffffff
je 0x410218
cmp edi, 1
je 0x41031c
mov byte [ebp - 5], 0
jmp 0x41031c
mov edi, dword [ebp - 0x1c]
call fcn.00421c78
mov esi, eax
cmp esi, 0xffffffff
jne 0x4102e6
mov byte [ebp - 9], 5
jmp 0x41031c
push esi
call fcn.0042202b
push dword [ebp - 0x28]
push ebx
push esi
push dword [ebp + 8]
call fcn.0040f96a
cmp eax, 1
jne 0x410309
mov ebx, dword [ebp + 8]
push esi
call fcn.00421e2c
jmp 0x410317
cmp eax, 0xffffffff
jne 0x410314
mov byte [ebp - 9], 1
jmp 0x410317
mov byte [ebp - 5], bl
call fcn.00421fd3
push dword [ebp - 0x1c]
call fcn.0041e801
mov al, byte [ebp - 5]
cmp al, 1
jne 0x40fcec
cmp byte [ebp - 9], 0
je 0x40fcec
push dword [ebp - 0x28]
push dword [ebp - 9]
push 0xffffffffffffffff
push dword [ebp + 8]
call fcn.0040f96a
test eax, eax
setne al
jmp 0x40fcec