Function at 0x416094
Capabilities:
Check http status code
Link many functions at runtime
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x29f8
call fcn.00476660
mov eax, dword [0x4d8300]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [ebp + 0xc]
xorps xmm0, xmm0
or dword [ebp - 0x2994], 0xffffffff
push ebx
mov ebx, dword [ebp + 8]
mov dword [ebp - 0x298c], eax
lea eax, [ebp - 0x6c]
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x29e8], eax
xor eax, eax
mov dword [ebp - 0x2970], edx
xor edx, edx
push edi
inc edx
mov word [ebp - 0x29e0], ax
mov edi, ecx
mov dword [ebp - 0x2978], ebx
xor ecx, ecx
mov dword [ebp - 0x29bc], 0x4bd4c4
lea eax, [ebp - 0x16c]
mov dword [ebp - 0x29b8], ecx
mov dword [ebp - 0x299c], ecx
mov dword [ebp - 0x29b0], ecx
mov dword [ebp - 0x29ac], ecx
mov dword [ebp - 0x2974], ecx
mov dword [ebp - 0x29f8], 0x3c
mov dword [ebp - 0x29f4], ecx
mov dword [ebp - 0x29f0], edx
mov dword [ebp - 0x29ec], ecx
mov dword [ebp - 0x29e4], 0x40
mov dword [ebp - 0x29dc], ecx
mov dword [ebp - 0x29d8], edx
mov dword [ebp - 0x29d4], eax
mov dword [ebp - 0x29d0], 0x80
mov dword [ebp - 0x29cc], ecx
mov dword [ebp - 0x29c8], edx
mov dword [ebp - 0x29c4], ecx
mov dword [ebp - 0x29c0], ecx
movlpd qword [ebp - 0x2984], xmm0
cmp dword [0x51d3a8], ecx
jne 0x4161bf
push str.InternetCrackUrlA
call fcn.00415126
push eax
call esi
mov dword [0x51d3a8], eax
test eax, eax
jne 0x4161bf
call fcn.0042fc51
push eax
push str.WinInet
push str.InternetCrackUrlA
push str.Unable_to_locate__s___in__s.dll:__s_n
call fcn.0042ed57
add esp, 0x10
jmp 0x416768
cmp dword [0x51d388], 0
jne 0x4161f0
push str.InternetConnectA
call fcn.00415126
push eax
call esi
mov dword [0x51d388], eax
test eax, eax
jne 0x4161f0
call fcn.0042fc51
push eax
push str.WinInet
push str.InternetConnectA
jmp 0x4161ad
cmp dword [0x51d378], 0
jne 0x416221
push str.InternetReadFile
call fcn.00415126
push eax
call esi
mov dword [0x51d378], eax
test eax, eax
jne 0x416221
call fcn.0042fc51
push eax
push str.WinInet
push str.InternetReadFile
jmp 0x4161ad
cmp dword [0x51d37c], 0
jne 0x416255
push str.InternetCloseHandle
call fcn.00415126
push eax
call esi
mov dword [0x51d37c], eax
test eax, eax
jne 0x416255
call fcn.0042fc51
push eax
push str.WinInet
push str.InternetCloseHandle
jmp 0x4161ad
cmp dword [0x51d35c], 0
jne 0x416289
push str.HttpOpenRequestA
call fcn.00415126
push eax
call esi
mov dword [0x51d35c], eax
test eax, eax
jne 0x416289
call fcn.0042fc51
push eax
push str.WinInet
push str.HttpOpenRequestA
jmp 0x4161ad
cmp dword [0x51d368], 0
jne 0x4162bd
push str.HttpSendRequestA
call fcn.00415126
push eax
call esi
mov dword [0x51d368], eax
test eax, eax
jne 0x4162bd
call fcn.0042fc51
push eax
push str.WinInet
push str.HttpSendRequestA
jmp 0x4161ad
cmp dword [0x51d2bc], 0
jne 0x4162f1
push str.HttpQueryInfoA
call fcn.00415126
push eax
call esi
mov dword [0x51d2bc], eax
test eax, eax
jne 0x4162f1
call fcn.0042fc51
push eax
push str.WinInet
push str.HttpQueryInfoA
jmp 0x4161ad
mov esi, dword [ebp - 0x298c]
xor eax, eax
mov dword [0x4dc5d0], eax
mov dword [0x52246c], 0x194
test esi, esi
je 0x41631d
push eax
push eax
push eax
push esi
xor edx, edx
or ecx, 0xffffffff
call fcn.0043c21c
add esp, 0x10
test edi, edi
jne 0x416338
push 0x167
push str.C:UsersGauravDownloads_formatusb_master_1__formatusb_master_src_net.c
push str.url___NULL
call fcn.00486ba7
add esp, 0xc
test ebx, ebx
je 0x41633f
and dword [ebx], 0
mov eax, dword [ebp - 0x2970]
test eax, eax
mov ecx, eax
cmove ecx, edi
call fcn.004151c9
mov dword [ebp - 0x2990], eax
test esi, esi
je 0x41637c
push eax
push 0xc0d
push 0
push 0
push 1
call fcn.00414c2d
add esp, 0x14
push edi
push str.Downloading__s
call fcn.0042ed57
pop ecx
pop ecx
test edi, edi
jne 0x416384
xor eax, eax
jmp 0x41638b
push edi
call fcn.004816f0
pop ecx
lea ecx, [ebp - 0x29f8]
push ecx
push 0
push eax
push edi
call dword [0x51d3a8]
test eax, eax
je 0x4168fa
cmp dword [ebp - 0x29e8], 0
je 0x4168fa
cmp dword [ebp - 0x29cc], 0
je 0x4168fa
xor ecx, ecx
mov byte [ebp - 0x2d], 0
inc ecx
call fcn.00415ecc
mov dword [ebp - 0x29b0], eax
test eax, eax
jne 0x4163eb
call fcn.004158ba
push eax
push str.Could_not_open_Internet_session:__s
call fcn.0042ed57
pop ecx
pop ecx
jmp 0x416768
xor ecx, ecx
push ecx
push ecx
push 3
push ecx
push ecx
push dword [ebp - 0x29e0]
push dword [ebp - 0x29e8]
push eax
call dword [0x51d388]
mov ecx, eax
mov dword [ebp - 0x29ac], ecx
test ecx, ecx
jne 0x416430
call fcn.004158ba
push eax
movzx eax, word [ebp - 0x29e0]
push eax
push dword [ebp - 0x29e8]
push str.Could_not_connect_to_server__s:_d:__s
jmp 0x4161b2
cmp dword [ebp - 0x29ec], 4
mov edx, 0x488c600
push 0
mov eax, 0x408c600
cmove eax, edx
push eax
lea eax, [ebp - 0x29bc]
push eax
push 0
push 0
push dword [ebp - 0x29cc]
push 0x4bd67c
push ecx
call dword [0x51d35c]
mov esi, eax
mov dword [ebp - 0x2974], esi
test esi, esi
jne 0x416489
call fcn.004158ba
push eax
push edi
push str.Could_not_open_URL__s:__s
call fcn.0042ed57
add esp, 0xc
jmp 0x41676e
push 0
push 0
push 0xffffffffffffffff
push str.Accept_Encoding:_gzip__deflate
push esi
call dword [0x51d368]
test eax, eax
jne 0x4164b6
call fcn.004158ba
push eax
push str.Unable_to_send_request:__s
call fcn.0042ed57
pop ecx
pop ecx
jmp 0x41676e
push 0
lea eax, [ebp - 0x2998]
mov dword [ebp - 0x2998], 4
push eax
push 0x52246c
push 0x20000013
push esi
call dword [0x51d2bc]
cmp dword [0x52246c], 0xc8
je 0x416508
push 0xc0192efc
mov dword [0x51d360], 0x2efc
call dword [sym.imp.KERNEL32.dll_SetLastError]
push dword [0x52246c]
push str.Unable_to_access_file:__d
jmp 0x4164aa
push 0
lea eax, [ebp - 0x2998]
mov dword [ebp - 0x2998], 0x20
push eax
lea eax, [ebp - 0x28]
push eax
push 5
push esi
call dword [0x51d2bc]
test eax, eax
jne 0x41653c
call fcn.004158ba
push eax
push str.Unable_to_retrieve_file_length:__s
jmp 0x4164aa
lea eax, [ebp - 0x28]
push eax
call fcn.00489060
cmp dword [ebp - 0x298c], 0
mov esi, eax
pop ecx
mov ebx, edx
je 0x416606
push ebx
push esi
xor edx, edx
xor ecx, ecx
call fcn.0042fdeb
push eax
push str.File_length:__s
call fcn.0042ed57
add esp, 0x10
cmp dword [0x4dca1c], 0
je 0x4165a5
mov ecx, edi
call fcn.00415db8
push ebx
push esi
xor edx, edx
mov dword [ebp - 0x29a0], eax
xor ecx, ecx
mov dword [ebp - 0x29a4], str.__s___s
lea edi, [ebp - 0xec]
call fcn.0042fdeb
pop ecx
pop ecx
jmp 0x4165cf
push ebx
push esi
xor edx, edx
xor ecx, ecx
call fcn.0042fdeb
pop ecx
pop ecx
mov ecx, edi
mov dword [ebp - 0x29a0], eax
mov dword [ebp - 0x29a4], 0x4bd710
call fcn.00415db8
lea edi, [ebp - 0xec]
push dword [ebp - 0x29a0]
push eax
push dword [ebp - 0x29a4]
push 0x80
push edi
call fcn.00403163
add esp, 0x14
lea eax, [ebp - 0xec]
xor ecx, ecx
mov byte [ebp - 0x6d], cl
push eax
push 0xc0d
push ecx
push ecx
push ecx
call fcn.00414c2d
add esp, 0x14
mov edi, dword [ebp - 0x2970]
test edi, edi
je 0x41665d
push ecx
push 0x80
sub esp, 0xc
mov edx, 0xc0000000
mov ecx, edi
call fcn.00415184
add esp, 0x14
mov dword [ebp - 0x2994], eax
cmp eax, 0xffffffff
jne 0x416697
call fcn.004158ba
push eax
push dword [ebp - 0x2990]
push str.Unable_to_create_file__s:__s
call fcn.0042ed57
mov ebx, dword [ebp - 0x2978]
add esp, 0xc
mov esi, dword [ebp - 0x2974]
jmp 0x416774
mov edi, dword [ebp - 0x2978]
test edi, edi
jne 0x416679
push str.No_buffer_pointer_provided_for_download
call fcn.0042ed57
pop ecx
mov ebx, edi
jmp 0x416768
lea eax, [esi + 1]
push 1
push eax
call fcn.0047b53f
mov dword [edi], eax
pop ecx
pop ecx
test eax, eax
jne 0x416843
push str.Could_not_allocate_buffer_for_download
jmp 0x41666c
mov edi, dword [ebp - 0x2978]
jmp 0x416843
lea eax, [ebp - 0x2988]
push eax
push 0x2800
lea eax, [ebp - 0x296c]
push eax
push dword [ebp - 0x2974]
call dword [0x51d378]
test eax, eax
je 0x416876
mov eax, dword [ebp - 0x2988]
test eax, eax
je 0x416876
cmp dword [ebp - 0x298c], 0
je 0x416704
push ebx
push esi
push dword [ebp - 0x2980]
mov edx, 0xca9
push dword [ebp - 0x2984]
push 0xfffffffffffffffe
pop ecx
call fcn.0043c21c
mov eax, dword [ebp - 0x2988]
add esp, 0x10
cmp dword [ebp - 0x2970], 0
je 0x416817
push 0
lea ecx, [ebp - 0x29a8]
push ecx
push eax
lea eax, [ebp - 0x296c]
push eax
push dword [ebp - 0x2994]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x416858
mov eax, dword [ebp - 0x2988]
cmp eax, dword [ebp - 0x29a8]
je 0x416836
push eax
push dword [ebp - 0x29a8]
push dword [ebp - 0x2990]
push str.Error_writing_file__s:_Only__d__d_bytes_written
call fcn.0042ed57
add esp, 0x10
mov ebx, dword [ebp - 0x2978]
mov esi, dword [ebp - 0x2974]
mov edi, dword [ebp - 0x2970]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [0x51d360], eax
mov eax, dword [ebp - 0x2994]
cmp eax, 0xffffffff
je 0x41679d
push eax
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
push dword [ebp - 0x2994]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x299c], 0
jne 0x4167c0
test edi, edi
je 0x4167b1
mov ecx, edi
call fcn.00407d9b
test ebx, ebx
je 0x4167c0
push dword [ebx]
call fcn.004812c6
and dword [ebx], 0
pop ecx
test esi, esi
je 0x4167cb
push esi
call dword [0x51d37c]
mov eax, dword [ebp - 0x29ac]
test eax, eax
je 0x4167dc
push eax
call dword [0x51d37c]
mov eax, dword [ebp - 0x29b0]
test eax, eax
je 0x4167ed
push eax
call dword [0x51d37c]
push dword [0x51d360]
call dword [sym.imp.KERNEL32.dll_SetLastError]
cmp dword [ebp - 0x299c], 0
je 0x41690a
mov eax, dword [ebp - 0x2984]
mov edx, dword [ebp - 0x2980]
jmp 0x416921
push eax
lea eax, [ebp - 0x296c]
push eax
mov eax, dword [edi]
add eax, dword [ebp - 0x2984]
push eax
call fcn.00476fc0
mov eax, dword [ebp - 0x2988]
add esp, 0xc
add dword [ebp - 0x2984], eax
adc dword [ebp - 0x2980], 0
test dword [0x4dc5d0], 0x80000000
je 0x4166a2
jmp 0x416762
call fcn.004158ba
push eax
push dword [ebp - 0x2990]
push str.Error_writing_file__s:__s
call fcn.0042ed57
add esp, 0xc
jmp 0x416762
cmp dword [ebp - 0x2984], esi
jne 0x4168d0
cmp dword [ebp - 0x2980], ebx
jne 0x4168d0
cmp dword [ebp - 0x298c], 0
mov dword [0x52246c], 0xc8
mov dword [ebp - 0x299c], 1
je 0x416762
push ebx
push esi
push ebx
push esi
push 0xfffffffffffffffe
mov edx, 0xca9
pop ecx
call fcn.0043c21c
push dword [ebp - 0x2990]
push str.Successfully_downloaded__s
call fcn.0042ed57
add esp, 0x18
jmp 0x416762
push ebx
push esi
push dword [ebp - 0x2980]
push dword [ebp - 0x2984]
push str.Could_not_download_complete_file___read:__lld_bytes__expected:__lld_bytes
call fcn.0042ed57
add esp, 0x14
mov dword [0x4dc5d0], 0xc003001d
jmp 0x416762
call fcn.004158ba
push eax
push str.Unable_to_decode_URL:__s
jmp 0x4163df
xorps xmm0, xmm0
movlpd qword [ebp - 0x29bc], xmm0
mov edx, dword [ebp - 0x29b8]
mov eax, dword [ebp - 0x29bc]
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00475c80
leave
ret