Function at 0x1002f780
Capabilities:
Create udp socket
Resolve dns
Resolve function by parsing pe exports
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, 0xfffffff8
sub esp, 0x710
push ebx
push ebp
push esi
push edi
push 0x11
push 2
xor ebx, ebx
push 2
mov byte [esp + 0x1c], bl
mov dword [esp + 0x30], ebx
mov dword [esp + 0x4c], 1
call dword [sym.imp.WS2_32.dll_socket]
mov ebp, eax
cmp ebp, ebx
mov dword [esp + 0x1c], ebp
jl 0x1002f8f0
push 0x80
lea eax, [esp + 0x6c]
push ebx
push eax
call sub.ntdll.dll_memset
add esp, 0xc
lea ecx, [esp + 0xe8]
push ecx
push ebx
push str.223.255.255.255
mov word [esp + 0x74], 2
mov dword [esp + 0x78], ebx
call dword [sym.imp.WS2_32.dll_inet_addr]
push eax
call sub.IPHLPAPI.DLL_GetBestRoute
test eax, eax
mov esi, dword [sym.imp.WS2_32.dll_setsockopt]
jne 0x1002f8af
mov edx, dword [0x1003e140]
push 0x1c
push ebx
push edx
mov dword [esp + 0x20], ebx
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
cmp edi, ebx
je 0x1002f8af
push ebx
lea eax, [esp + 0x18]
push eax
push edi
call sub.IPHLPAPI.DLL_GetIpAddrTable
cmp eax, 0x7a
jne 0x1002f843
push edi
call fcn.100012ff
mov ecx, dword [esp + 0x14]
push ecx
call fcn.100012ea
mov edi, eax
cmp edi, ebx
je 0x1002f8af
push ebx
lea edx, [esp + 0x18]
push edx
push edi
call sub.IPHLPAPI.DLL_GetIpAddrTable
mov edx, dword [edi]
xor eax, eax
cmp edx, ebx
jle 0x1002f8a0
mov ebp, dword [esp + 0xf8]
lea ecx, [edi + 8]
cmp dword [ecx], ebp
je 0x1002f875
add eax, 1
add ecx, 0x18
cmp eax, edx
jl 0x1002f865
jmp 0x1002f89c
push 4
lea edx, [esp + 0x38]
push edx
lea eax, [eax + eax*2]
mov ecx, dword [edi + eax*8 + 4]
push 9
lea ebp, [edi + eax*8 + 4]
mov eax, dword [esp + 0x28]
push ebx
push eax
mov dword [esp + 0x48], ecx
call esi
mov ecx, dword [ebp]
mov dword [esp + 0x6c], ecx
mov ebp, dword [esp + 0x1c]
mov edx, dword [0x1003e140]
push edi
push ebx
push edx
call dword [sym.imp.KERNEL32.dll_HeapFree]
push 4
lea eax, [esp + 0x44]
push eax
push 4
push 0xffff
push ebp
call esi
test eax, eax
jl 0x1002f8f0
cmp byte [esp + 0x10], bl
je 0x1002f8d7
push 1
lea ecx, [esp + 0x14]
push ecx
push 0xa
push ebx
push ebp
call esi
push 0x10
lea edx, [esp + 0x6c]
push edx
push ebp
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
je 0x1002f8fa
push ebp
call dword [sym.imp.WS2_32.dll_closesocket]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [str.urn:schemas_upnp_org:device:InternetGatewayDevice:1], ebx
mov dword [esp + 0x34], ebx
je 0x1002fd3e
mov eax, 0x100386cc
nop
mov eax, dword [eax]
push 2
push eax
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
lea ecx, [esp + 0x130]
push 0x600
push ecx
call sub.ntdll.dll__snprintf
add esp, 0x18
mov ebp, eax
xor eax, eax
mov dword [esp + 0x4c], eax
mov dword [esp + 0x50], eax
lea edx, [esp + 0x3c]
push edx
mov dword [esp + 0x4c], eax
mov dword [esp + 0x58], eax
mov dword [esp + 0x5c], eax
mov dword [esp + 0x60], eax
mov dword [esp + 0x64], eax
mov dword [esp + 0x68], eax
lea eax, [esp + 0x4c]
push eax
push str.1900
push str.239.255.255.250
mov dword [esp + 0x5c], ebx
mov dword [esp + 0x60], 2
call dword [sym.imp.WS2_32.dll_getaddrinfo]
test eax, eax
jne 0x1002fd3e
mov edi, dword [esp + 0x3c]
cmp edi, ebx
je 0x1002f9ba
mov esi, dword [sym.imp.WS2_32.dll_sendto]
mov ecx, dword [edi + 0x10]
mov edx, dword [edi + 0x18]
push ecx
mov ecx, dword [esp + 0x20]
push edx
push ebx
push ebp
lea eax, [esp + 0x130]
push eax
push ecx
call esi
mov edi, dword [edi + 0x1c]
cmp edi, ebx
mov ebp, eax
jne 0x1002f994
mov edi, dword [esp + 0x3c]
push edi
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
cmp ebp, ebx
jl 0x1002fd3e
lea esp, [esp]
mov esi, dword [esp + 0x1c]
push 0x600
lea edx, [esp + 0x124]
push edx
mov ecx, 0x7d0
call fcn.100311a0
cmp eax, ebx
mov dword [esp + 0x44], eax
jl 0x1002fd3e
je 0x1002fd19
lea ecx, [esp + 0x28]
push ecx
lea edx, [esp + 0x18]
push edx
lea ecx, [esp + 0x40]
push ecx
lea edx, [esp + 0x38]
push edx
lea ecx, [esp + 0x28]
push ecx
lea edx, [esp + 0x44]
push edx
push eax
lea eax, [esp + 0x13c]
push eax
mov dword [esp + 0x50], ebx
mov dword [esp + 0x38], ebx
mov dword [esp + 0x4c], ebx
mov dword [esp + 0x58], ebx
mov dword [esp + 0x34], ebx
mov dword [esp + 0x48], ebx
call fcn.1002f6b0
cmp dword [esp + 0x2c], ebx
je 0x1002fd0d
cmp dword [esp + 0x30], ebx
je 0x1002fd0d
mov eax, dword [esp + 0x24]
cmp eax, ebx
mov ebp, dword [esp + 0x18]
mov edx, eax
mov dword [esp + 0x20], eax
je 0x1002fc71
cmp ebp, 4
mov esi, dword [edx + 4]
mov ecx, dword [esp + 0x30]
mov eax, ebp
mov edx, esi
jb 0x1002fa94
jmp 0x1002fa80
mov edi, dword [edx]
cmp edi, dword [ecx]
jne 0x1002fa98
sub eax, 4
add ecx, 4
add edx, 4
cmp eax, 4
jae 0x1002fa80
cmp eax, ebx
je 0x1002faf5
movzx edi, byte [edx]
movzx ebp, byte [ecx]
sub edi, ebp
jne 0x1002fae7
sub eax, 1
add ecx, 1
add edx, 1
cmp eax, ebx
je 0x1002faf5
movzx edi, byte [edx]
movzx ebp, byte [ecx]
sub edi, ebp
jne 0x1002fae7
sub eax, 1
add ecx, 1
add edx, 1
cmp eax, ebx
je 0x1002faf5
movzx edi, byte [edx]
movzx ebp, byte [ecx]
sub edi, ebp
jne 0x1002fae7
sub eax, 1
add ecx, 1
add edx, 1
cmp eax, ebx
je 0x1002faf5
movzx edi, byte [edx]
movzx ecx, byte [ecx]
sub edi, ecx
je 0x1002faf5
cmp edi, ebx
mov eax, 1
jg 0x1002faf7
or eax, 0xffffffff
jmp 0x1002faf7
xor eax, eax
cmp eax, ebx
mov ebp, dword [esp + 0x18]
jne 0x1002fc5f
cmp byte [esi + ebp], bl
jne 0x1002fc5f
mov edx, dword [esp + 0x20]
mov eax, dword [esp + 0x38]
cmp eax, 4
mov esi, dword [edx + 8]
mov ecx, dword [esp + 0x2c]
mov edx, esi
jb 0x1002fb36
mov edi, dword [edx]
cmp edi, dword [ecx]
jne 0x1002fb3a
sub eax, 4
add ecx, 4
add edx, 4
cmp eax, 4
jae 0x1002fb22
cmp eax, ebx
je 0x1002fb97
movzx edi, byte [edx]
movzx ebp, byte [ecx]
sub edi, ebp
jne 0x1002fb89
sub eax, 1
add ecx, 1
add edx, 1
cmp eax, ebx
je 0x1002fb97
movzx edi, byte [edx]
movzx ebp, byte [ecx]
sub edi, ebp
jne 0x1002fb89
sub eax, 1
add ecx, 1
add edx, 1
cmp eax, ebx
je 0x1002fb97
movzx edi, byte [edx]
movzx ebp, byte [ecx]
sub edi, ebp
jne 0x1002fb89
sub eax, 1
add ecx, 1
add edx, 1
cmp eax, ebx
je 0x1002fb97
movzx edi, byte [edx]
movzx eax, byte [ecx]
sub edi, eax
je 0x1002fb97
cmp edi, ebx
mov eax, 1
jg 0x1002fb99
or eax, 0xffffffff
jmp 0x1002fb99
xor eax, eax
cmp eax, ebx
jne 0x1002fc5b
mov ecx, dword [esp + 0x38]
cmp byte [esi + ecx], bl
jne 0x1002fc5b
mov esi, dword [esp + 0x28]
cmp esi, ebx
je 0x1002fc4b
cmp esi, 4
mov edx, dword [esp + 0x20]
mov ecx, dword [esp + 0x14]
mov edx, dword [edx + 0x10]
mov eax, esi
jb 0x1002fbe4
lea esp, [esp]
mov edi, dword [edx]
cmp edi, dword [ecx]
jne 0x1002fbe8
sub eax, 4
add ecx, 4
add edx, 4
cmp eax, 4
jae 0x1002fbd0
cmp eax, ebx
je 0x1002fc45
movzx edi, byte [edx]
movzx ebp, byte [ecx]
sub edi, ebp
jne 0x1002fc37
sub eax, 1
add ecx, 1
add edx, 1
cmp eax, ebx
je 0x1002fc45
movzx edi, byte [edx]
movzx ebp, byte [ecx]
sub edi, ebp
jne 0x1002fc37
sub eax, 1
add ecx, 1
add edx, 1
cmp eax, ebx
je 0x1002fc45
movzx edi, byte [edx]
movzx ebp, byte [ecx]
sub edi, ebp
jne 0x1002fc37
sub eax, 1
add ecx, 1
add edx, 1
cmp eax, ebx
je 0x1002fc45
movzx edi, byte [edx]
movzx eax, byte [ecx]
sub edi, eax
je 0x1002fc45
cmp edi, ebx
mov eax, 1
jg 0x1002fc47
or eax, 0xffffffff
jmp 0x1002fc47
xor eax, eax
cmp eax, ebx
jne 0x1002fc5b
mov ecx, dword [esp + 0x20]
mov edx, dword [ecx + 0x10]
cmp byte [esi + edx], bl
je 0x1002fd0d
mov ebp, dword [esp + 0x18]
mov eax, dword [esp + 0x20]
mov edx, dword [eax]
cmp edx, ebx
mov dword [esp + 0x20], edx
jne 0x1002fa6b
mov esi, dword [esp + 0x38]
mov ecx, dword [esp + 0x28]
mov eax, dword [0x1003e140]
add ecx, esi
lea edx, [ecx + ebp + 0x18]
push edx
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
cmp edi, ebx
je 0x1002fd3e
mov ecx, dword [esp + 0x24]
mov dword [edi], ecx
lea ecx, [edi + ebp + 0x15]
lea edx, [ecx + esi + 1]
mov dword [edi + 8], ecx
mov ecx, dword [esp + 0x30]
push ebp
lea eax, [edi + 0x14]
push ecx
push eax
mov dword [edi + 4], eax
mov dword [edi + 0x10], edx
call sub.ntdll.dll_memcpy
mov edx, dword [esp + 0x38]
add esp, 0xc
push esi
mov byte [edi + ebp + 0x14], bl
mov eax, dword [edi + 8]
push edx
push eax
call sub.ntdll.dll_memcpy
add esp, 0xc
cmp dword [esp + 0x14], ebx
lea ecx, [edi + esi]
mov byte [ecx + ebp + 0x15], bl
je 0x1002fcf9
mov edx, dword [esp + 0x28]
mov eax, dword [esp + 0x14]
mov ecx, dword [edi + 0x10]
push edx
push eax
push ecx
call sub.ntdll.dll_memcpy
add esp, 0xc
mov edx, dword [esp + 0x28]
lea eax, [edi + edx]
add eax, esi
mov byte [eax + ebp + 0x16], bl
mov dword [edi + 0xc], ebx
mov dword [esp + 0x24], edi
cmp dword [esp + 0x44], ebx
jg 0x1002f9d0
jmp 0x1002fd1f
cmp dword [esp + 0x24], ebx
jne 0x1002fd3e
mov eax, dword [esp + 0x34]
add eax, 1
cmp dword [eax*4 + 0x100386cc], ebx
mov dword [esp + 0x34], eax
lea eax, [eax*4 + 0x100386cc]
jne 0x1002f910
mov ecx, dword [esp + 0x1c]
push ecx
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [esp + 0x24]
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret