Function at 0x407be9
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 [0x425174]
mov dword [ebp - 0x4ec], eax
mov eax, dword [0x42517c]
mov dword [ebp - 0x414], eax
mov eax, dword [0x425180]
mov dword [ebp - 0x24c], eax
mov dword [ebp - 0x4f8], eax
mov dword [ebp - 0x4d0], esi
mov ebx, esi
jle 0x407e1b
xor edi, edi
mov eax, dword [ebp - 0x428]
lea edx, [eax + ebx*4]
mov eax, dword [edx]
cmp byte [eax], 0x2d
jne 0x407e0f
movsx ecx, byte [eax + 1]
cmp ecx, 0x69
jg 0x407d50
je 0x407d40
sub ecx, 0x61
je 0x407d86
dec ecx
je 0x407d2b
dec ecx
dec ecx
je 0x407d12
dec ecx
je 0x407cfc
dec ecx
je 0x407cee
dec ecx
dec ecx
jne 0x407d68
add eax, 2
mov dword [ebp - 0x430], eax
jmp 0x407e05
add eax, 2
mov dword [ebp - 0x460], eax
jmp 0x407e05
lea esi, [eax + 2]
call fcn.00406ce1
mov dword [ebp - 0x4a0], eax
xor esi, esi
inc esi
jmp 0x407e05
cmp dword [0x425200], edi
jne 0x407d20
call dword [sym.imp.KERNEL32.dll_FreeConsole]
mov dword [0x425200], esi
jmp 0x407e05
add eax, 2
push eax
call fcn.00409be4
pop ecx
mov dword [ebp - 0x4b0], eax
jmp 0x407e05
lea esi, [eax + 2]
call fcn.00406ce1
mov dword [ebp - 0x4a4], eax
jmp 0x407d0a
sub ecx, 0x6c
je 0x407dba
dec ecx
dec ecx
je 0x407db2
dec ecx
dec ecx
je 0x407d99
sub ecx, 3
je 0x407d86
dec ecx
je 0x407d7e
dec ecx
je 0x407d73
mov dword [ebp - 0x41c], esi
jmp 0x407e05
mov dword [ebp - 0x4d0], esi
jmp 0x407e05
mov dword [ebp - 0x4cc], esi
jmp 0x407e05
add eax, 2
push eax
call fcn.00409be4
inc eax
pop ecx
mov dword [ebp - 0x4d8], eax
jmp 0x407e05
add eax, 2
push eax
call fcn.00409be4
pop ecx
push eax
call sub.WS2_32.dll_htons
mov word [ebp - 0x454], ax
jmp 0x407e05
mov dword [ebp - 0x4d4], edi
jmp 0x407e05
mov ecx, eax
add ecx, 2
mov dword [ebp - 0x4f4], 0x406a82
mov dword [ebp - 0x45c], ecx
cmp byte [ecx], 0
je 0x407e05
add eax, 2
cmp byte [eax], 0x40
je 0x407e05
push 0x421ad4
push eax
call fcn.0040c1ce
pop ecx
pop ecx
mov dword [ebp - 0x424], eax
cmp eax, edi
je 0x407e05
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 0x407c9f
cmp dword [ebp - 0x41c], edi
jne 0x408402
lea eax, [ebx + 3]
cmp dword [ebp + 8], eax
jne 0x408402
mov eax, dword [ebp - 0x428]
lea edi, [eax + ebx*4]
mov eax, dword [edi]
cmp byte [eax], 0x2d
je 0x408402
push eax
call fcn.00409be4
pop ecx
push eax
call sub.WS2_32.dll_htons
mov word [ebp - 0x454], ax
test ax, ax
je 0x408402
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 0x408402
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
xor edi, edi
cmp word [ebp - 0x454], di
jne 0x407ebd
movzx eax, word [0x425178]
push eax
call sub.WS2_32.dll_htons
mov word [ebp - 0x454], ax
cmp word [ebp - 0x1b2], di
jne 0x407eda
movzx eax, word [0x425178]
push eax
call sub.WS2_32.dll_htons
mov word [ebp - 0x1b2], ax
cmp dword [ebp - 0x430], edi
je 0x407efc
movzx eax, word [0x425178]
mov ebx, dword [ebp - 0x430]
push eax
lea edi, [ebp - 0x27c]
call fcn.004060fc
pop ecx
cmp dword [ebp - 0x4e8], 0xffffffff
jne 0x407fb2
cmp dword [ebp - 0x414], 0
jne 0x407f42
mov eax, esi
mov word [ebp - 0x438], ax
mov ax, word [0x4251b4]
mov word [ebp - 0x436], ax
xor eax, eax
push eax
push eax
push eax
push 6
push esi
push 2
call dword [sym.imp.WS2_32.dll_WSASocketA]
mov edi, eax
mov dword [ebp - 0x410], edi
jmp 0x407f5b
xor eax, eax
push eax
push eax
push eax
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 0x407f73
push str.socket__
call fcn.0040b0f5
pop ecx
push 0xfffffffffffffffe
pop eax
jmp 0x408404
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 0x407fb2
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 0x40802e
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 0x408007
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 0x4080af
cmp ebx, 0x2710
ja 0x4080af
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 0x407fc7
mov edi, dword [ebp - 0x410]
xor ebx, ebx
cmp dword [ebp - 0x414], ebx
jne 0x4080c1
mov eax, dword [ebp - 0x4e0]
sar eax, 4
inc eax
push eax
push edi
call dword [sym.imp.WS2_32.dll_listen]
cmp eax, 0xffffffff
jne 0x4080c7
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], ebx
jne 0x4080a8
lea eax, [ebp - 0x10c]
push eax
lea eax, [ebp - 0x27c]
push eax
call dword [ebp - 0x4f4]
pop ecx
pop ecx
push 0xfffffffffffffffc
jmp 0x407f6d
push dword [ebp - 0x410]
call sub.WS2_32.dll_closesocket
push 0xfffffffffffffffd
jmp 0x407f6d
mov dword [ebp - 0x248], edi
xor eax, eax
mov word [ebp - 0x1a2], ax
mov word [ebp - 0x1b2], ax
mov eax, 0x300
mov dword [ebp - 0x1a0], ebx
mov dword [ebp - 0x1b0], ebx
mov dword [ebp - 0x484], edi
mov word [ebp - 0x480], ax
jmp 0x4083a0
mov edi, dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [0x4251f8]
cmp eax, dword [ebp - 0x4dc]
jne 0x4083ad
mov ecx, dword [ebp - 0x4e4]
cmp ecx, dword [ebp - 0x4e0]
jl 0x408148
inc dword [ebp - 0x420]
cmp dword [ebp - 0x420], 0x1388
jle 0x408138
and dword [ebp - 0x420], 0
push esi
call edi
mov eax, dword [0x4251f8]
cmp eax, dword [ebp - 0x4dc]
je 0x408111
cmp eax, dword [ebp - 0x4dc]
jne 0x4083ad
test dword [ebp - 0x480], 0x300
push esi
je 0x40819a
mov eax, 0x3e8
lea ecx, [ebp - 0x484]
call fcn.00405f26
cmp eax, esi
pop ecx
mov dword [ebp - 0x41c], eax
jge 0x4081a5
test eax, eax
je 0x40819c
call sub.WS2_32.dll_WSAGetLastError
cmp eax, 0x2733
je 0x40819c
call sub.WS2_32.dll_WSAGetLastError
cmp eax, 0x2733
jne 0x4081a5
jmp 0x40819c
call edi
cmp dword [ebx], 0
jne 0x408100
mov eax, dword [0x4251f8]
cmp eax, dword [ebp - 0x4dc]
jne 0x4083ad
xor eax, eax
cmp dword [ebp - 0x41c], eax
jl 0x4083ad
cmp dword [ebp - 0x414], eax
jne 0x408258
push eax
push eax
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 0x4083a0
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 0x408261
xor eax, eax
mov word [ebp - 0x480], ax
push 0x170
call fcn.0040bfd4
mov ebx, eax
pop ecx
test ebx, ebx
jne 0x4082b8
cmp dword [ebp - 0x414], eax
jne 0x408285
push dword [ebp - 0x418]
call sub.WS2_32.dll_closesocket
cmp dword [ebp - 0x4cc], 0
mov dword [ebp - 0x218], 0x15
jne 0x4082ac
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 0x4083a0
push 0x5c
pop ecx
lea esi, [ebp - 0x27c]
mov edi, ebx
rep movsd dword es:[edi], dword [esi]
cmp dword [ebp - 0x1f4], 0
je 0x4082e0
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 0x4082fa
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 0x408321
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 0x408360
inc dword [ebp - 0x4e4]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x408367
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 0x40839d
cmp word [ebp - 0x480], si
jne 0x40839d
push 1
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x40838a
xor esi, esi
inc esi
mov ebx, dword [ebp + 0x10]
mov eax, dword [ebx]
test eax, eax
jne 0x4080fa
xor esi, esi
cmp dword [ebp - 0x4cc], esi
jne 0x4083cb
lea eax, [ebp - 0x27c]
push str.Exiting_thread
push eax
call dword [ebp - 0x4f4]
pop ecx
pop ecx
cmp dword [ebp - 0x424], esi
je 0x4083df
push dword [ebp - 0x424]
call fcn.0040c36b
pop ecx
lea eax, [ebp - 0x504]
call fcn.00406f88
cmp dword [ebp - 0x1f4], esi
je 0x4083fe
push dword [ebp - 0x1f4]
call fcn.0040b479
pop ecx
xor eax, eax
jmp 0x408404
mov eax, esi
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040904e
leave
ret