Function at 0x405600
Capabilities:
Create tcp socket
Create thread
Set socket configuration
Start tcp server

Disassembly:
sub esp, 0x8b0
push ebx
push ebp
push esi
push edi
mov ecx, 0x59
mov esi, str.__fFORMAT_logging_format__see_documentation__n__l_log_to_stderr_n__lFILENAME_log_to_FILENAME_n__bBUFSIZE_size_of_network_buffer__default_4096_for_TCP__16384_for_UDP__n__t_be_silenT__do_not_log_service_start_stop__n__iIP_ip_address_or_internal_interface__clients_are_expected_to_connect__n__eIP_ip_address_or_external_interface__outgoing_connection_will_have_this__n
lea edi, [esp + 0x758]
mov eax, dword [0x426038]
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
movsb byte es:[edi], byte [esi]
mov ecx, 0x129
mov esi, 0x426a58
lea edi, [esp + 0x2b4]
mov dword [esp + 0x40], eax
rep movsd dword es:[edi], dword [esi]
mov ecx, 0x56
xor eax, eax
lea edi, [esp + 0x44]
xor ebx, ebx
rep stosd dword es:[edi], eax
mov ecx, dword [0x42a7f4]
lea eax, [esp + 0x18]
mov dword [esp + 0x88], ecx
mov ecx, dword [esp + 0x744]
mov dword [esp + 0x70], eax
mov eax, dword [esp + 0x740]
mov dword [esp + 0x58], ecx
mov ecx, dword [esp + 0x738]
mov dword [esp + 0x5c], eax
mov eax, dword [0x426044]
mov edx, 1
push ebx
mov dword [esp + 0x14], ebx
mov dword [esp + 0x2c], edx
mov dword [esp + 0x30], ebx
mov dword [esp + 0x24], ebx
mov dword [esp + 0x18], 0x1388
mov dword [esp + 0x1c], ebx
mov dword [esp + 0xb0], ecx
mov dword [esp + 0x58], eax
mov dword [esp + 0x184], edx
mov dword [esp + 0x88], ebx
call fcn.004159a3
mov dword [esp + 0x190], eax
mov eax, dword [0x426e90]
add esp, 4
cmp eax, ebx
jne 0x4056db
lea ecx, [esp + 0x44]
jmp 0x4056ee
lea edx, [esp + 0x44]
mov dword [esp + 0x44], eax
mov dword [eax + 4], edx
mov eax, dword [0x426e90]
mov ecx, dword [eax + 4]
lea eax, [esp + 0x19c]
lea edx, [esp + 0x19c]
push eax
mov dword [0x426e90], ecx
mov dword [esp + 0x12c], edx
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov eax, dword [esp + 0x8c4]
mov ebp, 1
cmp eax, ebp
jle 0x405874
mov ecx, dword [esp + 0x8c8]
mov edi, 0x40fd10
lea esi, [ecx + 4]
mov eax, dword [esi]
cmp byte [eax], 0x2d
jne 0x405874
movsx ecx, byte [eax + 1]
add ecx, 0xffffff9f
cmp ecx, 0x13
ja case.0x405756.107
xor edx, edx
mov dl, byte [ecx + 0x406100]
jmp dword [edx*4 + 0x4060d4]
test ebx, ebx
jne 0x405767
call dword [sym.imp.KERNEL32.dll_FreeConsole]
mov ebx, 1
jmp 0x405861
mov dword [esp + 0x58], edi
mov eax, dword [esi]
push eax
call fcn.0041f827
mov dword [esp + 0x128], eax
mov eax, dword [esi]
add eax, 2
add esp, 4
cmp byte [eax], 0
je 0x405861
push 0x4212e0
push eax
call fcn.00414be1
add esp, 8
mov dword [esp + 0x2c], eax
test eax, eax
je 0x405861
push 2
push 0
push eax
mov dword [esp + 0x90], eax
call fcn.00415592
add esp, 0xc
jmp 0x405861
add eax, 2
push eax
call fcn.00410170
add esp, 4
mov dword [esp + 0x728], eax
jmp 0x405861
add eax, 2
push eax
call fcn.00410170
add esp, 4
mov dword [esp + 0x72c], eax
jmp 0x405861
add eax, 2
push eax
call fcn.00415cb7
add esp, 4
mov word [esp + 0x730], ax
jmp 0x405861
add eax, 2
push eax
call fcn.00415cb7
add esp, 4
mov dword [esp + 0x750], eax
jmp 0x405861
mov dword [esp + 0x180], 0
jmp 0x405861
add eax, 2
mov dword [esp + 0x120], eax
jmp 0x405861
mov dword [esp + 0x20], 1
jmp 0x405861
add eax, 2
push eax
call fcn.00415cb7
add esp, 4
inc eax
mov dword [esp + 0x734], eax
jmp 0x405861
mov dword [esp + 0x10], 1
mov eax, dword [esp + 0x8c4]
inc ebp
add esi, 4
cmp ebp, eax
jl 0x405733
mov edi, dword [sym.imp.WS2_32.dll_htons]
mov eax, dword [esp + 0x10]
xor ebx, ebx
cmp word [0x42603c], bx
je 0x4058d3
cmp eax, ebx
jne 0x40589a
cmp ebp, dword [esp + 0x8c4]
je 0x40594f
mov ecx, dword [esp + 0x8c8]
mov edx, dword [0x426048]
mov dword [0x42a790], 1
mov dword [0x426e94], ebx
mov eax, dword [ecx]
push 0x421208
push eax
lea ecx, [esp + 0x760]
push edx
push ecx
push eax
push str.Usage:__s_options_nAvailable_options_are:_n_s__pPORT___service_port_to_accept_connections_n_s_tExample:__s__i127.0.0.1_n_n_s
jmp 0x4060b5
cmp eax, ebx
jne 0x406081
mov eax, dword [esp + 0x8c4]
lea edx, [ebp + 3]
cmp eax, edx
jne 0x406081
mov esi, dword [esp + 0x8c8]
mov eax, dword [esi + ebp*4]
cmp byte [eax], 0x2d
je 0x406088
push eax
call fcn.00415cb7
add esp, 4
cmp ax, bx
mov word [esp + 0x730], ax
je 0x406088
mov eax, dword [esi + ebp*4 + 8]
push eax
call fcn.00415cb7
add esp, 4
push eax
call edi
cmp ax, bx
mov word [esp + 0x98], ax
je 0x406088
mov ecx, dword [esi + ebp*4 + 4]
push ecx
call fcn.0041f827
add esp, 4
mov dword [esp + 0x94], eax
mov ecx, dword [esp + 0x120]
cmp ecx, ebx
jne 0x40596e
mov eax, dword [esp + 0x74c]
mov ecx, eax
cmp eax, ebx
mov dword [esp + 0x120], ecx
je 0x4059dd
cmp byte [ecx], 0x2d
jne 0x4059c6
inc ecx
push 0x2b
push ecx
call fcn.00415b70
mov esi, eax
add esp, 8
cmp esi, ebx
je 0x4059c6
mov al, byte [esi + 1]
test al, al
je 0x4059c6
mov byte [esi], 0
mov edx, dword [esp + 0x120]
inc edx
push edx
call fcn.0041f827
mov dword [esp + 0x180], eax
mov al, byte [esi + 1]
lea ecx, [esi + 2]
mov byte [esp + 0x19e], al
push ecx
call fcn.0041f827
mov dword [esp + 0x128], eax
add esp, 8
mov byte [esi], 0x2b
jmp 0x4059dd
mov edx, dword [esp + 0x120]
push edx
call fcn.0041f827
add esp, 4
mov dword [esp + 0x120], eax
mov eax, dword [esp + 0x728]
cmp word [esp + 0x730], bx
mov dword [esp + 0xa0], eax
mov dword [esp + 0xec], eax
jne 0x405a0a
mov ax, word [0x42603c]
mov word [esp + 0x730], ax
mov ecx, dword [esp + 0x730]
push ecx
call edi
mov edx, dword [esp + 0x732]
mov word [esp + 0xa8], ax
mov word [esp + 0xea], ax
mov eax, dword [esp + 0x72c]
push edx
mov dword [esp + 0xa8], eax
mov dword [esp + 0x100], eax
call edi
mov ecx, dword [esp + 0x734]
mov edx, dword [esp + 0x750]
push ebx
push ebx
mov word [esp + 0xb2], ax
mov word [esp + 0x102], ax
push ebx
mov eax, 2
mov dword [esp + 0x120], ecx
mov cx, word [0x426a64]
push 6
or esi, 0xffffffff
push 1
push eax
mov dword [esp + 0x94], esi
mov dword [esp + 0x8c], esi
mov dword [esp + 0x90], esi
mov word [esp + 0x100], ax
mov word [esp + 0x110], ax
mov dword [esp + 0xfc], edx
mov dword [0x426e94], ebx
mov word [esp + 0x3c], 1
mov word [esp + 0x3e], cx
call dword [sym.imp.WS2_32.dll_WSASocketA]
mov ebp, eax
cmp ebp, esi
mov dword [esp + 0x10], ebp
jne 0x405aea
push str.socket__
call fcn.00414dbe
add esp, 4
mov eax, 0xfffffffe
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x8b0
ret
lea edx, [esp + 0x30]
push edx
push 0x8004667e
push ebp
call dword [sym.imp.WS2_32.dll_ioctlsocket]
lea eax, [esp + 0x28]
push 4
push eax
push 4
push 0xffff
push ebp
mov dword [esp + 0x80], ebp
call dword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
je 0x405b28
push str.setsockopt__
call fcn.00414dbe
add esp, 4
mov edi, dword [sym.imp.WS2_32.dll_bind]
lea ecx, [esp + 0xe8]
push 0x10
push ecx
push ebp
mov dword [esp + 0x28], 0x10
mov esi, 0x64
call edi
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
cmp eax, 0xffffffff
jne 0x405ba2
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
call fcn.00415f1a
push eax
lea edx, [esp + 0x1bc]
push str.bind__:__s
push edx
call fcn.00415314
lea eax, [esp + 0x1c4]
lea ecx, [esp + 0x54]
push eax
push ecx
call dword [esp + 0x70]
add esp, 0x18
shl esi, 1
je 0x405bfd
push esi
call ebx
mov edx, dword [esp + 0x1c]
lea eax, [esp + 0xe8]
push edx
push eax
push ebp
call edi
cmp eax, 0xffffffff
je 0x405b53
mov ecx, dword [esp + 0x724]
sar ecx, 4
inc ecx
push ecx
push ebp
call dword [sym.imp.WS2_32.dll_listen]
cmp eax, 0xffffffff
jne 0x405c14
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
call fcn.00415f1a
push eax
lea edx, [esp + 0x1bc]
push str.listen__:__s
push edx
call fcn.00415314
lea eax, [esp + 0x1c4]
lea ecx, [esp + 0x54]
push eax
push ecx
call dword [esp + 0x70]
add esp, 0x18
mov eax, 0xfffffffc
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x8b0
ret
push ebp
call dword [sym.imp.WS2_32.dll_closesocket]
pop edi
pop esi
pop ebp
mov eax, 0xfffffffd
pop ebx
add esp, 0x8b0
ret
mov esi, dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
call esi
mov dword [esp + 0x188], eax
mov eax, dword [esp + 0x20]
xor edi, edi
cmp eax, edi
jne 0x405c5d
call esi
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
lea edx, [esp + 0x1bc]
push str.Accepting_connections___u__u_
push edx
call fcn.00415314
lea eax, [esp + 0x1c4]
lea ecx, [esp + 0x54]
push eax
push ecx
call dword [esp + 0x70]
add esp, 0x18
mov dword [esp + 0xfc], edi
mov dword [esp + 0xec], edi
mov word [esp + 0xfa], di
mov word [esp + 0xea], di
mov edi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [esp + 0x38], ebp
mov word [esp + 0x3c], 1
mov esi, dword [esp + 0x14]
mov ecx, dword [0x42a7f4]
mov edx, dword [esp + 0x88]
cmp ecx, edx
jne 0x405f78
mov eax, dword [esp + 0x18]
cmp eax, dword [esp + 0x724]
jl 0x405d0f
inc esi
cmp esi, 0x1388
mov dword [esp + 0x14], esi
jle 0x405cf4
mov edx, dword [esp + 0x724]
push edx
push eax
lea eax, [esp + 0x1bc]
push str.Warning:_too_many_connected_clients___d__d_
push eax
call fcn.00415314
lea ecx, [esp + 0x1c4]
lea edx, [esp + 0x54]
push ecx
push edx
call dword [esp + 0x70]
add esp, 0x18
xor esi, esi
mov dword [esp + 0x14], esi
push 1
call ebx
mov ecx, dword [0x42a7f4]
mov edx, dword [esp + 0x88]
cmp ecx, edx
jne 0x405f78
jmp 0x405ca5
cmp ecx, edx
jne 0x405f78
test byte [esp + 0x3c], 1
je 0x405d82
push 0x3e8
lea eax, [esp + 0x3c]
push 1
push eax
call fcn.0040ef30
add esp, 0xc
cmp eax, 1
jge 0x405d8b
test eax, eax
je 0x405c90
call edi
push eax
call edi
push eax
call fcn.00415f1a
add esp, 4
lea ecx, [esp + 0x1b8]
push eax
push str.poll__:__s__d
push ecx
call fcn.00415314
lea edx, [esp + 0x1c4]
lea eax, [esp + 0x54]
push edx
push eax
call dword [esp + 0x70]
add esp, 0x18
call edi
cmp eax, 0x2733
jne 0x405d8b
jmp 0x405c90
push 1
call ebx
jmp 0x405c90
mov ecx, dword [0x42a7f4]
mov eax, dword [esp + 0x88]
cmp ecx, eax
jne 0x405f78
push 0
lea edx, [esp + 0x20]
push 0
lea eax, [esp + 0xf0]
push edx
push eax
push ebp
mov dword [esp + 0x30], 0x10
call dword [sym.imp.WS2_32.dll_WSAAccept]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x405e0f
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
call fcn.00415f1a
push eax
lea ecx, [esp + 0x1bc]
push str.accept__:__s
push ecx
call fcn.00415314
lea edx, [esp + 0x1c4]
lea eax, [esp + 0x54]
push edx
push eax
call dword [esp + 0x70]
mov esi, dword [esp + 0x2c]
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
mov edi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
add esp, 0x18
jmp 0x405c90
lea ecx, [esp + 0x30]
push ecx
push 0x8004667e
push ebx
call dword [sym.imp.WS2_32.dll_ioctlsocket]
mov esi, dword [sym.imp.WS2_32.dll_setsockopt]
lea edx, [esp + 0x24]
push 4
push edx
push 0x80
push 0xffff
push ebx
call esi
lea eax, [esp + 0x28]
push 4
push eax
push 0x100
push 0xffff
push ebx
call esi
push 0x158
call fcn.00415de0
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x405ea5
push ebx
call dword [sym.imp.WS2_32.dll_closesocket]
lea ecx, [esp + 0x44]
push str.Memory_Allocation_Failed
push ecx
mov dword [esp + 0x110], 0x15
call dword [esp + 0x60]
add esp, 8
push 1
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ebp, dword [esp + 0x10]
mov esi, dword [esp + 0x14]
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
mov edi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
jmp 0x405c90
mov ecx, 0x56
lea esi, [esp + 0x44]
mov edi, ebp
push ebp
rep movsd dword es:[edi], dword [esi]
call fcn.0040f3a0
add esp, 4
lea eax, [esp + 0x19c]
xor esi, esi
lea edx, [esp + 0x44]
push eax
mov dword [ebp + 0x30], ebx
mov dword [ebp], esi
mov dword [ebp + 4], esi
mov dword [ebp + 8], esi
mov dword [ebp + 0xc], edx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [esp + 0x4c]
cmp eax, esi
je 0x405ef0
mov dword [ebp], eax
mov ecx, dword [esp + 0x4c]
mov dword [ecx + 4], ebp
mov eax, dword [esp + 0x40]
lea edx, [esp + 0x34]
push edx
push 0
push ebp
push eax
push 0x4000
push 0
mov dword [esp + 0x64], ebp
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov ecx, dword [esp + 0x34]
test eax, eax
mov dword [ebp + 0x144], ecx
je 0x405f2e
mov edx, dword [esp + 0x18]
push eax
inc edx
mov dword [esp + 0x1c], edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x405f37
push ebp
call fcn.00414c58
add esp, 4
lea edx, [esp + 0x19c]
push edx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor eax, eax
mov edi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
mov ebp, dword [esp + 0x10]
mov dword [esp + 0xe8], eax
mov dword [esp + 0xec], eax
mov dword [esp + 0xf0], eax
mov dword [esp + 0xf4], eax
jmp 0x405c8c
mov eax, dword [esp + 0x6c]
cmp eax, 0xffffffff
je 0x405f88
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [esp + 0x20]
test eax, eax
jne 0x405fa1
lea ecx, [esp + 0x44]
push str.Exiting_thread
push ecx
call dword [esp + 0x60]
add esp, 8
mov eax, dword [esp + 0x4c]
mov dword [esp + 0x54], 0xc
test eax, eax
je 0x405fbd
push 0x64
call ebx
mov eax, dword [esp + 0x4c]
test eax, eax
jne 0x405fb1
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x188], 0
test eax, eax
je 0x405fd9
push eax
call fcn.00414d41
add esp, 4
mov eax, dword [esp + 0x94]
test eax, eax
je 0x405fed
push eax
call fcn.00414c58
add esp, 4
mov eax, dword [esp + 0x124]
test eax, eax
je 0x406001
push eax
call fcn.00414c58
add esp, 4
mov eax, dword [esp + 0x120]
test eax, eax
je 0x406015
push eax
call fcn.00414c58
add esp, 4
mov eax, dword [esp + 0x17c]
test eax, eax
je 0x406029
push eax
call fcn.00414c58
add esp, 4
mov eax, dword [esp + 0x44]
test eax, eax
je 0x40603c
mov edx, dword [esp + 0x48]
mov dword [eax + 4], edx
mov eax, dword [esp + 0x44]
mov ecx, dword [esp + 0x48]
test ecx, ecx
je 0x406061
mov dword [ecx], eax
lea eax, [esp + 0x19c]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x8b0
ret
mov dword [0x426e90], eax
lea eax, [esp + 0x19c]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x8b0
ret
mov esi, dword [esp + 0x8c8]
mov ecx, dword [0x426048]
mov dword [0x42a790], 1
mov dword [0x426e94], ebx
mov eax, dword [esi]
push 0x421208
push eax
lea edx, [esp + 0x760]
push ecx
push edx
push eax
push str.Usage:__s_options___e_external_ip____port_to_bind___target_hostname___target_port__nAvailable_options_are:_n_s_s_tExample:__s__d__i127.0.0.1_6666_serv.somehost.ru_6666_n_n_s
push 0x427730
call fcn.00415178
add esp, 0x1c
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x8b0
ret