Function at 0x513689
Capabilities:
Send data
Send data on socket
Send http request
Send http request with host header

Disassembly:
push ebp
sub esp, 0x58
mov eax, 0x6aaf8d
call fcn.006426c4
sub esp, 0x74
push ebx
push esi
push edi
xor eax, eax
lea edi, [ebp + 0x30]
stosd dword es:[edi], eax
mov ebx, ecx
push 2
mov dword [ebp + 0x58], ebx
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
pop eax
push dword [ebp + 0x64]
mov word [ebp + 0x30], ax
mov eax, 0x6c07
mov word [ebp + 0x32], ax
call dword [sym.imp.WS2_32.dll_htonl]
mov dword [ebp + 0x34], eax
xor eax, eax
mov dword [ebp + 0x54], 0xf
mov dword [ebp + 0x50], eax
mov byte [ebp + 0x40], al
mov esi, dword [ebp + 0x68]
mov dword [ebp - 4], eax
test esi, esi
jne 0x5136fb
mov esi, str.M_SEARCH__HTTP_1.1_r_nHOST:_239.255.255.250:1900_r_nST:upnp:rootdevice_r_nMAN:_ssdp:discover__r_nMX:3_r_n_r_n
push esi
call fcn.0040f53e
pop ecx
push eax
push esi
lea ecx, [ebp + 0x40]
call fcn.0040f2b7
jmp 0x5138b1
cmp esi, 1
je 0x513710
cmp esi, 2
je 0x513710
mov dword [ebp + 0x50], eax
mov byte [ebp + 0x40], al
jmp 0x5138ba
mov eax, dword fs:[0x2c]
mov ecx, dword [0x7e59f0]
mov ecx, dword [eax + ecx*4]
mov eax, dword [0x7bd85c]
cmp eax, dword [ecx + 4]
jle 0x513765
mov edi, 0x7bd85c
push edi
call fcn.00642848
cmp dword [0x7bd85c], 0xffffffff
pop ecx
jne 0x513765
mov ecx, 0x7bd7f8
mov byte [ebp - 4], 1
call fcn.004ce5a0
push 0x6bdfe9
call fcn.006426af
push edi
mov byte [ebp - 4], 0
call fcn.00642809
pop ecx
pop ecx
lea eax, [ebp - 0x24]
push eax
call fcn.00513d42
lea eax, [ebp]
mov byte [ebp - 4], 2
push eax
call fcn.0051233b
lea eax, [ebp + 0x18]
mov byte [ebp - 4], 3
push eax
call fcn.005124cc
cmp byte [0x7b7942], 0
mov eax, dword [0x7b79e0]
mov byte [ebp - 4], 4
jne 0x51379f
mov eax, dword [0x7b0728]
push eax
call fcn.00513ded
push eax
lea ecx, [ebp - 0x38]
call fcn.004cc35d
mov dword [ebp + 0x68], str.ssdp:alive
cmp esi, 1
je 0x5137c1
mov dword [ebp + 0x68], str.ssdp:byebye
push 1
push 0
lea eax, [ebp - 0x80]
push eax
call fcn.004722e0
mov esi, eax
lea eax, [ebp - 0x68]
mov byte [ebp - 4], 5
push eax
call fcn.00495156
cmp dword [esi + 0x14], 0x10
mov byte [ebp - 4], 6
jb 0x5137e9
mov esi, dword [esi]
cmp dword [ebp + 0x14], 8
mov ecx, dword [ebp]
jae 0x5137f5
lea ecx, [ebp]
cmp dword [ebp + 0x2c], 0x10
mov ebx, dword [ebp + 0x18]
mov dword [ebp + 0x64], ecx
jae 0x513804
lea ebx, [ebp + 0x18]
cmp dword [eax + 0x14], 0x10
jb 0x51380c
mov eax, dword [eax]
cmp dword [ebp - 0x10], 0x10
mov edi, dword [ebp - 0x24]
jae 0x513818
lea edi, [ebp - 0x24]
cmp dword [0x7bd840], 0x10
mov edx, dword [0x7bd82c]
jae 0x51382c
mov edx, 0x7bd82c
cmp dword [0x7bd810], 0x10
mov ecx, dword [0x7bd7fc]
jae 0x513840
mov ecx, 0x7bd7fc
push esi
push dword [ebp + 0x64]
push ebx
push dword [ebp + 0x68]
push eax
push edi
push edx
push ecx
lea eax, [ebp - 0x38]
push eax
lea eax, [ebp - 0x50]
push str.NOTIFY__HTTP_1.1_r_nHOST:_239.255.255.250:1900_r_nLOCATION:_http:___A_r_nSERVER:__s__s_UPnP_1.1__s__s_r_nNTS:__s_r_nST:_ut:client:service:pairing_r_nUSN:_uuid:_s_r_nFRIENDLYNAME:_S_r_nHH:_s_r_n_r_n
push eax
call fcn.00465d5a
add esp, 0x2c
lea ecx, [ebp + 0x40]
push eax
call fcn.0040ef82
xor ebx, ebx
lea ecx, [ebp - 0x50]
push ebx
push 1
call fcn.0040f95f
push ebx
push 1
lea ecx, [ebp - 0x68]
call fcn.0040f95f
push ebx
push 1
lea ecx, [ebp - 0x80]
call fcn.0040f95f
push ebx
push 1
lea ecx, [ebp + 0x18]
call fcn.0040f95f
push ebx
push 1
lea ecx, [ebp]
call fcn.004285f6
push ebx
push 1
lea ecx, [ebp - 0x24]
call fcn.0040f95f
mov ebx, dword [ebp + 0x58]
cmp dword [ebp + 0x54], 0x10
mov eax, dword [ebp + 0x40]
jae 0x5138bd
lea eax, [ebp + 0x40]
push 0x10
lea ecx, [ebp + 0x30]
push ecx
push 0
push dword [ebp + 0x50]
push eax
push dword [ebx + 4]
call dword [sym.imp.WS2_32.dll_sendto]
test eax, eax
lea ecx, [ebp + 0x40]
push 0
push 1
setg bl
call fcn.0040f95f
mov ecx, dword [ebp - 0xc]
mov al, bl
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
lea esp, [ebp + 0x5c]
pop ebp
ret 8