Function at 0x401490
Capabilities:
Create thread
Get socket status
Initialize winsock library
Receive data
Receive data on socket

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x2dc
mov eax, dword [0x409004]
xor eax, esp
mov dword [esp + 0x2d8], eax
push ebx
push esi
push edi
xor edi, edi
or ebx, 0xffffffff
mov dword [esp + 0xc], edi
mov dword [esp + 0x10], ebx
call fcn.00401000
cmp al, 1
je 0x4014cc
mov dword [esp + 0xc], ebx
jmp 0x4017c8
lea eax, [esp + 0x150]
push eax
push 0x101
call dword [sym.imp.WS2_32.dll_WSAStartup]
cmp eax, edi
je 0x401503
push str.UDP000
push eax
push 0x7530
call fcn.004011f0
add esp, 0xc
mov dword [esp + 0xc], 0xfffffffe
jmp 0x4017c8
push edi
push 2
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov esi, eax
mov dword [esp + 0x10], esi
cmp esi, ebx
jne 0x40153e
push 0x4079a0
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push 0x7530
call fcn.004011f0
add esp, 0xc
mov dword [esp + 0xc], 0xfffffffd
jmp 0x4017c8
lea ecx, [esp + 0x24]
push ecx
push edi
push edi
push 0x401240
push edi
push edi
call dword [sym.imp.KERNEL32.dll_CreateThread]
test eax, eax
jne 0x40157c
push 0x407a3c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x7530
call fcn.004011f0
add esp, 0xc
mov dword [esp + 0xc], 0xfffffffc
jmp 0x4017c8
xor eax, eax
mov edx, 2
mov dword [esp + 0x130], eax
push 0x1a7c
mov dword [esp + 0x138], eax
mov dword [esp + 0x13c], eax
mov dword [esp + 0x140], eax
mov word [esp + 0x134], dx
call dword [sym.imp.WS2_32.dll_htons]
push edi
mov word [esp + 0x136], ax
call dword [sym.imp.WS2_32.dll_htonl]
mov dword [esp + 0x134], eax
push 0x10
lea eax, [esp + 0x134]
push eax
push esi
call dword [sym.imp.WS2_32.dll_bind]
cmp eax, ebx
jne 0x4015ed
push 0x407a6c
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
jmp 0x401561
cmp byte [0x40a7c4], 0
mov dword [esp + 0x1c], 5
mov dword [esp + 0x20], edi
jne 0x4017c8
mov esi, dword [esp + 0x10]
lea ecx, [esp + 0x1c]
push ecx
push 0
push 0
lea edx, [esp + 0x34]
push edx
push 0
mov dword [esp + 0x40], esi
mov dword [esp + 0x3c], 1
call dword [sym.imp.WS2_32.dll_select]
cmp eax, 0xffffffff
je 0x4017a2
test eax, eax
je 0x4017bb
lea eax, [esp + 0x28]
push eax
push esi
call dword [sym.imp.WS2_32.dll___WSAFDIsSet]
test eax, eax
je 0x40179b
mov eax, dword [0x40a7b8]
movzx ecx, word [eax + 2]
shl ecx, 8
lea edx, [esp + 0x14]
push edx
mov dword [esp + 0x18], 0x10
mov dword [ecx + eax + 4], 0
movzx edx, word [eax + 2]
lea ecx, [esp + 0x144]
push ecx
push 0
shl edx, 8
push 0x100
lea eax, [edx + eax + 4]
push eax
push esi
call dword [sym.imp.WS2_32.dll_recvfrom]
mov dword [esp + 0x18], eax
cmp eax, 0xffffffff
je 0x401794
test eax, eax
je 0x40178d
mov edi, dword [0x40a7b8]
movzx ecx, word [edi + 2]
shl ecx, 8
movzx eax, byte [ecx + edi + 5]
lea ecx, [ecx + edi + 4]
lea esi, [eax - 1]
xor bl, bl
xor edx, edx
test esi, esi
jle 0x4016d8
movzx esi, byte [ecx + 1]
dec esi
nop
add bl, byte [edx + ecx]
inc edx
cmp edx, esi
jl 0x4016d0
cmp bl, byte [eax + ecx - 1]
je 0x4016e8
push 0x407af4
jmp 0x4017a7
mov byte [eax + ecx - 1], 0
cmp byte [ecx], 0
je 0x4016fc
push 0x407b0c
jmp 0x4017a7
mov dl, byte [ecx + 1]
movzx eax, dl
cmp dword [esp + 0x18], eax
je 0x401712
push 0x407b20
jmp 0x4017a7
mov al, byte [ecx + 3]
xor al, byte [ecx + 2]
xor al, dl
xor esi, esi
movzx edx, byte [ecx + 1]
sub edx, 0xf
cmp esi, edx
jge 0x401758
mov dl, byte [esi + ecx + 0xe]
mov bl, dl
xor bl, al
mov byte [esi + ecx + 0xe], bl
movzx eax, byte [ecx + 1]
sub eax, 0xf
lea ebx, [esi + 1]
cmp ebx, eax
jge 0x401758
mov al, byte [esi + ecx + 0xf]
mov bl, al
xor bl, dl
mov byte [esi + ecx + 0xf], bl
add esi, 2
cmp esi, 0xf2
jb 0x40171c
mov byte [ecx], 0xff
movzx ecx, word [edi + 2]
mov edx, dword [esp + 0x144]
shl ecx, 8
mov dword [ecx + edi + 0xe], edx
inc word [edi + 2]
cmp word [edi + 2], 0x64
jb 0x40177e
xor eax, eax
mov word [edi + 2], ax
mov ecx, dword [0x40a7ac]
push ecx
call dword [sym.imp.KERNEL32.dll_PulseEvent]
jmp 0x4017bb
push 0x407ad4
jmp 0x4017a7
push 0x407ab0
jmp 0x4017a7
push str.UDP001
jmp 0x4017a7
push 0x407a8c
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push 0x7530
call fcn.004011f0
add esp, 0xc
cmp byte [0x40a7c4], 0
je 0x401606
mov edx, dword [esp + 0x10]
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
call dword [sym.imp.WS2_32.dll_WSACleanup]
mov eax, dword [0x40a7c0]
mov edi, dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
test eax, eax
je 0x4017eb
push eax
call edi
mov eax, dword [0x40a7bc]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x4017fd
push eax
call esi
mov eax, dword [0x40a7b0]
test eax, eax
je 0x401809
push eax
call esi
mov eax, dword [0x40a7b8]
test eax, eax
je 0x401815
push eax
call edi
mov eax, dword [0x40a7b4]
test eax, eax
je 0x401821
push eax
call esi
mov eax, dword [0x40a7ac]
test eax, eax
je 0x40182d
push eax
call esi
mov eax, dword [0x40a7a8]
test eax, eax
je 0x401839
push eax
call esi
mov ecx, dword [esp + 0x2e4]
mov eax, dword [esp + 0xc]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00401852
mov esp, ebp
pop ebp
ret