Function at 0x406b00
Capabilities:
Get socket status
Receive data
Receive data on socket
Send data
Send data on socket
Set socket configuration

Disassembly:
sub esp, 0x3c4
mov eax, dword [0x411ce4]
xor eax, esp
mov dword [esp + 0x3c0], eax
push ebx
push ebp
push esi
mov esi, dword [esp + 0x3d4]
push edi
push 0
push 1
mov ebp, ecx
push 0x17
mov dword [esp + 0x1c], ebp
mov dword [esp + 0x24], 0
lea edi, [esi + 0x400]
lea ebx, [esi + 0x800]
mov dword [esp + 0x2c], 1
call dword [sym.imp.WSOCK32.dll_socket]
cmp eax, 0xffffffff
mov dword [esp + 0x14], eax
jne 0x406c2d
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
mov ebp, eax
cmp ebp, 0x273f
jne 0x406b80
push 0x95
mov ecx, 0x414df0
call fcn.00405400
xor eax, eax
jmp 0x406c12
push ebp
push 0x75
push 0x414df0
call fcn.004054e0
add esp, 0xc
test esi, esi
je 0x406bbc
push ebp
push 0x75
push ebx
push 0x414df0
call fcn.00405560
mov eax, str.failed
mov edx, edi
add esp, 0x10
sub edx, eax
mov edi, edi
mov cl, byte [eax]
mov byte [edx + eax], cl
add eax, 1
test cl, cl
jne 0x406bb0
mov ebp, dword [esp + 0x10]
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.WSOCK32.dll_closesocket]
mov esi, dword [sym.imp.KERNEL32.dll_InterlockedExchange]
push 0
lea edx, [ebp + 0x1464]
push edx
call esi
push 0x74
mov ecx, 0x414df0
call fcn.00405400
push 0
lea eax, [ebp + 0x1310]
push eax
call esi
mov eax, dword [ebp + 0x144c]
test eax, eax
je 0x406c04
push eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov eax, dword [esp + 0x18]
mov dword [ebp + 0x144c], 0
mov ecx, dword [esp + 0x3d0]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0040c056
add esp, 0x3c4
ret 4
push 4
lea ecx, [esp + 0x24]
push ecx
push 4
push 0xffff
push eax
call dword [sym.imp.WSOCK32.dll_setsockopt]
test eax, eax
je 0x406c51
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
jmp 0x406bc0
mov edx, dword [0x40db70]
mov ecx, dword [0x40db78]
xor eax, eax
mov dword [esp + 0x134], eax
mov dword [esp + 0x13c], eax
mov dword [esp + 0x140], eax
mov dword [esp + 0x144], eax
mov dword [esp + 0x148], eax
mov dword [esp + 0x138], eax
mov dword [esp + 0x14c], eax
mov eax, dword [0x40db74]
mov dword [esp + 0x140], eax
movzx eax, word [ebp + 0xc]
mov dword [esp + 0x13c], edx
mov edx, dword [0x40db7c]
push eax
mov word [esp + 0x138], 0x17
mov dword [esp + 0x148], ecx
mov dword [esp + 0x14c], edx
call dword [sym.imp.WSOCK32.dll_htons]
mov edx, dword [esp + 0x14]
push 0x1c
lea ecx, [esp + 0x138]
push ecx
push edx
mov word [esp + 0x142], ax
call dword [sym.imp.WSOCK32.dll_bind]
test eax, eax
je 0x406d41
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
mov ebp, eax
push ebp
push 0x76
push 0x414df0
call fcn.004054e0
add esp, 0xc
test esi, esi
mov dword [esp + 0x18], 0x7d8
je 0x406bbc
push ebp
push 0x76
push ebx
push 0x414df0
call fcn.00405560
mov eax, str.failed
mov edx, edi
add esp, 0x10
sub edx, eax
nop
mov cl, byte [eax]
mov byte [edx + eax], cl
add eax, 1
test cl, cl
jne 0x406d30
jmp 0x406bbc
mov eax, dword [esp + 0x14]
push 0x80
push eax
call dword [sym.imp.WSOCK32.dll_listen]
cmp eax, 0xffffffff
jne 0x406da9
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
mov ebp, eax
push ebp
push 0x77
push 0x414df0
call fcn.004054e0
add esp, 0xc
test esi, esi
mov dword [esp + 0x18], 0x7d9
je 0x406bbc
push ebp
push 0x77
push ebx
push 0x414df0
call fcn.00405560
mov eax, str.failed
mov edx, edi
add esp, 0x10
sub edx, eax
mov cl, byte [eax]
mov byte [edx + eax], cl
add eax, 1
test cl, cl
jne 0x406d98
jmp 0x406bbc
test esi, esi
je 0x406e55
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
xor esi, esi
lea esp, [esp]
add esi, 1
mov ecx, str.UdpOK
mov eax, edi
lea ebx, [ebx]
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x406df0
test dl, dl
je 0x406dec
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x406df0
add eax, 2
add ecx, 2
test dl, dl
jne 0x406dd0
xor eax, eax
jmp 0x406df5
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x406e37
mov ecx, str.failed
mov eax, edi
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x406e20
test dl, dl
je 0x406e1c
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x406e20
add eax, 2
add ecx, 2
test dl, dl
jne 0x406e00
xor eax, eax
jmp 0x406e25
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x406e4c
push 0x1f4
call ebx
cmp esi, 0x14
jl 0x406dc0
jmp 0x406e4c
mov eax, 0x40da90
mov edx, edi
sub edx, eax
mov cl, byte [eax]
mov byte [edx + eax], cl
add eax, 1
test cl, cl
jne 0x406e40
cmp esi, 0x14
je 0x406bc0
mov ecx, dword [ebp + 0xc]
push ecx
push 0x78
push 0x414df0
call fcn.004054e0
add esp, 0xc
push 1
lea edx, [ebp + 0x1464]
push edx
call dword [sym.imp.KERNEL32.dll_InterlockedExchange]
cmp dword [ebp + 0x1310], 0
jne 0x406bc0
jmp 0x406e90
mov eax, dword [ebp + 0x14]
mov edi, dword [esp + 0x14]
mov esi, dword [sym.imp.WSOCK32.dll_select]
lea ecx, [esp + 0x24]
push ecx
push 0
push 0
lea edx, [esp + 0x3c]
push edx
push 0
mov dword [esp + 0x48], edi
mov dword [esp + 0x44], 1
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], 0
mov dword [esp + 0x40], 0x1c
call esi
test eax, eax
je 0x407077
cmp eax, 0xffffffff
je 0x407077
lea eax, [esp + 0x2c]
push eax
lea ecx, [esp + 0x170]
push ecx
push edi
call dword [sym.imp.WSOCK32.dll_accept]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x406f19
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
push str.TCP:Accept_Error_code__d_n
push 0x414df0
call fcn.00405460
add esp, 0xc
jmp 0x40708f
lea edx, [esp + 0x30]
push edx
push ebx
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
jne 0x406f4f
mov ecx, dword [esp + 0x30]
test ecx, ecx
jbe 0x406f3d
cmp dword [esp + eax*4 + 0x34], ebx
je 0x406f3d
add eax, 1
cmp eax, ecx
jb 0x406f30
cmp eax, ecx
jne 0x406f4f
cmp ecx, 0x40
jae 0x406f4f
mov dword [esp + eax*4 + 0x34], ebx
add dword [esp + 0x30], 1
lea eax, [esp + 0x24]
push eax
push 0
push 0
lea ecx, [esp + 0x3c]
push ecx
lea edx, [ebx + 1]
push edx
call esi
test eax, eax
je 0x407077
cmp eax, 0xffffffff
je 0x407077
push 0
push 0x200
lea eax, [esp + 0x194]
push eax
push ebx
call dword [sym.imp.WSOCK32.dll_recv]
mov ebp, eax
cmp ebp, 0xffffffff
jne 0x406fba
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
push 0x8d
push 0x414df0
call fcn.004054e0
add esp, 0xc
push ebx
call dword [sym.imp.WSOCK32.dll_closesocket]
mov ebp, dword [esp + 0x10]
jmp 0x40708f
mov ecx, 7
lea esi, [esp + 0x16c]
lea edi, [esp + 0x150]
rep movsd dword es:[edi], dword [esi]
mov esi, dword [esp + 0x10]
cmp dword [esi + 0x1460], 0
je 0x40701e
lea ecx, [esp + 0x1c]
push ecx
lea edx, [esp + 0x390]
push edx
push 0
push 0x1c
lea eax, [esp + 0x160]
push eax
mov dword [esp + 0x30], 0x41
call dword [sym.imp.WS2_32.dll_WSAAddressToStringA]
push ebp
lea ecx, [esp + 0x390]
push ecx
push str.TCP_Recv_data__ip_s__len_d_n
push 0x414df0
call fcn.00405460
add esp, 0x10
push ebp
lea edx, [esp + 0x170]
push edx
mov ecx, esi
call fcn.004065a0
test eax, eax
je 0x40706c
push 0
push eax
lea eax, [esp + 0x194]
push eax
push ebx
call dword [sym.imp.WSOCK32.dll_send]
test eax, eax
je 0x407056
cmp dword [esi + 0x1460], 0
je 0x40706c
push eax
push 0x79
jmp 0x40705f
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
push 0x7a
push 0x414df0
call fcn.004054e0
add esp, 0xc
push ebx
call dword [sym.imp.WSOCK32.dll_closesocket]
mov ebp, esi
jmp 0x40708f
cmp dword [ebp + 0x1460], 4
jl 0x40708f
push str.Tcp_Time_out._n
mov ecx, 0x414df0
call fcn.00405350
cmp dword [ebp + 0x1310], 0
je 0x406e90
jmp 0x406bc0