Function at 0x406120
Capabilities:
Create thread
Create udp socket
Resolve function by parsing pe exports
Set socket configuration

Disassembly:
sub esp, 0x8ac
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 + 0x754]
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 + 0x2b0]
mov dword [esp + 0x30], eax
rep movsd dword es:[edi], dword [esi]
mov ecx, 0x56
xor eax, eax
lea edi, [esp + 0x3c]
xor ebx, ebx
rep stosd dword es:[edi], eax
mov ecx, dword [0x42a7f4]
lea eax, [esp + 0x10]
mov dword [esp + 0x80], ecx
mov ecx, dword [esp + 0x740]
mov dword [esp + 0x68], eax
mov eax, dword [esp + 0x73c]
mov dword [esp + 0x50], ecx
mov ecx, dword [esp + 0x734]
mov dword [esp + 0x54], eax
mov eax, dword [0x426044]
mov edx, 1
push ebx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x24], ebx
mov dword [esp + 0x38], edx
mov dword [esp + 0x30], ebx
mov dword [esp + 0x18], ebx
mov dword [esp + 0x28], 0x1388
mov dword [esp + 0x14], ebx
mov dword [esp + 0xa8], ecx
mov dword [esp + 0x50], eax
mov dword [esp + 0x17c], edx
mov dword [esp + 0x80], ebx
call fcn.004159a3
mov dword [esp + 0x188], eax
mov eax, dword [0x426e90]
add esp, 4
cmp eax, ebx
jne 0x4061ff
lea ecx, [esp + 0x3c]
jmp 0x406212
lea edx, [esp + 0x3c]
mov dword [esp + 0x3c], eax
mov dword [eax + 4], edx
mov eax, dword [0x426e90]
mov ecx, dword [eax + 4]
lea eax, [esp + 0x198]
lea edx, [esp + 0x198]
push eax
mov dword [0x426e90], ecx
mov dword [esp + 0x124], edx
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov eax, dword [esp + 0x8c0]
mov ebp, 1
cmp eax, ebp
jle 0x406395
mov ecx, dword [esp + 0x8c4]
mov edi, 0x40fd10
lea esi, [ecx + 4]
mov eax, dword [esi]
cmp byte [eax], 0x2d
jne 0x406395
movsx ecx, byte [eax + 1]
add ecx, 0xffffff9f
cmp ecx, 0x13
ja case.0x40627a.107
xor edx, edx
mov dl, byte [ecx + 0x406aec]
jmp dword [edx*4 + 0x406ac0]
cmp dword [esp + 0x28], ebx
jne 0x40628d
call dword [sym.imp.KERNEL32.dll_FreeConsole]
mov dword [esp + 0x28], 1
jmp 0x406382
mov dword [esp + 0x50], edi
mov eax, dword [esi]
push eax
call fcn.0041f827
mov dword [esp + 0x120], eax
mov eax, dword [esi]
add eax, 2
add esp, 4
cmp byte [eax], 0
je 0x406382
push 0x4212e0
push eax
call fcn.00414be1
add esp, 8
cmp eax, ebx
mov dword [esp + 0x2c], eax
je 0x406382
push 2
push ebx
push eax
mov dword [esp + 0x88], eax
call fcn.00415592
add esp, 0xc
jmp 0x406382
add eax, 2
push eax
call fcn.00410170
add esp, 4
mov dword [esp + 0x724], eax
jmp 0x406382
add eax, 2
push eax
call fcn.00410170
add esp, 4
mov dword [esp + 0x728], eax
jmp 0x406382
add eax, 2
push eax
call fcn.00415cb7
add esp, 4
mov word [esp + 0x72c], ax
jmp 0x406382
add eax, 2
push eax
call fcn.00415cb7
add esp, 4
mov dword [esp + 0x74c], eax
jmp 0x406382
mov dword [esp + 0x178], ebx
jmp 0x406382
add eax, 2
mov dword [esp + 0x118], eax
jmp 0x406382
mov dword [esp + 0x14], 1
jmp 0x406382
add eax, 2
push eax
call fcn.00415cb7
add esp, 4
inc eax
mov dword [esp + 0x730], eax
jmp 0x406382
mov dword [esp + 0x20], 1
mov eax, dword [esp + 0x8c0]
inc ebp
add esi, 4
cmp ebp, eax
jl 0x406257
cmp word [0x42603c], bx
mov edi, dword [sym.imp.WS2_32.dll_htons]
mov eax, dword [esp + 0x20]
je 0x4063f2
cmp eax, ebx
jne 0x4063b9
cmp ebp, dword [esp + 0x8c0]
je 0x40646e
mov ecx, dword [esp + 0x8c4]
mov edx, dword [0x426048]
mov dword [0x42a790], 1
mov dword [0x426e94], ebx
mov eax, dword [ecx]
push 0x421208
push eax
lea ecx, [esp + 0x75c]
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 0x406aa1
cmp eax, ebx
jne 0x406a6d
mov eax, dword [esp + 0x8c0]
lea edx, [ebp + 3]
cmp eax, edx
jne 0x406a6d
mov esi, dword [esp + 0x8c4]
mov eax, dword [esi + ebp*4]
cmp byte [eax], 0x2d
je 0x406a74
push eax
call fcn.00415cb7
add esp, 4
cmp ax, bx
mov word [esp + 0x72c], ax
je 0x406a74
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 + 0x90], ax
je 0x406a74
mov ecx, dword [esi + ebp*4 + 4]
push ecx
call fcn.0041f827
add esp, 4
mov dword [esp + 0x8c], eax
mov ecx, dword [esp + 0x118]
cmp ecx, ebx
jne 0x40648d
mov eax, dword [esp + 0x748]
mov ecx, eax
cmp eax, ebx
mov dword [esp + 0x118], ecx
je 0x4064fc
cmp byte [ecx], 0x2d
jne 0x4064e5
inc ecx
push 0x2b
push ecx
call fcn.00415b70
mov esi, eax
add esp, 8
cmp esi, ebx
je 0x4064e5
mov al, byte [esi + 1]
test al, al
je 0x4064e5
mov byte [esi], 0
mov edx, dword [esp + 0x118]
inc edx
push edx
call fcn.0041f827
mov dword [esp + 0x178], eax
mov al, byte [esi + 1]
lea ecx, [esi + 2]
mov byte [esp + 0x196], al
push ecx
call fcn.0041f827
mov dword [esp + 0x120], eax
add esp, 8
mov byte [esi], 0x2b
jmp 0x4064fc
mov edx, dword [esp + 0x118]
push edx
call fcn.0041f827
add esp, 4
mov dword [esp + 0x118], eax
mov eax, dword [esp + 0x724]
cmp word [esp + 0x72c], bx
mov dword [esp + 0x98], eax
mov dword [esp + 0xe4], eax
jne 0x406529
mov ax, word [0x42603c]
mov word [esp + 0x72c], ax
mov ecx, dword [esp + 0x72c]
push ecx
call edi
mov edx, dword [esp + 0x72e]
mov word [esp + 0xa0], ax
mov word [esp + 0xe2], ax
mov eax, dword [esp + 0x728]
push edx
mov dword [esp + 0xa0], eax
mov dword [esp + 0xf8], eax
call edi
mov ecx, dword [esp + 0x730]
mov edx, dword [esp + 0x74c]
push ebx
mov word [esp + 0xa6], ax
mov word [esp + 0xf6], ax
push ebx
mov eax, 2
push ebx
push 0x11
or edi, 0xffffffff
push eax
push eax
mov dword [esp + 0x8c], edi
mov dword [esp + 0x84], edi
mov dword [esp + 0x88], edi
mov word [esp + 0xf8], ax
mov word [esp + 0x108], ax
mov dword [esp + 0x124], ecx
mov dword [esp + 0xf4], edx
mov dword [0x426e94], ebx
call dword [sym.imp.WS2_32.dll_WSASocketA]
mov esi, eax
cmp esi, edi
jne 0x4065f1
push str.socket__
call fcn.00414dbe
add esp, 4
mov eax, 0xfffffffe
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x8ac
ret
lea eax, [esp + 0x194]
push eax
push 0x8004667e
push esi
call dword [sym.imp.WS2_32.dll_ioctlsocket]
lea ecx, [esp + 0x34]
push 4
push ecx
push 4
push 0xffff
push esi
mov dword [esp + 0x78], esi
call dword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
je 0x40662f
push str.setsockopt__
call fcn.00414dbe
add esp, 4
mov ebp, dword [sym.imp.WS2_32.dll_bind]
lea edx, [esp + 0xe0]
push 0x10
push edx
push esi
mov edi, 0x64
call ebp
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
cmp eax, 0xffffffff
jne 0x4066a2
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
call fcn.00415f1a
push eax
lea eax, [esp + 0x1b8]
push str.bind__:__s
push eax
call fcn.00415314
lea ecx, [esp + 0x1c0]
lea edx, [esp + 0x4c]
push ecx
push edx
call dword [esp + 0x68]
add esp, 0x18
shl edi, 1
je 0x4067a7
push edi
call ebx
lea eax, [esp + 0xe0]
push 0x10
push eax
push esi
call ebp
cmp eax, 0xffffffff
je 0x406652
mov edi, dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
lea ecx, [esp + 0x18]
mov dword [esp + 0x94], ecx
mov dword [esp + 0x6c], esi
call edi
mov dword [esp + 0x180], eax
mov eax, dword [esp + 0x14]
xor ebp, ebp
cmp eax, ebp
jne 0x4066fa
call edi
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
lea edx, [esp + 0x1b8]
push str.Accepting_connections___u__u_
push edx
call fcn.00415314
lea eax, [esp + 0x1c0]
lea ecx, [esp + 0x4c]
push eax
push ecx
call dword [esp + 0x68]
add esp, 0x18
mov dword [esp + 0xf4], ebp
mov dword [esp + 0xe4], ebp
mov word [esp + 0xf2], bp
mov word [esp + 0xe2], bp
mov dword [esp + 0x18], esi
mov word [esp + 0x1c], 1
mov esi, dword [esp + 0x24]
mov ebp, dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edi, dword [esp + 0x720]
mov ecx, dword [0x42a7f4]
mov edx, dword [esp + 0x80]
cmp ecx, edx
jne 0x406964
mov eax, dword [esp + 0x10]
cmp eax, edi
jl 0x4067be
inc esi
cmp esi, 0x1388
mov dword [esp + 0x24], esi
jle 0x40678c
push edi
push eax
lea edx, [esp + 0x1b8]
push str.Warning:_too_many_connected_clients___d__d_
push edx
call fcn.00415314
lea eax, [esp + 0x1c0]
lea ecx, [esp + 0x4c]
push eax
push ecx
call dword [esp + 0x68]
add esp, 0x18
xor esi, esi
mov dword [esp + 0x24], esi
push 1
call ebx
mov ecx, dword [0x42a7f4]
mov edx, dword [esp + 0x80]
cmp ecx, edx
jne 0x406964
jmp 0x406749
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
pop edi
pop esi
pop ebp
mov eax, 0xfffffffd
pop ebx
add esp, 0x8ac
ret
cmp ecx, edx
jne 0x406964
test byte [esp + 0x1c], 1
je 0x406831
push 0x3e8
lea edx, [esp + 0x1c]
push 1
push edx
call fcn.0040ef30
add esp, 0xc
cmp eax, 1
jge 0x40683a
test eax, eax
je 0x406734
call ebp
push eax
call ebp
push eax
call fcn.00415f1a
add esp, 4
push eax
lea eax, [esp + 0x1b8]
push str.poll__:__s__d
push eax
call fcn.00415314
lea ecx, [esp + 0x1c0]
lea edx, [esp + 0x4c]
push ecx
push edx
call dword [esp + 0x68]
add esp, 0x18
call ebp
cmp eax, 0x2733
jne 0x40683a
jmp 0x406734
push 1
call ebx
jmp 0x406734
mov eax, dword [0x42a7f4]
mov ecx, dword [esp + 0x80]
cmp eax, ecx
jne 0x406964
push 0x158
mov word [esp + 0x20], 0
call fcn.00415de0
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x40688d
lea ecx, [esp + 0x3c]
push str.Memory_Allocation_Failed
push ecx
mov dword [esp + 0x108], 0x15
call dword [esp + 0x58]
add esp, 8
push 1
call ebx
jmp 0x406723
mov ecx, 0x56
lea esi, [esp + 0x3c]
mov edi, ebp
push ebp
rep movsd dword es:[edi], dword [esi]
call fcn.0040f3a0
add esp, 4
lea eax, [esp + 0x198]
xor esi, esi
lea edx, [esp + 0x3c]
push eax
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 + 0x44]
cmp eax, esi
je 0x4068d5
mov dword [ebp], eax
mov ecx, dword [esp + 0x44]
mov dword [ecx + 4], ebp
mov eax, dword [esp + 0x30]
lea edx, [esp + 0x38]
push edx
push 0
push ebp
push eax
push 0x4000
push 0
mov dword [esp + 0x5c], ebp
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov ecx, dword [esp + 0x38]
test eax, eax
mov dword [ebp + 0x144], ecx
je 0x406913
mov edx, dword [esp + 0x10]
push eax
inc edx
mov dword [esp + 0x14], edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40691c
push ebp
call fcn.00414c58
add esp, 4
lea edx, [esp + 0x198]
push edx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor eax, eax
mov dword [esp + 0xe0], eax
mov dword [esp + 0xe4], eax
mov dword [esp + 0xe8], eax
cmp word [esp + 0x1c], ax
mov dword [esp + 0xec], eax
jne 0x406723
push 1
call ebx
cmp word [esp + 0x1c], 0
je 0x406953
jmp 0x406723
mov eax, dword [esp + 0x64]
cmp eax, 0xffffffff
je 0x406974
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [esp + 0x14]
test eax, eax
jne 0x40698d
lea ecx, [esp + 0x3c]
push str.Exiting_thread
push ecx
call dword [esp + 0x58]
add esp, 8
mov eax, dword [esp + 0x44]
mov dword [esp + 0x4c], 0xc
test eax, eax
je 0x4069a9
push 0x64
call ebx
mov eax, dword [esp + 0x44]
test eax, eax
jne 0x40699d
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x180], 0
test eax, eax
je 0x4069c5
push eax
call fcn.00414d41
add esp, 4
mov eax, dword [esp + 0x8c]
test eax, eax
je 0x4069d9
push eax
call fcn.00414c58
add esp, 4
mov eax, dword [esp + 0x11c]
test eax, eax
je 0x4069ed
push eax
call fcn.00414c58
add esp, 4
mov eax, dword [esp + 0x118]
test eax, eax
je 0x406a01
push eax
call fcn.00414c58
add esp, 4
mov eax, dword [esp + 0x174]
test eax, eax
je 0x406a15
push eax
call fcn.00414c58
add esp, 4
mov eax, dword [esp + 0x3c]
test eax, eax
je 0x406a28
mov edx, dword [esp + 0x40]
mov dword [eax + 4], edx
mov eax, dword [esp + 0x3c]
mov ecx, dword [esp + 0x40]
test ecx, ecx
je 0x406a4d
mov dword [ecx], eax
lea eax, [esp + 0x198]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x8ac
ret
mov dword [0x426e90], eax
lea eax, [esp + 0x198]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x8ac
ret
mov esi, dword [esp + 0x8c4]
mov ecx, dword [0x426048]
mov dword [0x42a790], 1
mov dword [0x426e94], ebx
mov eax, dword [esi]
push 0x421208
push eax
lea edx, [esp + 0x75c]
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, 0x8ac
ret