Function at 0x40e9ae
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.0040e505
test al, al
je 0x40ec11
cmp byte [ebp + 0x73], 0
je 0x40ec11
movzx eax, byte [ebp + 0x73]
push esi
lea ecx, [ebp - 0x290]
push ecx
push dword [ebp + 0x7c]
call fcn.0040e505
test al, al
je 0x40ec11
movzx eax, byte [ebp + 0x73]
jmp 0x40ea0d
dec eax
cmp byte [ebp + eax - 0x290], 0
je 0x40ea4e
cmp eax, esi
jne 0x40ea02
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.0040e568
test al, al
je 0x40ec11
cmp word [ebp + 0x54], di
jne 0x40ea57
mov al, 1
jmp 0x40ec13
lea eax, [ebp + eax - 0x290]
jmp 0x40ea13
push esi
lea eax, [ebp + 0x44]
push eax
push dword [ebp + 0x7c]
mov byte [ebp + 0x6f], 0
push 4
pop eax
call fcn.0040e505
test al, al
je 0x40ec11
cmp byte [ebp + 0x44], 5
jne 0x40ec11
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 0x40ebb7
sub eax, ebx
je 0x40eae9
dec eax
jne 0x40ec11
push esi
lea eax, [ebp - 0x3c]
push eax
push dword [ebp + 0x7c]
mov eax, edi
call fcn.0040e505
test al, al
je 0x40ec11
push 0x1c
pop eax
call fcn.0040d29c
mov dword [ebp + 0x60], eax
cmp eax, esi
je 0x40ebd9
push 0x17
pop ecx
mov word [eax], cx
mov dword [ebp + 0x68], 0x1c
push edi
lea ecx, [ebp - 0x3c]
add eax, 8
jmp 0x40ebef
push esi
lea eax, [ebp + 0x6e]
push eax
push dword [ebp + 0x7c]
xor eax, eax
inc eax
call fcn.0040e505
test al, al
je 0x40ec11
cmp byte [ebp + 0x6e], 0
je 0x40ec11
movzx eax, byte [ebp + 0x6e]
push esi
lea ecx, [ebp - 0x290]
push ecx
push dword [ebp + 0x7c]
call fcn.0040e505
test al, al
je 0x40ec11
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 0x40eb56
mov byte [ebp + 0x6f], 4
jmp 0x40ebf6
xor cl, cl
mov edi, dword [ebp + 0x4c]
cmp edi, esi
je 0x40eb72
movzx eax, cl
mov eax, dword [ebp + eax*4 + 4]
cmp dword [edi + 4], eax
je 0x40eb8b
mov edi, dword [edi + 0x1c]
cmp edi, esi
jne 0x40eb66
inc cl
cmp cl, 2
jb 0x40eb58
mov byte [ebp + 0x6f], 4
push dword [ebp + 0x4c]
call dword [sym.imp.ws2_32.dll_freeaddrinfo]
push 0x10
pop edi
jmp 0x40ebf6
push dword [edi + 0x10]
push dword [edi + 0x18]
call fcn.0040d302
mov dword [ebp + 0x60], eax
cmp eax, esi
jne 0x40eba3
mov byte [ebp + 0x6f], 1
jmp 0x40eb7d
cmp word [eax], 0x17
mov ecx, dword [edi + 0x10]
mov dword [ebp + 0x68], ecx
jne 0x40eb7d
mov dword [eax + 0x18], esi
mov dword [eax + 4], esi
jmp 0x40eb7d
push esi
lea eax, [ebp - 4]
push eax
push dword [ebp + 0x7c]
push 4
pop eax
call fcn.0040e505
test al, al
je 0x40ec11
mov eax, edi
call fcn.0040d29c
mov dword [ebp + 0x60], eax
cmp eax, esi
jne 0x40ebdf
mov byte [ebp + 0x6f], 1
jmp 0x40ebf6
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.0040d2eb
push esi
lea eax, [ebp + 0x3c]
push eax
push dword [ebp + 0x7c]
mov eax, ebx
call fcn.0040e505
test al, al
jne 0x40ec1d
push dword [ebp + 0x60]
call fcn.0040d2af
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 0x40f1bb
mov ax, word [ebp + 0x3c]
mov ecx, dword [ebp + 0x60]
mov word [ecx + 2], ax
movzx eax, byte [ebp + 0x45]
dec eax
je 0x40f175
dec eax
je 0x40f0c5
dec eax
je 0x40ec54
mov byte [ebp + 0x6f], 7
jmp 0x40f1bb
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 0x40f12e
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 0x40f12e
cmp word [ebp + 0x14], 0x17
mov word [ebp + 0x16], ax
jne 0x40eca0
mov dword [ebp + 0x2c], esi
mov dword [ebp + 0x18], esi
push dword [ebp + 0x10]
lea edi, [ebp + 0x14]
call fcn.0040e87a
mov dword [ebp + 0x58], eax
cmp eax, 0xffffffff
je 0x40f12e
mov eax, 0xffff
call fcn.0040d29c
mov ebx, eax
cmp ebx, esi
jne 0x40ecd0
mov byte [ebp + 0x6f], 1
jmp 0x40f0bd
mov edi, dword [ebp + 0x7c]
push esi
push esi
push dword [ebp + 0x58]
push edi
call fcn.0040e8b0
cmp eax, 1
jne 0x40f0a8
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 0x40f07f
push edi
lea eax, [ebp - 0x190]
call fcn.0040e46c
test al, al
je 0x40ed39
push esi
push 0xffff
push ebx
push edi
call dword [sym.imp.ws2_32.dll_recv]
test eax, eax
jle 0x40f09e
push dword [ebp + 0x58]
lea eax, [ebp - 0x190]
mov dword [ebp + 0x64], 0x26
call fcn.0040e46c
test al, al
je 0x40efab
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 0x40f09e
cmp edi, 6
jb 0x40efab
mov ax, word [ebp + 0x14]
cmp word [ebp - 0x64], ax
jne 0x40efab
cmp ax, 2
jne 0x40eda0
mov eax, dword [ebp - 0x60]
cmp eax, dword [ebp + 0x18]
jmp 0x40edb5
cmp ax, 0x17
jne 0x40edbb
push 0x10
lea eax, [ebp + 0x1c]
lea ecx, [ebp - 0x5c]
call fcn.0040d32b
test eax, eax
jne 0x40efab
cmp byte [ebx + 2], 0
jne 0x40efab
cmp word [ebx], si
jne 0x40efab
cmp dword [ebp + 0x54], esi
jne 0x40edf6
push dword [ebp + 0x64]
lea eax, [ebp + 0x14]
push eax
lea eax, [ebp - 0x2c]
push eax
call fcn.0040d2eb
cmp word [ebp - 0x2c], 0x17
jne 0x40edf0
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.0040d35b
movzx eax, byte [ebx + 3]
dec eax
je 0x40eeea
dec eax
dec eax
je 0x40ee44
dec eax
jne 0x40efab
cmp edi, 0x16
jle 0x40efab
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.0040d2eb
push 0x14
jmp 0x40ef12
mov al, byte [ebx + 4]
test al, al
je 0x40efab
movzx eax, al
lea ecx, [eax + 7]
cmp edi, ecx
jle 0x40efab
push eax
lea ecx, [ebx + 5]
push ecx
lea ecx, [ebp - 0x390]
push ecx
call fcn.0040d2eb
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 0x40efab
xor dl, dl
mov eax, dword [ebp + 0x48]
cmp eax, esi
je 0x40eeb3
movzx ecx, dl
mov ecx, dword [ebp + ecx*4 + 4]
cmp dword [eax + 4], ecx
je 0x40eebf
mov eax, dword [eax + 0x1c]
cmp eax, esi
jne 0x40eea7
inc dl
cmp dl, 2
jb 0x40ee99
jmp 0x40efab
mov ecx, dword [eax + 0x10]
push ecx
mov dword [ebp + 0x64], ecx
push dword [eax + 0x18]
lea eax, [ebp + 0x14]
push eax
call fcn.0040d2eb
cmp word [ebp + 0x14], 0x17
jne 0x40eedf
mov dword [ebp + 0x2c], esi
mov dword [ebp + 0x18], esi
push dword [ebp + 0x48]
call dword [sym.imp.ws2_32.dll_freeaddrinfo]
jmp 0x40ef13
cmp edi, 0xa
jle 0x40efab
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.0040d2eb
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 0x40ef83
push 0x26
push esi
lea eax, [ebp - 0x8c]
push eax
call fcn.0040d36d
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.0040e87a
mov dword [ebp + 0x5c], eax
cmp eax, 0xffffffff
je 0x40f09e
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 0x40efab
movzx eax, word [ebp + 0x14]
cmp dword [ebp + 0x68], eax
jne 0x40efab
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 0x40f05a
push dword [ebp + 0x5c]
lea eax, [ebp - 0x190]
call fcn.0040e46c
test al, al
je 0x40f05a
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 0x40eff9
movzx ecx, word [ebp + 0x14]
cmp dword [ebp + 0x68], ecx
jne 0x40f05a
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 0x40f020
push 0x10
lea ecx, [ebp + 0x1c]
jmp 0x40f02b
cmp dword [ebp + 0x68], 2
jne 0x40f05a
push 4
lea ecx, [ebp + 0x18]
push ecx
lea ecx, [ebx + 4]
push ecx
call fcn.0040d2eb
push 2
lea ecx, [ebp + 0x16]
push ecx
lea ecx, [edi + ebx - 2]
push ecx
call fcn.0040d2eb
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 0x40ed13
mov esi, dword [ebp + 0x5c]
call fcn.0040e864
jmp 0x40f0b7
cmp eax, 0xffffffff
jne 0x40f0b3
mov byte [ebp + 0x6f], 1
jmp 0x40f0b7
mov byte [ebp + 0x73], 0
push ebx
call fcn.0040d2af
mov esi, dword [ebp + 0x58]
jmp 0x40f1b6
xor eax, eax
cmp word [ecx], 0x17
mov word [ecx + 2], ax
jne 0x40f0dd
push edi
add ecx, 8
push ecx
call fcn.0040d35b
jmp 0x40f0e0
mov dword [ecx + 4], esi
mov edi, dword [ebp + 0x60]
push 1
push dword [ebp + 0x68]
call fcn.0040e5bc
mov edi, eax
mov dword [ebp + 0x50], edi
cmp edi, 0xffffffff
jne 0x40f100
mov byte [ebp + 0x6f], 5
jmp 0x40f1bb
push esi
push esi
push edi
push dword [ebp + 0x7c]
call fcn.0040e8b0
mov ebx, eax
cmp ebx, 1
jne 0x40f15e
lea eax, [ebp + 0x7c]
push eax
lea eax, [ebp + 0x50]
push eax
call fcn.0040e83f
mov esi, dword [ebp + 0x50]
mov ebx, eax
call fcn.0040e864
cmp ebx, 0xffffffff
jne 0x40f137
mov byte [ebp + 0x6f], 1
jmp 0x40f1bb
mov edi, dword [ebp + 0x7c]
push 2
push 0
push ebx
push edi
call fcn.0040e8b0
mov dword [ebp + 0x40], eax
cmp eax, 1
jne 0x40f152
call fcn.0040e601
mov esi, ebx
call fcn.0040e864
mov ebx, dword [ebp + 0x40]
jmp 0x40f165
mov esi, edi
call fcn.0040e864
cmp ebx, 0xffffffff
je 0x40f12e
cmp ebx, 1
je 0x40f1bb
mov byte [ebp + 0x73], 0
jmp 0x40f1bb
push dword [ebp + 0x68]
mov edi, dword [ebp + 0x60]
call fcn.0040e586
mov ebx, eax
cmp ebx, 0xffffffff
je 0x40f0f7
push esi
push esi
push ebx
push dword [ebp + 0x7c]
call fcn.0040e8b0
cmp eax, 1
jne 0x40f1a5
mov edi, dword [ebp + 0x7c]
call fcn.0040e601
jmp 0x40f1b4
cmp eax, 0xffffffff
jne 0x40f1b0
mov byte [ebp + 0x6f], 1
jmp 0x40f1b4
mov byte [ebp + 0x73], 0
mov esi, ebx
call fcn.0040e864
push dword [ebp + 0x60]
call fcn.0040d2af
mov al, byte [ebp + 0x73]
cmp al, 1
jne 0x40ec13
cmp byte [ebp + 0x6f], 0
je 0x40ec13
push 0
push dword [ebp + 0x6f]
push 0xffffffffffffffff
push dword [ebp + 0x7c]
call fcn.0040e8b0
test eax, eax
setne al
jmp 0x40ec13