Function at 0x4028e0
Capabilities:
Create udp socket
Get socket status
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x170
mov esi, dword [ebp + 0xc]
push 0x11
push 2
push 2
call sub.WS2_32.DLL_socket
mov ebx, eax
pop edi
test eax, eax
js 0x402af0
mov edx, dword [ebp + 0x14]
mov eax, dword [0x40c02c]
mov dword [edx + 4], eax
mov word [edx + 2], 0
mov word [edx], 2
push ecx
push 0x10
push edx
push ebx
call sub.WS2_32.DLL_bind
pop edx
test eax, eax
js 0x402ae0
mov ecx, dword [ebp + 8]
lea edi, [ebp - 0x138]
lea eax, [ecx + esi + 1]
add eax, ebx
mov dword [ebp - 0x148], eax
mov eax, dword [ebp + 8]
mov dword [ebp - 0x138], 1
mov dword [ebp - 0x134], eax
cmp esi, eax
je 0x40296a
mov dword [ebp - 0x130], esi
mov dword [ebp - 0x138], 2
xor eax, eax
mov edx, dword [ebp - 0x138]
cmp ebx, dword [ebp - 0x134]
jne 0x402986
jmp 0x402993
cmp ebx, dword [edi + eax*4 + 4]
je 0x40298b
inc eax
cmp eax, edx
jb 0x402980
cmp eax, edx
je 0x402c35
sub esp, 0xc
lea edx, [ebp - 0x24]
mov eax, dword [ebp - 0x148]
mov dword [ebp - 0x24], 0x78
push edx
mov dword [ebp - 0x20], 0
push 0
push 0
push edi
push eax
call sub.WS2_32.DLL_select
add esp, 0xc
test eax, eax
jle 0x402ae0
push eax
push eax
mov eax, dword [ebp + 8]
push edi
push eax
call sub.WS2_32.DLL___WSAFDIsSet
pop edx
test eax, eax
pop ecx
je 0x4029f2
mov eax, dword [ebp + 0x10]
push 0
push 0xffff
push eax
mov eax, dword [ebp + 8]
push eax
call sub.WS2_32.DLL_recv
test eax, eax
jle 0x402ae0
push eax
push eax
push edi
push esi
call sub.WS2_32.DLL___WSAFDIsSet
pop edx
test eax, eax
pop ecx
je 0x402bb2
lea ecx, [ebp - 0x1c]
push eax
push eax
mov eax, dword [ebp + 0x14]
push ecx
push eax
mov eax, dword [ebp + 0x10]
push 0
mov dword [ebp - 0x1c], 0x10
push 0xffff
push eax
push esi
call sub.WS2_32.DLL_recvfrom
mov edx, eax
pop eax
cmp edx, 6
pop ecx
jle 0x402943
mov eax, dword [ebp + 0x10]
cmp byte [eax], 0
jne 0x402943
cmp byte [eax + 1], 0
jne 0x402943
cmp byte [eax + 2], 0
jne 0x402943
mov ecx, eax
mov al, byte [eax + 3]
cmp al, 1
je 0x402b03
cmp al, 3
jne 0x402943
mov eax, dword [ebp + 0x10]
xor ecx, ecx
mov cl, byte [eax + 4]
mov dword [ebp - 0x15c], ecx
lea ecx, [eax + ecx + 7]
mov dword [ebp - 0x13c], ecx
mov al, byte [ecx - 2]
mov byte [ebp - 0x158], al
mov eax, dword [ebp + 0x10]
sub eax, dword [ebp - 0x13c]
mov cl, byte [ecx - 1]
add eax, edx
mov dword [ebp - 0x144], eax
js 0x402943
mov al, byte [ebp - 0x158]
mov edx, dword [ebp + 0x10]
shl eax, 8
add edx, 5
mov word [ebp - 0x13e], ax
xor eax, eax
mov al, cl
mov ecx, dword [ebp - 0x15c]
or word [ebp - 0x13e], ax
sub esp, 0xc
mov byte [edx + ecx], 0
push edx
call fcn.00402070
add esp, 0x10
mov ecx, eax
jmp 0x402b57
test ebx, ebx
je 0x402af0
sub esp, 0xc
push ebx
call sub.WS2_32.DLL_closesocket
add esp, 0xc
sub esp, 0xc
push esi
call sub.WS2_32.DLL_closesocket
lea esp, [ebp - 0xc]
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, ecx
sub edx, 0xa
mov ecx, dword [ecx + 4]
mov al, byte [eax + 8]
mov byte [ebp - 0x178], al
mov eax, dword [ebp + 0x10]
mov al, byte [eax + 9]
mov dword [ebp - 0x144], edx
mov byte [ebp - 0x15d], al
js 0x402943
mov dl, byte [ebp - 0x178]
xor eax, eax
shl edx, 8
mov al, byte [ebp - 0x15d]
mov word [ebp - 0x13e], dx
or word [ebp - 0x13e], ax
mov eax, dword [ebp + 0x10]
add eax, 0xa
mov dword [ebp - 0x13c], eax
cmp ecx, 0xffffffff
je 0x402943
cmp word [ebp - 0x13e], 0
je 0x402943
sub esp, 0xc
mov ax, word [ebp - 0x13e]
and eax, 0xffff
mov dword [ebp - 0x30], ecx
push eax
call sub.WS2_32.DLL_htons
sub esp, 0xc
mov word [ebp - 0x32], ax
lea eax, [ebp - 0x34]
mov word [ebp - 0x34], 2
push 0x10
push eax
mov eax, dword [ebp - 0x144]
push 0
push eax
mov eax, dword [ebp - 0x13c]
push eax
push ebx
call sub.WS2_32.DLL_sendto
add esp, 0x18
push eax
push eax
push edi
push ebx
call sub.WS2_32.DLL___WSAFDIsSet
pop edx
test eax, eax
pop ecx
je 0x402943
push eax
push eax
mov eax, dword [ebp + 0x10]
lea edx, [ebp - 0x1c]
lea ecx, [ebp - 0x34]
add eax, 0xa
push edx
mov dword [ebp - 0x1c], 0x10
push ecx
push 0
push 0xfff5
push eax
push ebx
call sub.WS2_32.DLL_recvfrom
mov edx, eax
pop eax
test edx, edx
pop ecx
js 0x402943
mov eax, dword [ebp + 0x10]
mov byte [eax], 0
mov byte [eax + 1], 0
mov byte [eax + 2], 0
mov byte [eax + 3], 1
mov ecx, dword [ebp + 0x10]
mov eax, dword [ebp - 0x30]
mov dword [ecx + 4], eax
mov ax, word [ebp - 0x32]
mov word [ecx + 8], ax
push eax
push eax
mov eax, dword [ebp + 0x14]
push 0x10
push eax
lea eax, [edx + 0xa]
push 0
push eax
push ecx
push esi
call sub.WS2_32.DLL_sendto
pop eax
pop edx
jmp 0x402943
cmp eax, 0x3f
ja 0x402993
mov dword [ebp + eax*4 - 0x134], ebx
inc eax
mov dword [ebp - 0x138], eax
jmp 0x402993