Function at 0x40ed07
Capabilities:
Check http status code
Connect to http server
Create http request
Download and write a file
Get common file path
Parse url
Read data from internet
Receive and write data from server to client
Receive data
Reference http user-agent string
Send data
Send http request
Write file on windows

Disassembly:
push ebp
lea ebp, [esp - 0x2910]
mov eax, 0x2990
call fcn.0042d800
mov eax, dword [0x43e030]
xor eax, ebp
mov dword [ebp + 0x290c], eax
mov eax, dword [ebp + 0x2918]
push ebx
xor ebx, ebx
push esi
push edi
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x1c], 0x1388
mov dword [ebp - 0x24], ebx
cmp eax, ebx
je 0x40f0be
cmp word [eax], bx
je 0x40f0be
push 0x38
lea eax, [ebp - 0x7c]
push ebx
push eax
call fcn.00421bc0
xor eax, eax
push SetFileAttributesW
mov word [ebp + reloc.ADVAPI32.dll_RegCloseKey], ax
lea eax, [ebp + 0x1ffa]
push ebx
push eax
mov dword [ebp - 0x80], HeapFree
call fcn.00421bc0
lea eax, [ebp + 0x1ff8]
mov dword [ebp - 0x70], eax
xor eax, eax
mov esi, 0xfe
push esi
mov word [ebp + reloc.ADVAPI32.dll_RegCloseKey], ax
lea eax, [ebp + 0x260a]
push ebx
push eax
mov dword [ebp - 0x6c], 0xff
call fcn.00421bc0
push 0x7f
lea eax, [ebp + 0x2608]
pop edi
mov dword [ebp - 0x64], eax
xor eax, eax
push esi
mov word [ebp + reloc.ADVAPI32.dll_RegCloseKey], ax
lea eax, [ebp + 0x270a]
push ebx
push eax
mov dword [ebp - 0x60], edi
call fcn.00421bc0
lea eax, [ebp + 0x2708]
mov dword [ebp - 0x5c], eax
xor eax, eax
push LockResource
mov word [ebp - 8], ax
lea eax, [ebp - 6]
push ebx
push eax
mov dword [ebp - 0x58], edi
call fcn.00421bc0
add esp, 0x3c
lea eax, [ebp - 8]
mov dword [ebp - 0x54], eax
lea eax, [ebp - 0x80]
push eax
push ebx
push ebx
push dword [ebp - 0x20]
mov dword [ebp - 0x50], 0x7ff
call dword [sym.imp.WININET.dll_InternetCrackUrlW]
test eax, eax
je 0x40f0be
cmp dword [ebp - 0x74], 3
push 4
pop esi
je 0x40ee29
cmp dword [ebp - 0x74], esi
jne 0x40f0be
push 0x103
lea eax, [ebp + 0x2809]
push ebx
push eax
mov byte [ebp + 0x2808], bl
call fcn.00421bc0
add esp, 0xc
lea eax, [ebp - 0x3c]
push eax
lea eax, [ebp + 0x2808]
push eax
push ebx
mov dword [ebp - 0x3c], 0x104
call sub.urlmon.dll_ObtainUserAgentString
lea eax, [ebp - 0x34]
push eax
lea eax, [ebp - 0x10]
push eax
push 0x49
push ebx
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0x34], esi
call dword [sym.imp.WININET.dll_InternetQueryOptionW]
mov edi, dword [sym.imp.WININET.dll_InternetSetOptionW]
inc dword [ebp - 0x10]
push esi
lea eax, [ebp - 0x10]
push eax
push 0x49
push ebx
call edi
mov dword [ebp - 0x44], 0x437a68
mov dword [ebp - 0x40], ebx
lea eax, [ebp + 0x2808]
cmp byte [ebp + 0x2808], bl
jne 0x40eea3
mov eax, 0x437a70
push ebx
push ebx
push ebx
push ebx
push eax
call dword [sym.imp.WININET.dll_InternetOpenA]
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x1c], ebx
je 0x40eed8
push esi
lea ecx, [ebp - 0x1c]
push ecx
push 2
push eax
call edi
push esi
lea eax, [ebp - 0x1c]
push eax
push 5
push dword [ebp - 0x18]
call edi
push esi
lea eax, [ebp - 0x1c]
push eax
push 6
push dword [ebp - 0x18]
call edi
push ebx
push ebx
push 3
push dword [ebp - 0x5c]
push dword [ebp - 0x64]
push dword [ebp - 0x68]
push dword [ebp - 0x70]
push dword [ebp - 0x18]
call dword [sym.imp.WININET.dll_InternetConnectW]
mov dword [ebp - 0x20], eax
xor eax, eax
cmp dword [ebp - 0x74], esi
jne 0x40ef00
mov eax, 0x803000
push ebx
or eax, 0x84000100
push eax
lea eax, [ebp - 0x44]
push eax
push ebx
push 0x437ab0
push dword [ebp - 0x54]
push 0x437ac4
push dword [ebp - 0x20]
call dword [sym.imp.WININET.dll_HttpOpenRequestW]
push esi
lea ecx, [ebp - 0x30]
push ecx
push 0x41
push eax
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x30], 1
call edi
mov dword [ebp - 0xc], 0x437ad0
test eax, eax
jne 0x40ef48
mov dword [ebp - 0xc], 0x437b68
mov eax, dword [ebp - 0xc]
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
cmp cx, bx
jne 0x40ef4e
push ebx
sub eax, edx
push ebx
sar eax, 1
push eax
push dword [ebp - 0xc]
push dword [ebp - 0x14]
call dword [sym.imp.WININET.dll_HttpSendRequestW]
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x38], esi
cmp eax, ebx
je 0x40f096
push ebx
lea eax, [ebp - 0x38]
push eax
lea eax, [ebp - 0x28]
push eax
push 0x20000013
push dword [ebp - 0x14]
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
test eax, eax
je 0x40f096
cmp dword [ebp - 0x28], 0xc8
jne 0x40f096
xor eax, eax
mov esi, 0x206
push esi
mov word [ebp + reloc.ADVAPI32.dll_RegCloseKey], ax
lea eax, [ebp + 0x2402]
push ebx
push eax
call fcn.00421bc0
xor eax, eax
push esi
mov word [ebp + reloc.ADVAPI32.dll_RegCloseKey], ax
lea eax, [ebp + 0x21fa]
push ebx
push eax
call fcn.00421bc0
add esp, 0x18
lea eax, [ebp + 0x21f8]
push eax
push 0x103
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
test eax, eax
je 0x40f011
lea eax, [ebp + 0x2400]
push eax
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push eax
push 0x435dc8
lea eax, [ebp + 0x21f8]
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
lea eax, [ebp + 0x2400]
push 0x437a48
push eax
call fcn.00420a04
pop ecx
pop ecx
mov dword [ebp - 0x2c], eax
cmp eax, ebx
je 0x40f096
push LockResource
lea eax, [ebp + 0xff9]
push ebx
push eax
mov byte [ebp + 0xff8], bl
call fcn.00421bc0
mov esi, dword [sym.imp.WININET.dll_InternetReadFile]
add esp, 0xc
mov dword [ebp - 0xc], ebx
jmp 0x40f06d
cmp dword [ebp - 0xc], ebx
je 0x40f086
push dword [ebp - 0x2c]
lea eax, [ebp + 0xff8]
push 1
push dword [ebp - 0xc]
push eax
call fcn.00421154
add esp, 0x10
lea eax, [ebp - 0xc]
push eax
push reloc.KERNEL32.dll_WaitForMultipleObjects
lea eax, [ebp + 0xff8]
push eax
push dword [ebp - 0x14]
call esi
test eax, eax
jne 0x40f051
push dword [ebp - 0x2c]
call fcn.0042124d
pop ecx
mov dword [ebp - 0x24], 1
push dword [ebp - 0x14]
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
push dword [ebp - 0x20]
call esi
push dword [ebp - 0x18]
call esi
dec dword [ebp - 0x10]
push 4
lea eax, [ebp - 0x10]
push eax
push 0x49
push ebx
call edi
mov eax, dword [ebp - 0x24]
jmp 0x40f0c0
xor eax, eax
mov ecx, dword [ebp + 0x290c]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0041f23c
add ebp, 0x2910
leave
ret