Function at 0x40f103
Capabilities:
Get local ipv4 addresses
Get socket information
Get socket status
Receive data
Receive data on socket
Resolve dns
Resolve function by parsing pe exports
Send data
Send data on socket

Disassembly:
sub esp, 0x4f4
push ebx
push ebp
push esi
push edi
mov dword [esp + 0x18], ecx
call fcn.004172de
xor ecx, ecx
cmp al, 2
sete cl
xor ebx, ebx
push ebx
push 1
lea edx, [esp + 0x1f]
mov dword [esp + 0x38], ecx
mov ecx, dword [esp + 0x20]
call fcn.0040e1d6
test al, al
je 0x40f3be
mov al, byte [esp + 0x17]
test al, al
je 0x40f3be
mov ecx, dword [esp + 0x18]
movzx eax, al
push ebx
push eax
lea edx, [esp + 0x288]
call fcn.0040e1d6
test al, al
je 0x40f3be
movzx eax, byte [esp + 0x17]
jmp 0x40f175
dec eax
cmp byte [esp + eax + 0x280], bl
je 0x40f1b9
test eax, eax
jne 0x40f16b
mov ecx, ebx
push 5
pop eax
push ebx
test ecx, ecx
mov esi, 0xff05
cmove eax, esi
push 2
movzx eax, ax
pop edi
mov dword [esp + 0x28], eax
push edi
lea eax, [esp + 0x2c]
push eax
push dword [esp + 0x24]
call dword [sym.imp.WS2_32.dll_send]
cmp eax, edi
jne 0x40f3be
cmp word [esp + 0x24], si
jne 0x40f1c4
mov al, 1
jmp 0x40f3c0
lea ecx, [esp + 0x280]
add ecx, eax
jmp 0x40f17b
xor ecx, ecx
push ecx
mov ecx, dword [esp + 0x1c]
push 4
pop eax
push eax
lea edx, [esp + 0x4c]
mov byte [esp + 0x28], bl
call fcn.0040e1d6
test al, al
je 0x40f3be
cmp byte [esp + 0x44], 5
jne 0x40f3be
test byte [esp + 0x30], 1
push 0x17
pop ebp
je 0x40f203
mov dword [esp + 0x50], ebp
mov dword [esp + 0x54], edi
jmp 0x40f20b
mov dword [esp + 0x50], edi
mov dword [esp + 0x54], ebp
movzx eax, byte [esp + 0x47]
mov edi, dword [sym.imp.KERNEL32.dll_HeapAlloc]
xor ecx, ecx
mov esi, ecx
push 0x10
mov dword [esp + 0x40], esi
pop edx
dec eax
je 0x40f353
dec eax
dec eax
je 0x40f27e
dec eax
jne 0x40f3be
push ecx
mov ecx, dword [esp + 0x1c]
push edx
lea edx, [esp + 0xf0]
call fcn.0040e1d6
test al, al
je 0x40f3be
push 0x20
push 8
push dword [0x4420ec]
call edi
mov esi, eax
mov dword [esp + 0x3c], esi
test esi, esi
je 0x40f37d
push 0x10
pop eax
push eax
lea eax, [esp + 0xec]
push eax
mov word [esi], bp
lea eax, [esi + 8]
jmp 0x40f395
push ecx
mov ecx, dword [esp + 0x1c]
push 1
lea edx, [esp + 0x1f]
call fcn.0040e1d6
test al, al
je 0x40f3be
mov al, byte [esp + 0x17]
test al, al
je 0x40f3be
xor ecx, ecx
movzx eax, al
push ecx
mov ecx, dword [esp + 0x1c]
push eax
lea edx, [esp + 0x408]
call fcn.0040e1d6
test al, al
je 0x40f3be
movzx eax, byte [esp + 0x17]
xor ecx, ecx
mov byte [esp + eax + 0x400], cl
lea eax, [esp + 0x4c]
push eax
push ecx
push ecx
lea eax, [esp + 0x40c]
push eax
mov dword [esp + 0x5c], ecx
call dword [sym.imp.WS2_32.dll_getaddrinfo]
test eax, eax
je 0x40f2f3
mov bl, 4
jmp 0x40f37f
xor ecx, ecx
mov dl, cl
mov ecx, dword [esp + 0x4c]
test ecx, ecx
je 0x40f312
movzx eax, dl
mov eax, dword [esp + eax*4 + 0x50]
cmp dword [ecx + 4], eax
je 0x40f32b
mov ecx, dword [ecx + 0x1c]
test ecx, ecx
jne 0x40f306
inc dl
cmp dl, 2
jb 0x40f2f7
mov bl, 4
mov byte [esp + 0x20], bl
push dword [esp + 0x4c]
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
jmp 0x40f39f
mov edx, dword [ecx + 0x10]
mov ecx, dword [ecx + 0x18]
call fcn.00430e63
mov esi, eax
mov dword [esp + 0x3c], esi
test esi, esi
jne 0x40f344
mov bl, 1
jmp 0x40f31b
cmp word [esi], bp
jne 0x40f31f
xor eax, eax
mov dword [esi + 0x18], eax
mov dword [esi + 4], eax
jmp 0x40f31f
push ecx
mov ecx, dword [esp + 0x1c]
push 4
lea edx, [esp + 0x6c]
call fcn.0040e1d6
test al, al
je 0x40f3be
push 0x14
push 8
push dword [0x4420ec]
call edi
mov esi, eax
mov dword [esp + 0x3c], esi
test esi, esi
jne 0x40f385
mov bl, 1
mov byte [esp + 0x20], bl
jmp 0x40f39f
push 2
pop eax
mov word [esi], ax
lea eax, [esp + 0x64]
push 4
push eax
lea eax, [esi + 4]
push eax
call dword [sym.imp.msvcrt.dll_memcpy]
add esp, 0xc
mov ecx, dword [esp + 0x18]
xor eax, eax
push eax
push 2
pop eax
push eax
lea edx, [esp + 0x50]
call fcn.0040e1d6
test al, al
jne 0x40f3cb
mov ecx, esi
call fcn.00430e28
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4f4
ret
mov bh, 1
test bl, bl
jne 0x40faa8
mov ax, word [esp + 0x48]
mov word [esi + 2], ax
movzx eax, byte [esp + 0x45]
dec eax
je 0x40fa4f
dec eax
je 0x40f988
dec eax
je 0x40f3fc
add bl, 7
jmp 0x40fa5f
mov eax, 0x80
mov dword [esp + 0x5c], eax
mov dword [esp + 0x60], eax
lea eax, [esp + 0x5c]
push eax
lea eax, [esp + 0x6c]
push eax
push dword [esp + 0x20]
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x40f981
lea eax, [esp + 0x60]
push eax
lea eax, [esp + 0x384]
push eax
push dword [esp + 0x20]
call dword [sym.imp.WS2_32.dll_getpeername]
test eax, eax
jne 0x40f981
mov word [esp + 0x6a], ax
cmp word [esp + 0x68], bp
jne 0x40f45b
mov dword [esp + 0x80], eax
mov dword [esp + 0x6c], eax
lea ecx, [esp + 0x68]
call fcn.0040e56a
mov ebp, eax
mov dword [esp + 0x1c], ebp
cmp ebp, 0xffffffff
je 0x40f981
push 0x10003
push 8
push dword [0x4420ec]
call edi
mov edi, eax
test edi, edi
jne 0x40f493
mov bl, 1
mov byte [esp + 0x20], bl
jmp 0x40f97a
push dword [esp + 0x30]
mov ecx, dword [esp + 0x1c]
xor eax, eax
push eax
mov edx, ebp
call fcn.0040efc5
cmp eax, 1
jne 0x40f962
or dword [esp + 0x2c], 0xffffffff
or dword [esp + 0x104], 0xffffffff
push 2
xor ecx, ecx
pop eax
push ecx
mov dword [esp + 0xfc], eax
mov eax, dword [esp + 0x1c]
push ecx
mov dword [esp + 0x104], eax
push ecx
lea eax, [esp + 0x104]
push eax
push ecx
mov dword [esp + 0x4c], ecx
mov dword [esp + 0x48], ecx
mov dword [esp + 0x38], ecx
mov dword [esp + 0x114], ebp
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jle 0x40f957
push 0x17
pop esi
mov ecx, dword [esp + 0x18]
lea edx, [esp + 0xf8]
call fcn.0040e1b8
test al, al
je 0x40f52e
xor eax, eax
push eax
push 0xffff
push edi
push ecx
call dword [sym.imp.WS2_32.dll_recv]
test eax, eax
jle 0x40f953
lea edx, [esp + 0xf8]
mov ecx, ebp
mov dword [esp + 0x28], 0x80
call fcn.0040e1b8
test al, al
je 0x40f81a
lea eax, [esp + 0x28]
push eax
lea eax, [esp + 0x6c]
push eax
xor eax, eax
push eax
push 0xffff
push edi
push ebp
call dword [sym.imp.WS2_32.dll_recvfrom]
mov ebp, eax
mov dword [esp + 0x58], ebp
test ebp, ebp
jle 0x40f94f
cmp ebp, 6
jb 0x40f816
mov cx, word [esp + 0x68]
cmp word [esp + 0x380], cx
jne 0x40f816
push 2
pop eax
cmp cx, ax
jne 0x40f5a5
mov eax, dword [esp + 0x384]
cmp eax, dword [esp + 0x6c]
jmp 0x40f5c6
cmp cx, si
jne 0x40f5cc
push 0x10
pop eax
push eax
lea eax, [esp + 0x74]
push eax
lea eax, [esp + 0x390]
push eax
call dword [sym.imp.msvcrt.dll_memcmp]
add esp, 0xc
test eax, eax
jne 0x40f816
cmp byte [edi + 2], 0
jne 0x40f816
xor eax, eax
cmp word [edi], ax
jne 0x40f816
cmp dword [esp + 0x24], eax
jne 0x40f625
push dword [esp + 0x28]
lea eax, [esp + 0x6c]
push eax
lea eax, [esp + 0x208]
push eax
call dword [sym.imp.msvcrt.dll_memcpy]
add esp, 0xc
cmp word [esp + 0x200], si
jne 0x40f61b
xor eax, eax
mov dword [esp + 0x218], eax
mov dword [esp + 0x204], eax
mov eax, dword [esp + 0x28]
mov dword [esp + 0x24], eax
xor eax, eax
push 0x80
push eax
lea eax, [esp + 0x70]
push eax
call dword [sym.imp.msvcrt.dll_memset]
movzx eax, byte [edi + 3]
add esp, 0xc
dec eax
je 0x40f745
push 2
pop ecx
sub eax, ecx
je 0x40f685
dec eax
jne 0x40f816
cmp ebp, 0x16
jle 0x40f816
push 0x10
pop eax
push eax
lea eax, [edi + 4]
push eax
lea eax, [esp + 0x78]
push eax
mov dword [esp + 0x34], 0x1c
mov word [esp + 0x74], si
call dword [sym.imp.msvcrt.dll_memcpy]
add esp, 0xc
push 0x14
jmp 0x40f775
mov al, byte [edi + 4]
test al, al
je 0x40f816
movzx ebp, al
lea eax, [ebp + 7]
cmp dword [esp + 0x58], eax
jle 0x40f816
push ebp
lea eax, [edi + 5]
push eax
lea eax, [esp + 0x288]
push eax
call dword [sym.imp.msvcrt.dll_memcpy]
add esp, 0xc
xor ecx, ecx
lea eax, [esp + 0x40]
push eax
push ecx
push ecx
lea eax, [esp + 0x28c]
mov byte [esp + ebp + 0x28c], cl
push eax
add ebp, 5
mov dword [esp + 0x50], ecx
call dword [sym.imp.WS2_32.dll_getaddrinfo]
test eax, eax
jne 0x40f816
mov dl, al
mov ecx, dword [esp + 0x40]
test ecx, ecx
je 0x40f700
movzx eax, dl
mov eax, dword [esp + eax*4 + 0x50]
cmp dword [ecx + 4], eax
je 0x40f70c
mov ecx, dword [ecx + 0x1c]
test ecx, ecx
jne 0x40f6f4
inc dl
cmp dl, 2
jb 0x40f6e5
jmp 0x40f816
mov eax, dword [ecx + 0x10]
push eax
mov dword [esp + 0x2c], eax
push dword [ecx + 0x18]
lea eax, [esp + 0x70]
push eax
call dword [sym.imp.msvcrt.dll_memcpy]
add esp, 0xc
cmp word [esp + 0x68], si
jne 0x40f739
xor eax, eax
mov dword [esp + 0x80], eax
mov dword [esp + 0x6c], eax
push dword [esp + 0x40]
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
jmp 0x40f776
cmp ebp, 0xa
jle 0x40f816
push 0x10
pop eax
push 2
mov dword [esp + 0x2c], eax
pop eax
push 4
mov word [esp + 0x6c], ax
pop eax
push eax
lea eax, [edi + 4]
push eax
lea eax, [esp + 0x74]
push eax
call dword [sym.imp.msvcrt.dll_memcpy]
add esp, 0xc
push 8
pop ebp
mov ax, word [edi + ebp]
mov edx, dword [esp + 0x2c]
push 2
mov word [esp + 0x6e], ax
pop eax
add ebp, eax
cmp edx, 0xffffffff
jne 0x40f7e9
xor eax, eax
push 0x80
push eax
lea eax, [esp + 0x288]
push eax
call dword [sym.imp.msvcrt.dll_memset]
mov ax, word [esp + 0x74]
mov word [esp + 0x28c], ax
movzx eax, ax
add esp, 0xc
lea ecx, [esp + 0x280]
mov dword [esp + 0x34], eax
call fcn.0040e56a
mov edx, eax
mov dword [esp + 0x2c], edx
cmp edx, 0xffffffff
je 0x40f94f
cmp dword [esp + 0x34], esi
push 4
pop eax
push 0x10
pop ecx
cmove eax, ecx
add eax, 6
mov dword [esp + 0x38], eax
mov ecx, dword [esp + 0x58]
cmp ecx, ebp
jle 0x40f816
movzx eax, word [esp + 0x68]
cmp dword [esp + 0x34], eax
jne 0x40f816
push dword [esp + 0x28]
lea eax, [esp + 0x6c]
push eax
xor eax, eax
push eax
sub ecx, ebp
push ecx
lea eax, [edi + ebp]
push eax
push edx
call dword [sym.imp.WS2_32.dll_sendto]
mov ebp, dword [esp + 0x1c]
mov eax, dword [esp + 0x2c]
cmp eax, 0xffffffff
je 0x40f900
lea edx, [esp + 0xf8]
mov ecx, eax
call fcn.0040e1b8
test al, al
je 0x40f900
mov ecx, dword [esp + 0x38]
lea eax, [esp + 0x28]
push eax
lea eax, [esp + 0x6c]
push eax
xor eax, eax
push eax
mov eax, 0xffff
sub eax, ecx
push eax
lea eax, [edi + ecx]
push eax
push dword [esp + 0x40]
call dword [sym.imp.WS2_32.dll_recvfrom]
mov ebp, eax
test ebp, ebp
jg 0x40f879
movzx ecx, word [esp + 0x68]
cmp dword [esp + 0x34], ecx
jne 0x40f8fc
xor eax, eax
mov word [edi], ax
mov byte [edi + 2], al
inc eax
cmp word [esp + 0x68], si
push 4
pop edx
cmove eax, edx
mov byte [edi + 3], al
mov eax, dword [esp + 0x34]
cmp eax, esi
jne 0x40f8a2
push 0x10
pop eax
push eax
lea eax, [esp + 0x74]
jmp 0x40f8ae
push 2
pop ecx
cmp eax, ecx
jne 0x40f8fc
push edx
lea eax, [esp + 0x70]
push eax
lea eax, [edi + 4]
push eax
call dword [sym.imp.msvcrt.dll_memcpy]
add esp, 0xc
push 2
pop eax
push eax
lea eax, [esp + 0x6e]
push eax
mov eax, dword [esp + 0x40]
add eax, 0xfffffffe
add eax, edi
push eax
call dword [sym.imp.msvcrt.dll_memcpy]
add esp, 0xc
lea eax, [esp + 0x200]
push dword [esp + 0x24]
push eax
xor eax, eax
push eax
mov eax, dword [esp + 0x44]
add eax, ebp
mov ebp, dword [esp + 0x28]
push eax
push edi
push ebp
call dword [sym.imp.WS2_32.dll_sendto]
jmp 0x40f900
mov ebp, dword [esp + 0x1c]
mov ecx, dword [esp + 0x2c]
xor eax, eax
cmp ecx, 0xffffffff
setne al
push 2
pop edx
mov dword [esp + 0x104], ecx
xor ecx, ecx
push ecx
push ecx
add eax, edx
mov dword [esp + 0x100], eax
mov eax, dword [esp + 0x20]
mov dword [esp + 0x104], eax
push ecx
lea eax, [esp + 0x104]
push eax
push ecx
mov dword [esp + 0x114], ebp
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jg 0x40f502
jmp 0x40f953
mov ebp, dword [esp + 0x1c]
mov esi, dword [esp + 0x3c]
mov ecx, dword [esp + 0x2c]
call fcn.0040e550
jmp 0x40f973
cmp eax, 0xffffffff
jne 0x40f96f
mov bl, 1
mov byte [esp + 0x20], bl
jmp 0x40f973
xor eax, eax
mov bh, al
mov ecx, edi
call fcn.00430e28
mov ecx, ebp
jmp 0x40faa3
mov bl, 1
jmp 0x40fa5f
xor eax, eax
mov word [esi + 2], ax
cmp word [esi], bp
jne 0x40f9a9
push 0x10
pop eax
push eax
xor eax, eax
push eax
lea eax, [esi + 8]
push eax
call dword [sym.imp.msvcrt.dll_memset]
add esp, 0xc
jmp 0x40f9ae
xor eax, eax
mov dword [esi + 4], eax
mov ecx, esi
call fcn.0040e372
mov dword [esp + 0x24], eax
cmp eax, 0xffffffff
je 0x40fa5d
push dword [esp + 0x30]
xor ecx, ecx
push ecx
mov ecx, dword [esp + 0x20]
mov edx, eax
call fcn.0040efc5
mov edi, eax
cmp edi, 1
jne 0x40fa32
push ecx
lea eax, [esp + 0x1c]
push eax
sub esp, 0xc
lea ecx, [esp + 0x38]
call fcn.0040e525
mov ecx, dword [esp + 0x24]
mov ebp, eax
call fcn.0040e550
cmp ebp, 0xffffffff
je 0x40f981
mov ecx, ebp
call fcn.004179bf
mov eax, dword [esp + 0x30]
push 2
pop ecx
or eax, ecx
mov ecx, dword [esp + 0x18]
push eax
xor eax, eax
push eax
mov edx, ebp
call fcn.0040efc5
mov edi, eax
cmp edi, 1
jne 0x40fa2e
mov ecx, dword [esp + 0x18]
mov edx, ebp
call fcn.0040e3d0
mov ecx, ebp
jmp 0x40fa36
mov ecx, dword [esp + 0x24]
call fcn.0040e550
cmp edi, 0xffffffff
je 0x40f981
cmp edi, 1
je 0x40faa8
xor eax, eax
mov bh, al
jmp 0x40faa8
mov ecx, esi
call fcn.0040e287
mov edi, eax
cmp edi, 0xffffffff
jne 0x40fa65
mov bl, 5
mov byte [esp + 0x20], bl
jmp 0x40faa8
mov ecx, edi
call fcn.004179bf
mov ecx, dword [esp + 0x18]
push dword [esp + 0x30]
xor eax, eax
push eax
mov edx, edi
call fcn.0040efc5
cmp eax, 1
jne 0x40fa90
mov ecx, dword [esp + 0x18]
mov edx, edi
call fcn.0040e3d0
jmp 0x40faa1
cmp eax, 0xffffffff
jne 0x40fa9d
mov bl, 1
mov byte [esp + 0x20], bl
jmp 0x40faa1
xor eax, eax
mov bh, al
mov ecx, edi
call fcn.0040e550
mov ecx, esi
call fcn.00430e28
cmp bh, 1
jne 0x40fad1
test bl, bl
je 0x40fad1
push dword [esp + 0x30]
mov ecx, dword [esp + 0x1c]
push dword [esp + 0x24]
or edx, 0xffffffff
call fcn.0040efc5
test eax, eax
setne bh
mov al, bh
jmp 0x40f3c0