Function at 0x40dcc0
Capabilities:
Create udp socket
Resolve dns
Send data
Send data on socket
Send http request
Send http request with host header
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff0
sub esp, 0x718
mov eax, dword [0x5c0020]
xor eax, esp
mov dword [esp + 0x714], eax
push esi
mov esi, dword [ebp + 0x14]
push edi
mov dword [esp + 0x18], esi
mov dword [esp + 0x24], 0
mov dword [esp + 0x3c], 1
test esi, esi
je 0x40dcfd
mov dword [esi], 0xffffffff
push 0x11
push 2
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov edi, eax
mov dword [esp + 0x14], edi
test edi, edi
jns 0x40dd4c
test esi, esi
je 0x40dd1d
mov dword [esi], 0xffffff9b
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
push str.socket
push str.Socket_error:__s___d_n
call fcn.0054ea8e
add esp, 0xc
xor eax, eax
pop edi
pop esi
mov ecx, dword [esp + 0x714]
xor ecx, esp
call fcn.0053786f
mov esp, ebp
pop ebp
ret
push 0x80
lea eax, [esp + 0x64]
push 0
push eax
call fcn.0053abe0
add esp, 0xc
mov eax, 2
mov word [esp + 0x60], ax
lea eax, [esp + 0xe0]
push eax
push 0
push str.223.255.255.255
mov dword [esp + 0x70], 0
call dword [sym.imp.WS2_32.dll_inet_addr]
push eax
call dword [sym.imp.IPHLPAPI.DLL_GetBestRoute]
test eax, eax
jne 0x40de57
push 0x1c
mov dword [esp + 0x14], eax
call fcn.0053a7e0
mov edi, dword [sym.imp.IPHLPAPI.DLL_GetIpAddrTable]
add esp, 4
mov esi, eax
push 0
lea eax, [esp + 0x14]
push eax
push esi
call edi
cmp eax, 0x7a
jne 0x40ddd2
push esi
call fcn.0053a7a8
add esp, 4
push dword [esp + 0x10]
call fcn.0053a7e0
add esp, 4
mov esi, eax
test esi, esi
je 0x40de4f
push 0
lea eax, [esp + 0x14]
push eax
push esi
call edi
mov edx, dword [esi]
xor eax, eax
test edx, edx
jle 0x40de46
mov edi, dword [esp + 0xf0]
lea ecx, [esi + 8]
cmp dword [ecx], edi
je 0x40de00
inc eax
add ecx, 0x18
cmp eax, edx
jl 0x40ddf2
jmp 0x40de46
lea eax, [eax + eax*2]
push 4
lea edi, [esi + eax*8]
mov eax, dword [edi + 4]
mov dword [esp + 0x2c], eax
lea eax, [esp + 0x2c]
push eax
push 9
push 0
push dword [esp + 0x24]
call dword [sym.imp.WSOCK32.dll_setsockopt]
test eax, eax
jns 0x40de3f
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
push str.setsockopt
push str.Socket_error:__s___d_n
call fcn.0054ea8e
add esp, 0xc
mov eax, dword [edi + 4]
mov dword [esp + 0x64], eax
push esi
call fcn.0053a7a8
add esp, 4
mov edi, dword [esp + 0x14]
mov esi, dword [esp + 0x18]
push 4
lea eax, [esp + 0x40]
push eax
push 4
push 0xffff
push edi
call dword [sym.imp.WSOCK32.dll_setsockopt]
test eax, eax
jns 0x40dea9
test esi, esi
je 0x40de7a
mov dword [esi], 0xffffff9b
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
push str.setsockopt
push str.Socket_error:__s___d_n
call fcn.0054ea8e
add esp, 0xc
xor eax, eax
pop edi
pop esi
mov ecx, dword [esp + 0x714]
xor ecx, esp
call fcn.0053786f
mov esp, ebp
pop ebp
ret
push 0x10
lea eax, [esp + 0x64]
push eax
push edi
call dword [sym.imp.WSOCK32.dll_bind]
test eax, eax
je 0x40defb
test esi, esi
je 0x40dec5
mov dword [esi], 0xffffff9b
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
push str.bind
push str.Socket_error:__s___d_n
call fcn.0054ea8e
add esp, 0xc
push edi
call dword [sym.imp.WS2_32.dll_closesocket]
xor eax, eax
pop edi
pop esi
mov ecx, dword [esp + 0x714]
xor ecx, esp
call fcn.0053786f
mov esp, ebp
pop ebp
ret
test esi, esi
je 0x40df05
mov dword [esi], 0
xor eax, eax
cmp dword [str.urn:schemas_upnp_org:device:InternetGatewayDevice:1], eax
je 0x40e272
mov ecx, 0x59b2f8
mov dword [esp + 0x28], ecx
lea esp, [esp]
test eax, eax
jne 0x40dff8
push 2
push dword [ecx]
lea eax, [esp + 0x120]
push str.239.255.255.250
push str.M_SEARCH__HTTP_1.1_r_nHOST:__s:1900_r_nST:__s_r_nMAN:__ssdp:discover__r_nMX:__u_r_n_r_n
push 0x600
push eax
call fcn.005532a0
add esp, 0x18
mov edi, eax
lea eax, [esp + 0x38]
push eax
lea eax, [esp + 0x44]
push eax
xorps xmm0, xmm0
push str.1900
movdqa xmmword [esp + 0x4c], xmm0
push str.239.255.255.250
movdqa xmmword [esp + 0x60], xmm0
mov dword [esp + 0x54], 0
mov dword [esp + 0x58], 2
call dword [sym.imp.WS2_32.dll_getaddrinfo]
test eax, eax
jne 0x40e22d
mov esi, dword [esp + 0x38]
test esi, esi
je 0x40dfe5
jmp 0x40dfa0
push dword [esi + 0x10]
lea eax, [esp + 0x11c]
push dword [esi + 0x18]
push 0
push edi
push eax
push dword [esp + 0x28]
call dword [sym.imp.WSOCK32.dll_sendto]
mov edi, eax
test edi, edi
jns 0x40dfda
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
push str.sendto
push str.Socket_error:__s___d_n
call fcn.0054ea8e
add esp, 0xc
mov esi, dword [esi + 0x1c]
test esi, esi
jne 0x40dfa0
mov esi, dword [esp + 0x38]
push esi
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
test edi, edi
js 0x40e264
mov edi, dword [esp + 0x14]
push ecx
push 0x7d0
push 0x600
lea edx, [esp + 0x124]
mov ecx, edi
call fcn.0040f370
add esp, 0xc
mov dword [esp + 0x10], eax
test eax, eax
js 0x40e264
jne 0x40e044
cmp dword [esp + 0x24], 0
je 0x40e217
mov eax, dword [esp + 0x18]
test eax, eax
je 0x40e272
mov dword [eax], 0
jmp 0x40e272
lea ecx, [esp + 0x20]
push ecx
lea ecx, [esp + 0x30]
push ecx
lea ecx, [esp + 0x24]
push ecx
lea ecx, [esp + 0x3c]
push ecx
mov edx, eax
lea ecx, [esp + 0x128]
mov dword [esp + 0x40], 0
mov dword [esp + 0x2c], 0
mov dword [esp + 0x3c], 0
mov dword [esp + 0x30], 0
call fcn.0040dc00
add esp, 0x10
cmp dword [esp + 0x2c], 0
je 0x40e213
mov edx, dword [esp + 0x30]
test edx, edx
je 0x40e213
mov esi, dword [esp + 0x24]
mov eax, esi
mov dword [esp + 0x34], esi
test esi, esi
je 0x40e19b
mov esi, dword [esp + 0x1c]
mov edi, dword [eax + 4]
mov ecx, edi
sub esi, 4
jb 0x40e0d1
mov eax, dword [ecx]
cmp eax, dword [edx]
jne 0x40e0d6
add ecx, 4
add edx, 4
sub esi, 4
jae 0x40e0c0
cmp esi, 0xfffffffc
je 0x40e10f
mov al, byte [ecx]
cmp al, byte [edx]
jne 0x40e181
cmp esi, 0xfffffffd
je 0x40e10f
mov al, byte [ecx + 1]
cmp al, byte [edx + 1]
jne 0x40e181
cmp esi, 0xfffffffe
je 0x40e10f
mov al, byte [ecx + 2]
cmp al, byte [edx + 2]
jne 0x40e181
cmp esi, 0xffffffff
je 0x40e10f
mov al, byte [ecx + 3]
cmp al, byte [edx + 3]
jne 0x40e181
mov eax, dword [esp + 0x1c]
cmp byte [edi + eax], 0
jne 0x40e181
mov edi, dword [esp + 0x34]
mov esi, dword [esp + 0x20]
mov edi, dword [edi + 8]
mov eax, dword [esp + 0x2c]
mov edx, edi
sub esi, 4
jb 0x40e141
nop
mov ecx, dword [edx]
cmp ecx, dword [eax]
jne 0x40e146
add edx, 4
add eax, 4
sub esi, 4
jae 0x40e130
cmp esi, 0xfffffffc
je 0x40e173
mov cl, byte [edx]
cmp cl, byte [eax]
jne 0x40e181
cmp esi, 0xfffffffd
je 0x40e173
mov cl, byte [edx + 1]
cmp cl, byte [eax + 1]
jne 0x40e181
cmp esi, 0xfffffffe
je 0x40e173
mov cl, byte [edx + 2]
cmp cl, byte [eax + 2]
jne 0x40e181
cmp esi, 0xffffffff
je 0x40e173
mov cl, byte [edx + 3]
cmp cl, byte [eax + 3]
jne 0x40e181
mov eax, dword [esp + 0x20]
cmp byte [edi + eax], 0
je 0x40e20f
mov eax, dword [esp + 0x34]
mov edx, dword [esp + 0x30]
mov eax, dword [eax]
mov dword [esp + 0x34], eax
test eax, eax
jne 0x40e0b2
mov esi, dword [esp + 0x24]
mov eax, dword [esp + 0x1c]
add eax, 0x14
add eax, dword [esp + 0x20]
push eax
call fcn.0053a7e0
mov edi, eax
add esp, 4
test edi, edi
je 0x40e254
mov ecx, dword [esp + 0x1c]
push ecx
push dword [esp + 0x34]
mov dword [edi], esi
lea eax, [edi + 0x10]
lea esi, [ecx + 0x11]
add esi, edi
push eax
mov dword [edi + 4], eax
mov dword [edi + 8], esi
call fcn.005398d0
mov eax, dword [esp + 0x28]
add esp, 0xc
mov byte [edi + eax + 0x10], 0
push dword [esp + 0x20]
push dword [esp + 0x30]
push esi
call fcn.005398d0
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x28]
add esp, 0xc
add eax, edi
mov dword [esp + 0x24], edi
mov byte [eax + ecx + 0x11], 0
mov dword [edi + 0xc], 0
mov edi, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x28]
add ecx, 4
mov dword [esp + 0x28], ecx
cmp dword [ecx], 0
jne 0x40df20
jmp 0x40e272
mov esi, dword [esp + 0x18]
test esi, esi
je 0x40e23b
mov dword [esi], 0xffffff9b
push eax
push str.getaddrinfo___failed:__d_n
call fcn.00546598
add eax, 0x40
push eax
call fcn.00539ff7
add esp, 0xc
jmp 0x40e272
mov eax, dword [esp + 0x18]
test eax, eax
je 0x40e272
mov dword [eax], 0xffffff9a
jmp 0x40e272
mov eax, dword [esp + 0x18]
test eax, eax
je 0x40e272
mov dword [eax], 0xffffff9b
push dword [esp + 0x14]
call dword [sym.imp.WS2_32.dll_closesocket]
mov ecx, dword [esp + 0x71c]
mov eax, dword [esp + 0x24]
pop edi
pop esi
xor ecx, esp
call fcn.0053786f
mov esp, ebp
pop ebp
ret