Function at 0x40869b
Capabilities:
Create thread
Create udp socket
Initialize winsock library
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x508
mov eax, dword [0x4243b0]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [ebp + 0xc]
or dword [ebp - 0x410], 0xffffffff
or dword [ebp - 0x418], 0xffffffff
push ebx
push esi
mov dword [ebp - 0x428], eax
xor eax, eax
push edi
mov dword [ebp - 0x41c], eax
mov dword [ebp - 0x430], eax
mov dword [ebp - 0x424], eax
lea eax, [ebp - 0x40c]
xor esi, esi
push eax
inc esi
push 0x101
mov dword [ebp - 0x434], esi
mov dword [ebp - 0x420], 0x1388
mov dword [ebp - 0x43c], esi
call sub.WS2_32.dll_WSAStartup
lea edi, [ebp - 0x27c]
lea eax, [ebp - 0x504]
call fcn.00406ddb
cmp dword [ebp + 8], esi
mov eax, dword [0x425160]
mov dword [ebp - 0x4ec], eax
mov eax, dword [0x425168]
mov dword [ebp - 0x414], eax
mov eax, dword [0x42516c]
mov dword [ebp - 0x24c], eax
mov dword [ebp - 0x4f8], eax
mov dword [ebp - 0x4d0], esi
mov ebx, esi
jle 0x4088cd
xor edi, edi
mov eax, dword [ebp - 0x428]
lea edx, [eax + ebx*4]
mov eax, dword [edx]
cmp byte [eax], 0x2d
jne 0x4088c1
movsx ecx, byte [eax + 1]
cmp ecx, 0x69
jg 0x408802
je 0x4087f2
sub ecx, 0x61
je 0x408838
dec ecx
je 0x4087dd
dec ecx
dec ecx
je 0x4087c4
dec ecx
je 0x4087ae
dec ecx
je 0x4087a0
dec ecx
dec ecx
jne 0x40881a
add eax, 2
mov dword [ebp - 0x430], eax
jmp 0x4088b7
add eax, 2
mov dword [ebp - 0x460], eax
jmp 0x4088b7
lea esi, [eax + 2]
call fcn.00406ce1
mov dword [ebp - 0x4a0], eax
xor esi, esi
inc esi
jmp 0x4088b7
cmp dword [0x425200], edi
jne 0x4087d2
call dword [sym.imp.KERNEL32.dll_FreeConsole]
mov dword [0x425200], esi
jmp 0x4088b7
add eax, 2
push eax
call fcn.00409be4
pop ecx
mov dword [ebp - 0x4b0], eax
jmp 0x4088b7
lea esi, [eax + 2]
call fcn.00406ce1
mov dword [ebp - 0x4a4], eax
jmp 0x4087bc
sub ecx, 0x6c
je 0x40886c
dec ecx
dec ecx
je 0x408864
dec ecx
dec ecx
je 0x40884b
sub ecx, 3
je 0x408838
dec ecx
je 0x408830
dec ecx
je 0x408825
mov dword [ebp - 0x41c], esi
jmp 0x4088b7
mov dword [ebp - 0x4d0], esi
jmp 0x4088b7
mov dword [ebp - 0x4cc], esi
jmp 0x4088b7
add eax, 2
push eax
call fcn.00409be4
inc eax
pop ecx
mov dword [ebp - 0x4d8], eax
jmp 0x4088b7
add eax, 2
push eax
call fcn.00409be4
pop ecx
push eax
call sub.WS2_32.dll_htons
mov word [ebp - 0x454], ax
jmp 0x4088b7
mov dword [ebp - 0x4d4], edi
jmp 0x4088b7
mov ecx, eax
add ecx, 2
mov dword [ebp - 0x4f4], 0x406a82
mov dword [ebp - 0x45c], ecx
cmp byte [ecx], 0
je 0x4088b7
add eax, 2
cmp byte [eax], 0x40
je 0x4088b7
push 0x421ad4
push eax
call fcn.0040c1ce
pop ecx
pop ecx
mov dword [ebp - 0x424], eax
cmp eax, edi
je 0x4088b7
push 2
push edi
push eax
mov dword [ebp - 0x47c], eax
call fcn.0040c26f
add esp, 0xc
inc ebx
cmp ebx, dword [ebp + 8]
jl 0x408751
cmp dword [ebp - 0x41c], edi
jne 0x408f06
lea eax, [ebx + 3]
cmp dword [ebp + 8], eax
jne 0x408f06
mov eax, dword [ebp - 0x428]
lea edi, [eax + ebx*4]
mov eax, dword [edi]
cmp byte [eax], 0x2d
je 0x408f06
push eax
call fcn.00409be4
pop ecx
push eax
call sub.WS2_32.dll_htons
mov word [ebp - 0x454], ax
test ax, ax
je 0x408f06
mov eax, dword [ebp - 0x428]
push dword [eax + ebx*4 + 8]
call fcn.00409be4
pop ecx
push eax
call sub.WS2_32.dll_htons
mov word [ebp - 0x450], ax
test ax, ax
je 0x408f06
push dword [edi + 4]
call fcn.0041ab01
mov dword [ebp - 0x478], eax
pop ecx
lea ebx, [ebp - 0x27c]
lea eax, [ebp - 0x504]
call fcn.00406e92
cmp word [ebp - 0x454], 0
jne 0x40896e
movzx eax, word [0x425164]
push eax
call sub.WS2_32.dll_htons
mov word [ebp - 0x454], ax
xor edi, edi
cmp word [ebp - 0x1b2], di
jne 0x40898d
movzx eax, word [0x425164]
push eax
call sub.WS2_32.dll_htons
mov word [ebp - 0x1b2], ax
cmp dword [ebp - 0x430], edi
je 0x4089b1
movzx eax, word [0x425164]
mov ebx, dword [ebp - 0x430]
push eax
lea edi, [ebp - 0x27c]
call fcn.004060fc
pop ecx
xor edi, edi
cmp dword [ebp - 0x4e8], 0xffffffff
jne 0x408a5f
push edi
push edi
push edi
cmp dword [ebp - 0x414], edi
jne 0x4089f4
mov eax, esi
push 6
mov word [ebp - 0x438], ax
mov ax, word [0x4251b4]
push esi
push 2
mov word [ebp - 0x436], ax
call dword [sym.imp.WS2_32.dll_WSASocketA]
mov edi, eax
mov dword [ebp - 0x410], edi
jmp 0x408a08
push 0x11
push 2
push 2
call dword [sym.imp.WS2_32.dll_WSASocketA]
mov dword [ebp - 0x410], eax
mov edi, eax
cmp edi, 0xffffffff
jne 0x408a20
push str.socket__
call fcn.0040b0f5
pop ecx
push 0xfffffffffffffffe
pop eax
jmp 0x408f08
lea eax, [ebp - 0x43c]
push eax
push 0x8004667e
push edi
call dword [sym.imp.WS2_32.dll_ioctlsocket]
push 4
lea eax, [ebp - 0x434]
push eax
push 4
push 0xffff
push edi
mov dword [ebp - 0x4e8], edi
call dword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
je 0x408a5f
push str.setsockopt__
call fcn.0040b0f5
pop ecx
mov edi, dword [sym.imp.WS2_32.dll_bind]
push 0x10
pop eax
push 0x64
pop ebx
mov dword [ebp - 0x42c], eax
push eax
jmp 0x408adb
call sub.WS2_32.dll_WSAGetLastError
push eax
call fcn.0040c09e
pop ecx
push eax
lea eax, [ebp - 0x10c]
push str.bind__:__s
push eax
call fcn.00409a82
add esp, 0xc
cmp dword [ebp - 0x4cc], 0
jne 0x408ab4
lea eax, [ebp - 0x10c]
push eax
lea eax, [ebp - 0x27c]
push eax
call dword [ebp - 0x4f4]
pop ecx
pop ecx
mov eax, dword [ebp + 0x10]
add ebx, ebx
cmp dword [eax], 0
je 0x408b5c
cmp ebx, 0x2710
ja 0x408b5c
push ebx
call dword [sym.imp.KERNEL32.dll_Sleep]
push dword [ebp - 0x42c]
lea eax, [ebp - 0x1b4]
push eax
push dword [ebp - 0x410]
call edi
cmp eax, 0xffffffff
je 0x408a74
mov ebx, dword [ebp - 0x410]
xor edi, edi
cmp dword [ebp - 0x414], edi
jne 0x408b6e
mov eax, dword [ebp - 0x4e0]
sar eax, 4
inc eax
push eax
push ebx
call dword [sym.imp.WS2_32.dll_listen]
cmp eax, 0xffffffff
jne 0x408b74
call sub.WS2_32.dll_WSAGetLastError
push eax
call fcn.0040c09e
pop ecx
push eax
lea eax, [ebp - 0x10c]
push str.listen__:__s
push eax
call fcn.00409a82
add esp, 0xc
cmp dword [ebp - 0x4cc], edi
jne 0x408b55
lea eax, [ebp - 0x10c]
push eax
lea eax, [ebp - 0x27c]
push eax
call dword [ebp - 0x4f4]
pop ecx
pop ecx
push 0xfffffffffffffffc
jmp 0x408a1a
push dword [ebp - 0x410]
call sub.WS2_32.dll_closesocket
push 0xfffffffffffffffd
jmp 0x408a1a
mov dword [ebp - 0x248], ebx
xor eax, eax
mov word [ebp - 0x1a2], ax
mov word [ebp - 0x1b2], ax
mov eax, 0x300
mov dword [ebp - 0x1a0], edi
mov dword [ebp - 0x1b0], edi
mov dword [ebp - 0x484], ebx
mov word [ebp - 0x480], ax
jmp 0x408ea6
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [0x4251f8]
cmp eax, dword [ebp - 0x4dc]
jne 0x408eb3
mov ecx, dword [ebp - 0x4e4]
cmp ecx, dword [ebp - 0x4e0]
jl 0x408bf4
inc dword [ebp - 0x420]
cmp dword [ebp - 0x420], 0x1388
jle 0x408be4
mov dword [ebp - 0x420], edi
push esi
call ebx
mov eax, dword [0x4251f8]
cmp eax, dword [ebp - 0x4dc]
je 0x408bbe
cmp eax, dword [ebp - 0x4dc]
jne 0x408eb3
test dword [ebp - 0x480], 0x300
push esi
je 0x408d4a
mov eax, 0x3e8
lea ecx, [ebp - 0x484]
call fcn.00405f26
cmp eax, esi
pop ecx
mov dword [ebp - 0x41c], eax
jge 0x408c99
cmp eax, edi
je 0x408d4c
call sub.WS2_32.dll_WSAGetLastError
cmp eax, 0x2733
je 0x408d4c
call sub.WS2_32.dll_WSAGetLastError
cmp eax, 0x2733
je 0x408d4c
call sub.WS2_32.dll_WSAGetLastError
push eax
call sub.WS2_32.dll_WSAGetLastError
push eax
call fcn.0040c09e
pop ecx
push eax
lea eax, [ebp - 0x10c]
push str.poll__:__s__d
push eax
call fcn.00409a82
add esp, 0x10
cmp dword [ebp - 0x4cc], edi
jne 0x408c99
lea eax, [ebp - 0x10c]
push eax
lea eax, [ebp - 0x27c]
push eax
call dword [ebp - 0x4f4]
pop ecx
pop ecx
mov eax, dword [0x4251f8]
cmp eax, dword [ebp - 0x4dc]
jne 0x408eb3
cmp dword [ebp - 0x41c], edi
jl 0x408eb3
cmp dword [ebp - 0x414], edi
jne 0x408d5c
push edi
push edi
lea eax, [ebp - 0x42c]
push eax
lea eax, [ebp - 0x1b4]
push eax
push dword [ebp - 0x410]
mov dword [ebp - 0x42c], 0x10
call dword [sym.imp.WS2_32.dll_WSAAccept]
mov dword [ebp - 0x418], eax
cmp eax, 0xffffffff
je 0x408ea6
lea eax, [ebp - 0x43c]
push eax
push 0x8004667e
push dword [ebp - 0x418]
call dword [sym.imp.WS2_32.dll_ioctlsocket]
mov edi, dword [sym.imp.WS2_32.dll_setsockopt]
push 4
lea eax, [ebp - 0x438]
push eax
push 0x80
mov ebx, 0xffff
push ebx
push dword [ebp - 0x418]
call edi
push 4
lea eax, [ebp - 0x434]
push eax
push 0x100
push ebx
push dword [ebp - 0x418]
call edi
jmp 0x408d65
call ebx
mov eax, dword [ebp + 0x10]
cmp dword [eax], edi
jne 0x408bad
jmp 0x408c99
xor eax, eax
mov word [ebp - 0x480], ax
push 0x170
call fcn.0040bfd4
mov ebx, eax
pop ecx
test ebx, ebx
jne 0x408dbc
cmp dword [ebp - 0x414], eax
jne 0x408d89
push dword [ebp - 0x418]
call sub.WS2_32.dll_closesocket
cmp dword [ebp - 0x4cc], 0
mov dword [ebp - 0x218], 0x15
jne 0x408db0
lea eax, [ebp - 0x27c]
push str.Memory_Allocation_Failed
push eax
call dword [ebp - 0x4f4]
pop ecx
pop ecx
push esi
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x408ea4
push 0x5c
pop ecx
lea esi, [ebp - 0x27c]
mov edi, ebx
rep movsd dword es:[edi], dword [esi]
cmp dword [ebp - 0x1f4], 0
je 0x408de4
push dword [ebp - 0x1f4]
call fcn.0041ab01
pop ecx
mov dword [ebx + 0x88], eax
mov esi, ebx
call fcn.00406189
xor esi, esi
cmp dword [ebp - 0x414], esi
jne 0x408dfe
mov eax, dword [ebp - 0x418]
mov dword [ebx + 0x34], eax
lea eax, [ebp - 0x49c]
push eax
mov dword [ebx], esi
mov dword [ebx + 4], esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [ebp - 0x4fc]
cmp eax, esi
je 0x408e25
mov dword [ebx], eax
mov eax, dword [ebp - 0x4fc]
mov dword [eax + 4], ebx
lea eax, [ebp - 0x440]
push eax
push esi
push ebx
push dword [ebp - 0x4ec]
mov dword [ebp - 0x4fc], ebx
push 0x4000
push esi
call fcn.0040af85
mov ecx, dword [ebp - 0x440]
add esp, 0x18
mov dword [ebx + 0x74], ecx
cmp eax, esi
je 0x408e64
inc dword [ebp - 0x4e4]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x408e6b
push ebx
call fcn.0040b479
pop ecx
lea eax, [ebp - 0x49c]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor eax, eax
lea edi, [ebp - 0x1b4]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
xor esi, esi
stosd dword es:[edi], eax
cmp dword [ebp - 0x414], esi
je 0x408ea1
cmp word [ebp - 0x480], si
jne 0x408ea1
push 1
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x408e8e
xor esi, esi
inc esi
xor edi, edi
mov eax, dword [ebp + 0x10]
mov eax, dword [eax]
cmp eax, edi
jne 0x408ba7
cmp dword [ebp - 0x4cc], edi
jne 0x408ecf
lea eax, [ebp - 0x27c]
push str.Exiting_thread
push eax
call dword [ebp - 0x4f4]
pop ecx
pop ecx
cmp dword [ebp - 0x424], edi
je 0x408ee3
push dword [ebp - 0x424]
call fcn.0040c36b
pop ecx
lea eax, [ebp - 0x504]
call fcn.00406f88
cmp dword [ebp - 0x1f4], edi
je 0x408f02
push dword [ebp - 0x1f4]
call fcn.0040b479
pop ecx
xor eax, eax
jmp 0x408f08
mov eax, esi
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040904e
leave
ret