Function at 0x409ad0
Capabilities:
Get socket status
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
mov eax, 0x1634
call fcn.0040f7b0
push ebx
push ebp
push esi
mov ebp, ecx
push edi
xor ebx, ebx
mov ecx, 7
xor eax, eax
lea edi, [esp + 0x21]
mov byte [esp + 0x20], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov eax, dword [esp + 0x1648]
push eax
call dword [sym.imp.WS2_32.dll_inet_ntoa]
mov edi, eax
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x20]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
mov dx, word [ebp + 0xc]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, 0x3f
lea edi, [esp + 0x39d]
mov byte [esp + 0x39c], bl
mov byte [esp + 0x98], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0x3f
xor eax, eax
lea edi, [esp + 0x99]
mov byte [esp + 0x49c], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0x3f
xor eax, eax
lea edi, [esp + 0x49d]
mov byte [esp + 0x644], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0x3ff
xor eax, eax
lea edi, [esp + 0x645]
mov esi, 0x416000
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0x2a
lea edi, [esp + 0x59c]
rep movsd dword es:[edi], dword [esi]
mov ecx, 0x15
mov esi, 0x415fa8
lea edi, [esp + 0x40]
mov eax, dword [esp + 0x1648]
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [ebp + 0x10]
push ecx
mov ecx, dword [ebp + 4]
push edx
push eax
push ecx
movsb byte es:[edi], byte [esi]
call fcn.0040df60
add esp, 0x10
mov ecx, 1
cmp eax, ecx
jge 0x409c07
cmp dword [0x41679c], ecx
jbe 0x409bf8
mov edx, dword [ebp + 0xc]
lea eax, [esp + 0x20]
push edx
push eax
push str._s__d_Closed__n
call dword [sym.imp.MSVCRT.dll_printf]
add esp, 0xc
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x1634
ret 4
mov eax, dword [ebp + 4]
mov dword [esp + 0x298], ecx
mov ecx, dword [ebp + 0x10]
push ebx
mov dword [esp + 0x1c], ecx
lea ecx, [esp + 0x5a0]
push 0xa8
lea edx, [eax + 1]
push ecx
push eax
mov dword [esp + 0x2ac], eax
mov dword [esp + 0x2c], ebx
xor esi, esi
mov dword [esp + 0x24], edx
call dword [sym.imp.WS2_32.dll_send]
cmp eax, 0xffffffff
jne 0x409c57
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str.Send_Error1:__d_n
jmp 0x409ebb
mov ecx, dword [esp + 0x14]
lea edx, [esp + 0x18]
push edx
push ebx
lea eax, [esp + 0x2a0]
push ebx
push eax
push ecx
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
je 0x409e77
mov eax, dword [ebp + 4]
lea edx, [esp + 0x298]
push edx
push eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x409c9b
mov eax, esi
sub eax, ebx
je 0x409ca6
dec eax
je 0x409d98
cmp esi, 2
jae 0x409dcc
jmp 0x409c57
mov edx, dword [ebp + 4]
push ebx
lea ecx, [esp + 0x648]
push 0x1000
push ecx
push edx
call dword [sym.imp.WS2_32.dll_recv]
cmp eax, 0xffffffff
je 0x409ec4
cmp eax, 0x2d
mov dword [esp + 0x10], 1
jbe 0x409ec4
mov edx, dword [esp + 0x68b]
and edx, 0xffff
sub edx, 8
cmp edx, ebx
jle 0x409ec4
cmp edx, 0x7f
jg 0x409ec4
mov ecx, 0x3f
xor eax, eax
lea edi, [esp + 0x19a]
mov word [esp + 0x198], bx
rep stosd dword es:[edi], eax
mov ecx, edx
lea esi, [esp + 0x695]
stosw word es:[edi], ax
mov eax, ecx
lea edi, [esp + 0x198]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
xor eax, eax
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x198]
cmp word [ecx], bx
je 0x409d4c
inc eax
add ecx, 2
cmp eax, 0x80
jl 0x409d3a
jmp 0x409d56
mov word [esp + eax*2 + 0x198], 0x5c
lea ecx, [esp + 0x198]
lea edx, [esp + 0x39c]
push ecx
push 0x415f90
push edx
call dword [sym.imp.MSVCRT.dll_sprintf]
mov ecx, dword [ebp + 4]
add esp, 0xc
lea eax, [esp + 0x40]
push ebx
push 0x55
push eax
push ecx
call dword [sym.imp.WS2_32.dll_send]
cmp eax, 0xffffffff
je 0x409eaf
mov esi, dword [esp + 0x10]
jmp 0x409c57
mov eax, dword [ebp + 4]
push ebx
lea edx, [esp + 0x648]
push 0x1000
push edx
push eax
call dword [sym.imp.WS2_32.dll_recv]
cmp eax, 0xffffffff
je 0x409ea1
cmp dword [esp + 0x64d], ebx
je 0x409e29
mov ecx, dword [ebp + 4]
push ecx
call dword [sym.imp.WS2_32.dll_closesocket]
mov ecx, dword [esp + 0x1648]
push ecx
mov ecx, ebp
call fcn.0040a000
add ebp, 0x14
lea edx, [esp + 0x98]
push ebp
lea eax, [esp + 0x3a0]
push edx
lea ecx, [esp + 0x28]
push eax
push ecx
lea edx, [esp + 0x4ac]
push str._s__s__s___s__n
push edx
call dword [sym.imp.MSVCRT.dll_sprintf]
lea eax, [esp + 0x4b4]
push eax
call fcn.0040ebf0
add esp, 0x1c
mov eax, 2
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1634
ret 4
mov ecx, dword [esp + 0x66f]
lea esi, [esp + 0x671]
and ecx, 0xffff
lea edi, [esp + 0x98]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
xor eax, eax
rep movsb byte es:[edi], byte [esi]
cmp byte [esp + eax + 0x98], bl
je 0x409e6a
inc eax
cmp eax, 0x1000
jl 0x409e54
jmp 0x409dcc
mov byte [esp + eax + 0x98], 0x20
jmp 0x409dcc
push str.time_out_n
call dword [sym.imp.MSVCRT.dll_printf]
mov eax, dword [ebp + 4]
add esp, 4
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x1634
ret 4
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str.Recv_Error:__d_n
jmp 0x409ebb
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str.Send_Error2:__d_n
call dword [sym.imp.MSVCRT.dll_printf]
add esp, 8
mov eax, dword [ebp + 4]
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x1634
ret 4