Function at 0x4a2f60
Capabilities:
Create udp socket
Get socket status
Receive data
Receive data on socket
Send data
Send data on socket
Send http request
Send http request with host header

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x334
push ebx
push 0
push 2
push 2
mov dword [ebp - 4], 0
call dword [sym.imp.WS2_32.dll_socket]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x4a2f88
test ebx, ebx
jne 0x4a2f8f
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
push esi
push edi
push ebx
call fcn.004a2cd0
mov esi, dword [sym.imp.WS2_32.dll_htonl]
add esp, 4
mov eax, 2
push 0
mov word [ebp - 0x24], ax
call esi
mov edi, dword [sym.imp.WS2_32.dll_htons]
push 0
mov dword [ebp - 0x20], eax
call edi
push 0x10
lea ecx, [ebp - 0x24]
push ecx
push ebx
mov word [ebp - 0x22], ax
call dword [sym.imp.WS2_32.dll_bind]
mov edx, 2
push 0xeffffffa
mov word [ebp - 0x24], dx
call esi
push 0x76c
mov dword [ebp - 0x20], eax
call edi
mov word [ebp - 0x22], ax
mov eax, dword [ebp + 8]
mov dword [ebp - 0x10], 0
mov dword [ebp - 0xc], eax
jmp 0x4a3000
mov esi, dword [sym.imp.WS2_32.dll_sendto]
push 0x10
lea ecx, [ebp - 0x24]
push ecx
push 0
push 0x84
push str.M_SEARCH__HTTP_1.1_r_nHOST:_239.255.255.250:1900_r_nMAN:__ssdp:discover__r_nMX:_1_r_nST:_urn:schemas_upnp_org:service:WANIPConnection:1_r_n_r_n
push ebx
call esi
push 0x10
lea edx, [ebp - 0x24]
push edx
push 0
push 0x85
push str.M_SEARCH__HTTP_1.1_r_nHOST:_239.255.255.250:1900_r_nMAN:__ssdp:discover__r_nMX:_1_r_nST:_urn:schemas_upnp_org:service:WANPPPConnection:1_r_n_r_n
push ebx
call esi
lea eax, [ebp - 0x2c]
push eax
push 0
push 0
lea ecx, [ebp - 0x334]
push ecx
lea eax, [ebx + 1]
push eax
mov dword [ebp - 0x330], ebx
mov dword [ebp - 0x334], 1
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x28], 0x3d090
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jle 0x4a320c
lea edx, [ebp - 8]
push edx
lea eax, [ebp - 0x24]
push eax
push 0
push 0x200
lea ecx, [ebp - 0x230]
push ecx
push ebx
mov dword [ebp - 8], 0x10
call dword [sym.imp.WS2_32.dll_recvfrom]
test eax, eax
jle 0x4a320c
mov ecx, dword [ebp - 4]
shl ecx, 9
add ecx, dword [ebp + 8]
mov dword [ebp - 0x14], ecx
jmp 0x4a30b0
lea edx, [eax - 1]
cmp edx, 0x1fe
ja 0x4a31e0
mov byte [ebp + eax - 0x230], 0
lea eax, [ebp - 0x230]
push eax
call fcn.004a2f10
add esp, 4
cmp eax, 0xc8
jne 0x4a31e0
lea ecx, [ebp - 0x230]
push str.urn:schemas_upnp_org:service:WANIPConnection:1
push ecx
call fcn.0045b6b0
add esp, 8
test eax, eax
jne 0x4a3115
lea edx, [ebp - 0x230]
push str.urn:schemas_upnp_org:service:WANPPPConnection:1
push edx
call fcn.0045b6b0
add esp, 8
test eax, eax
je 0x4a31e0
lea eax, [ebp - 0x230]
push str._nLocation:
push eax
call fcn.0045b6b0
add esp, 8
test eax, eax
je 0x4a31e0
add eax, 0xa
cmp byte [eax], 0x20
jne 0x4a313a
inc eax
cmp byte [eax], 0
mov esi, eax
je 0x4a3153
mov cl, byte [eax]
cmp cl, 0xd
je 0x4a3153
cmp cl, 0xa
je 0x4a3153
inc eax
cmp byte [eax], 0
jne 0x4a3141
mov byte [eax], 0
sub eax, esi
cmp eax, 0x200
ja 0x4a31e0
push 7
push str.http:__
push esi
call fcn.0045b630
add esp, 0xc
test eax, eax
jne 0x4a31e0
xor edi, edi
cmp dword [ebp - 4], edi
jle 0x4a31bb
mov edi, edi
mov ecx, dword [ebp - 0xc]
mov eax, esi
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x4a31a5
test dl, dl
je 0x4a31a1
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x4a31a5
add eax, 2
add ecx, 2
test dl, dl
jne 0x4a3185
xor eax, eax
jmp 0x4a31aa
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x4a31b6
inc edi
cmp edi, dword [ebp - 4]
jl 0x4a3180
jmp 0x4a31bb
cmp edi, dword [ebp - 4]
jl 0x4a31e0
mov ecx, dword [ebp - 0x14]
inc dword [ebp - 4]
mov edx, ecx
add ecx, 0x200
mov eax, esi
mov dword [ebp - 0x14], ecx
sub edx, esi
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x4a31d0
cmp dword [ebp - 4], 5
je 0x4a3234
lea ecx, [ebp - 8]
push ecx
lea edx, [ebp - 0x24]
push edx
push 0
push 0x200
lea eax, [ebp - 0x230]
push eax
push ebx
mov dword [ebp - 8], 0x10
call dword [sym.imp.WS2_32.dll_recvfrom]
test eax, eax
jg 0x4a30b0
mov eax, dword [ebp - 0x10]
add dword [ebp - 0xc], 0x200
inc eax
mov dword [ebp - 0x10], eax
cmp eax, 2
jl 0x4a3000
push ebx
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [ebp - 4]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push ebx
call dword [sym.imp.WS2_32.dll_closesocket]
pop edi
pop esi
mov eax, 5
pop ebx
mov esp, ebp
pop ebp
ret