Function at 0x513901
Capabilities:
Receive data
Receive data on socket
Send data
Send data on socket
Send http request

Disassembly:
push ebp
sub esp, 0x60
mov eax, 0x6aaff7
call fcn.006426c4
sub esp, 0x8cc
cmp byte [0x7b7942], 0
mov eax, dword [0x7b79e0]
push ebx
push esi
push edi
push 0x10
pop edi
mov dword [ebp + 0x5c], ecx
mov dword [ebp + 0x58], edi
jne 0x513934
mov eax, dword [0x7b0728]
push eax
call fcn.00513ded
push eax
lea ecx, [ebp - 0x50]
call fcn.004cc35d
mov eax, dword fs:[0x2c]
mov ecx, dword [0x7e59f0]
mov ecx, dword [eax + ecx*4]
mov eax, dword [0x7bd8c4]
cmp eax, dword [ecx + 4]
jle 0x513998
mov esi, 0x7bd8c4
push esi
call fcn.00642848
cmp dword [0x7bd8c4], 0xffffffff
pop ecx
jne 0x513998
and dword [ebp - 4], 0
mov ecx, 0x7bd860
call fcn.004ce5a0
push 0x6bdfdf
call fcn.006426af
or dword [ebp - 4], 0xffffffff
push esi
call fcn.00642809
pop ecx
pop ecx
lea eax, [ebp - 0x3c]
push eax
call fcn.0051233b
xor ebx, ebx
lea eax, [ebp - 0x24]
inc ebx
push eax
mov dword [ebp - 4], ebx
call fcn.00513d42
lea eax, [ebp]
mov byte [ebp - 4], 2
push eax
call fcn.005124cc
push ebx
push 0
lea eax, [ebp - 0xa8]
mov byte [ebp - 4], 3
push eax
call fcn.004722e0
mov esi, eax
lea eax, [ebp - 0x90]
mov byte [ebp - 4], 4
push eax
call fcn.00495156
mov byte [ebp - 4], 5
cmp dword [esi + 0x14], edi
jb 0x5139ed
mov esi, dword [esi]
cmp dword [ebp - 0x28], 8
mov ecx, dword [ebp - 0x3c]
jae 0x5139f9
lea ecx, [ebp - 0x3c]
mov ebx, dword [ebp]
mov dword [ebp + 0x60], ecx
cmp dword [ebp + 0x14], edi
jae 0x513a07
lea ebx, [ebp]
cmp dword [eax + 0x14], edi
jb 0x513a0e
mov eax, dword [eax]
cmp dword [ebp - 0x10], edi
mov edi, dword [ebp - 0x24]
jae 0x513a19
lea edi, [ebp - 0x24]
cmp dword [0x7bd8a8], 0x10
mov edx, dword [0x7bd894]
jae 0x513a2d
mov edx, 0x7bd894
cmp dword [0x7bd878], 0x10
mov ecx, dword [0x7bd864]
jae 0x513a41
mov ecx, 0x7bd864
push esi
push dword [ebp + 0x60]
push ebx
push eax
push edi
push edx
push ecx
lea eax, [ebp - 0x50]
push eax
push 0x4b0
push dword [0x78fc00]
lea eax, [ebp + 0x28]
push eax
call fcn.00465d5a
add esp, 0x2c
push 0
push 1
lea ecx, [ebp - 0x90]
call fcn.0040f95f
push 0
push 1
lea ecx, [ebp - 0xa8]
mov byte [ebp - 4], 8
call fcn.0040f95f
mov ebx, dword [ebp + 0x5c]
mov dword [ebp + 0x60], 0xa
xor eax, eax
lea edi, [ebp + 0x18]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
lea eax, [ebp + 0x58]
push eax
lea eax, [ebp + 0x18]
push eax
push 0
push 0x7ff
lea eax, [ebp - 0x8d8]
push eax
push dword [ebx]
call dword [sym.imp.WS2_32.dll_recvfrom]
mov esi, eax
lea ecx, [ebp - 0x64]
lea eax, [ebp + 0x18]
push eax
call fcn.004cc309
test esi, esi
jns 0x513aff
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov esi, eax
push esi
push str.recvfrom_ERROR:__d
push 1
call fcn.00513dfb
add esp, 0xc
cmp esi, 0x2738
je 0x513cf1
cmp esi, 0x2746
jne 0x513d00
jmp 0x513cf1
lea eax, [ebp - 0x8d8]
mov byte [ebp + esi - 0x8d8], 0
push eax
push dword [ebx]
lea eax, [ebp - 0x64]
push eax
push str.DEBUG:_UPnP:_Received_UPnP_packet__from__A___socket__p_:_n_s
push 0
call fcn.00513dfb
add esp, 0x14
lea eax, [ebp - 0x8d8]
push str.M_SEARCH
push eax
call fcn.0047e50b
test al, al
je 0x513c9f
xor ebx, ebx
lea edi, [ebp - 0x8d8]
push edi
mov esi, edi
call fcn.0047e460
push 0x6e81d8
push esi
mov edi, eax
call fcn.0047e50b
test al, al
jne 0x513b63
test edi, edi
jne 0x513b44
jmp 0x513b6e
add esi, 2
inc esi
cmp byte [esi], 0x20
je 0x513b66
mov ebx, esi
lea eax, [ebp - 0xd8]
push eax
call fcn.0047da10
mov esi, eax
push ebx
lea eax, [ebp - 0xc0]
mov byte [ebp - 4], 9
push eax
call fcn.00466f19
push esi
push eax
lea eax, [ebp + 0x40]
mov byte [ebp - 4], 0xa
push eax
call fcn.0047d9b5
xor ebx, ebx
lea ecx, [ebp - 0xc0]
push ebx
push 1
call fcn.0040f95f
push ebx
push 1
lea ecx, [ebp - 0xd8]
mov byte [ebp - 4], 0xd
call fcn.0040f95f
mov eax, dword [ebp + 0x40]
push 0x10
pop edi
cmp dword [ebp + 0x54], edi
jae 0x513bcc
lea eax, [ebp + 0x40]
push str.ut:client:service:pairing
push eax
call fcn.0047e50b
test al, al
jne 0x513c14
mov eax, dword [ebp + 0x40]
cmp dword [ebp + 0x54], edi
jae 0x513be6
lea eax, [ebp + 0x40]
push str.ssdp:all
push eax
call fcn.0047e50b
test al, al
jne 0x513c14
mov eax, dword [ebp + 0x40]
cmp dword [ebp + 0x54], edi
jae 0x513c00
lea eax, [ebp + 0x40]
push eax
push str.DEBUG:_UPnP:_Not_replying_to_Service_Type___S_
push ebx
call fcn.00513fa9
mov ebx, dword [ebp + 0x5c]
add esp, 0xc
jmp 0x513c8d
push str.DEBUG:_UPnP:_Got_an_m_search_event
push ebx
call fcn.00513dfb
mov eax, dword [ebp + 0x28]
pop ecx
pop ecx
cmp dword [ebp + 0x3c], edi
jae 0x513c2c
lea eax, [ebp + 0x28]
push edi
lea ecx, [ebp + 0x18]
push ecx
push ebx
push dword [ebp + 0x38]
mov ebx, dword [ebp + 0x5c]
push eax
push dword [ebx]
call dword [sym.imp.WS2_32.dll_sendto]
mov esi, eax
lea ecx, [ebp - 0x78]
lea eax, [ebp + 0x18]
push eax
call fcn.004cc309
mov ecx, dword [ebp + 0x28]
cmp dword [ebp + 0x3c], edi
jae 0x513c5a
lea ecx, [ebp + 0x28]
push ecx
push dword [ebx]
lea eax, [ebp - 0x78]
push eax
push str.SENDING_RESPONSE__to__A___socket__p_:_n_s
push 0
call fcn.00513dfb
add esp, 0x14
cmp esi, dword [ebp + 0x38]
je 0x513c8d
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push dword [ebx]
push str.DEBUG:_UPnP:_Send_error__socket__p_:__d
push 0
call fcn.00513fa9
add esp, 0x10
push 0
push 1
lea ecx, [ebp + 0x40]
mov byte [ebp - 4], 8
call fcn.0040f95f
jmp 0x513cf1
push str.DEBUG:_UPnP:_Got_a_reply_notify_event
push 0
call fcn.00513dfb
pop ecx
pop ecx
lea edi, [ebp - 0x8d8]
push edi
mov esi, edi
call fcn.0047e460
push str.location:
push esi
mov edi, eax
call fcn.0047e50b
test al, al
jne 0x513cd2
test edi, edi
jne 0x513cb3
jmp 0x513cf1
add esi, 8
inc esi
cmp byte [esi], 0x20
je 0x513cd5
push esi
push str.UPnP:_Found_location_from_upnp_notify:__s_n
push 0
call fcn.00513dfb
add esp, 0xc
push esi
call fcn.00512405
mov eax, dword [ebp + 0x60]
dec eax
mov dword [ebp + 0x60], eax
test eax, eax
jg 0x513a91
xor ebx, ebx
lea ecx, [ebp + 0x28]
push ebx
push 1
call fcn.0040f95f
push ebx
push 1
lea ecx, [ebp]
call fcn.0040f95f
push ebx
push 1
lea ecx, [ebp - 0x24]
call fcn.0040f95f
push ebx
push 1
lea ecx, [ebp - 0x3c]
call fcn.004285f6
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
lea esp, [ebp + 0x64]
pop ebp
ret 4