Function at 0x401dbd
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
mov ebp, esp
mov eax, 0x297c
call fcn.0041b1d0
push ebx
push esi
mov esi, dword [ebp + 8]
xor ebx, ebx
cmp esi, ebx
push edi
mov dword [ebp - 4], ebx
je 0x402151
cmp word [esi], bx
je 0x402151
push 0xe
xor eax, eax
pop ecx
lea edi, [ebp - 0x64]
push 0x7f
mov word [ebp - 0x97c], bx
rep stosd dword es:[edi], eax
pop edx
lea edi, [ebp - 0x97a]
mov ecx, edx
push 0x3f
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x97c]
pop ecx
mov dword [ebp - 0x58], eax
xor eax, eax
lea edi, [ebp - 0x36a]
mov word [ebp - 0x36c], bx
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x36c]
push 0x3f
mov dword [ebp - 0x4c], eax
pop ecx
xor eax, eax
lea edi, [ebp - 0x26a]
mov word [ebp - 0x26c], bx
mov word [ebp - 0x297c], bx
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x26c]
mov ecx, 0x3ff
mov dword [ebp - 0x44], eax
xor eax, eax
lea edi, [ebp - 0x297a]
mov dword [ebp - 0x68], 0x3c
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x297c]
mov dword [ebp - 0x54], 0xff
mov dword [ebp - 0x3c], eax
lea eax, [ebp - 0x68]
push eax
push ebx
push ebx
push esi
mov dword [ebp - 0x48], edx
mov dword [ebp - 0x40], edx
mov dword [ebp - 0x38], 0x7ff
call dword [sym.imp.WININET.dll_InternetCrackUrlW]
test eax, eax
je 0x402151
cmp dword [ebp - 0x5c], 3
je 0x401eae
cmp dword [ebp - 0x5c], 4
jne 0x402151
push 0x40
xor eax, eax
pop ecx
lea edi, [ebp - 0x16b]
mov byte [ebp - 0x16c], bl
mov dword [ebp - 0x18], 0x104
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x16c]
push eax
push ebx
call sub.urlmon.dll_ObtainUserAgentString
push 4
lea eax, [ebp - 0x20]
pop esi
mov dword [ebp + 8], ebx
push eax
lea eax, [ebp + 8]
push eax
push 0x49
push ebx
mov dword [ebp - 0x20], esi
call dword [sym.imp.WININET.dll_InternetQueryOptionW]
inc dword [ebp + 8]
lea eax, [ebp + 8]
push esi
mov esi, dword [sym.imp.WININET.dll_InternetSetOptionW]
push eax
push 0x49
push ebx
call esi
cmp byte [ebp - 0x16c], bl
mov dword [ebp - 0x2c], 0x422224
mov dword [ebp - 0x28], ebx
lea eax, [ebp - 0x16c]
jne 0x401f26
mov eax, 0x4221e4
push ebx
push ebx
push ebx
push ebx
push eax
call dword [sym.imp.WININET.dll_InternetOpenA]
cmp dword [ebp + 0xc], ebx
mov edi, eax
mov dword [ebp - 0x24], edi
je 0x401f5c
lea eax, [ebp + 0xc]
push 4
push eax
push 2
push edi
call esi
lea eax, [ebp + 0xc]
push 4
push eax
push 5
push edi
call esi
lea eax, [ebp + 0xc]
push 4
push eax
push 6
push edi
call esi
push ebx
push ebx
push 3
push dword [ebp - 0x44]
push dword [ebp - 0x4c]
push dword [ebp - 0x50]
push dword [ebp - 0x58]
push edi
call dword [sym.imp.WININET.dll_InternetConnectW]
mov dword [ebp - 0xc], eax
xor eax, eax
cmp dword [ebp - 0x5c], 4
jne 0x401f83
mov eax, 0x803000
or eax, 0x84000100
push ebx
push eax
lea eax, [ebp - 0x2c]
push eax
push ebx
push 0x4221d0
push dword [ebp - 0x3c]
push 0x4221c8
push dword [ebp - 0xc]
call dword [sym.imp.WININET.dll_HttpOpenRequestW]
push ebx
mov edi, 0x422174
push ebx
push edi
mov dword [ebp - 8], eax
call dword [sym.imp.MSVCRT.dll_wcslen]
pop ecx
push eax
push edi
push dword [ebp - 8]
call dword [sym.imp.WININET.dll_HttpSendRequestW]
cmp eax, ebx
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x1c], 4
je 0x402129
lea eax, [ebp - 0x1c]
push ebx
push eax
lea eax, [ebp - 0x14]
push eax
push 0x20000013
push dword [ebp - 8]
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
test eax, eax
je 0x402129
cmp dword [ebp - 0x14], 0xc8
jne 0x402129
mov edx, 0x81
xor eax, eax
mov ecx, edx
lea edi, [ebp - 0x572]
mov word [ebp - 0x574], bx
mov word [ebp - 0x77c], bx
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov ecx, edx
xor eax, eax
lea edi, [ebp - 0x77a]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x77c]
push eax
push 0x103
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
test eax, eax
je 0x402065
lea eax, [ebp - 0x574]
push eax
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push eax
lea eax, [ebp - 0x77c]
push 0x42215c
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
lea eax, [ebp - 0x574]
push 0x422134
push eax
call dword [sym.imp.MSVCRT.dll__wfopen]
pop ecx
cmp eax, ebx
pop ecx
mov dword [ebp - 0x10], eax
je 0x402129
mov ecx, 0x3ff
xor eax, eax
lea edi, [ebp - 0x197b]
mov byte [ebp - 0x197c], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov edi, dword [sym.imp.WININET.dll_InternetReadFile]
lea eax, [ebp - 4]
push eax
mov esi, 0x1000
lea eax, [ebp - 0x197c]
push esi
push eax
mov dword [ebp - 4], ebx
push dword [ebp - 8]
call edi
test eax, eax
je 0x4020ed
cmp dword [ebp - 4], ebx
je 0x4020ed
push dword [ebp - 0x10]
lea eax, [ebp - 0x197c]
push 1
push dword [ebp - 4]
push eax
call dword [sym.imp.MSVCRT.dll_fwrite]
add esp, 0x10
lea eax, [ebp - 4]
push eax
lea eax, [ebp - 0x197c]
push esi
push eax
push dword [ebp - 8]
jmp 0x4020b9
push dword [ebp - 0x10]
call dword [sym.imp.MSVCRT.dll_fclose]
cmp dword [ebp + 0x10], ebx
pop ecx
je 0x40211c
cmp dword [ebp + 0x14], ebx
je 0x40211c
lea eax, [ebp - 0x574]
push eax
push 0x4220a0
push dword [ebp + 0x14]
push dword [ebp + 0x10]
call dword [sym.imp.MSVCRT.dll__snwprintf]
add esp, 0x10
mov esi, dword [sym.imp.WININET.dll_InternetSetOptionW]
mov dword [ebp - 4], 1
push dword [ebp - 8]
mov edi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call edi
push dword [ebp - 0xc]
call edi
push dword [ebp - 0x24]
call edi
dec dword [ebp + 8]
lea eax, [ebp + 8]
push 4
push eax
push 0x49
push ebx
call esi
mov eax, dword [ebp - 4]
jmp 0x402153
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret