Function at 0x407960
Capabilities:
Create directory
Initialize winhttp library
Prepare http request
Receive http response

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x43163b
mov eax, dword fs:[0]
push eax
mov eax, 0x14f8
call fcn.0040d2b0
mov eax, dword [0x43e080]
xor eax, ebp
mov dword [ebp - 0x10], eax
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x1500], 0
mov dword [ebp - 0x14fc], 0
mov dword [ebp - 0x14f8], 0
mov dword [ebp - 0x14f0], 0
lea eax, [ebp - 0x420]
push eax
lea ecx, [ebp - 0x14f0]
push ecx
lea edx, [ebp - 0x218]
push edx
push str.__:_:_d_s
push 0x43a448
mov eax, dword [ebp + 8]
push eax
call fcn.00407290
add esp, 8
add eax, 4
push eax
call fcn.00407250
add esp, 0x14
cmp eax, 3
jne 0x4079f8
jmp 0x407a7a
lea ecx, [ebp - 0x420]
push ecx
lea edx, [ebp - 0x218]
push edx
push str._____s
push 0x43a460
mov eax, dword [ebp + 8]
push eax
call fcn.00407290
add esp, 8
add eax, 4
push eax
call fcn.00407250
add esp, 0x10
cmp eax, 2
jne 0x407a66
push str.https
mov ecx, dword [ebp + 8]
push ecx
call fcn.00407290
add esp, 8
test eax, eax
je 0x407a4e
mov dword [ebp - 0x1504], 0x1bb
jmp 0x407a58
mov dword [ebp - 0x1504], 0x50
mov edx, dword [ebp - 0x1504]
mov dword [ebp - 0x14f0], edx
jmp 0x407a7a
push str.Invalid_URL._n
call fcn.004071e0
add esp, 4
xor al, al
jmp 0x407d76
push 0
push 0
push 0
push 0
push str.WinHTTP_Example_1.0
call dword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov dword [ebp - 0x1500], eax
push 0
movzx eax, word [ebp - 0x14f0]
push eax
lea ecx, [ebp - 0x218]
push ecx
mov edx, dword [ebp - 0x1500]
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov dword [ebp - 0x14fc], eax
push 0
push 0
push 0
push 0
lea eax, [ebp - 0x420]
push eax
push 0x43a4b8
mov ecx, dword [ebp - 0x14fc]
push ecx
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov dword [ebp - 0x14f8], eax
cmp dword [ebp - 0x14f8], 0
jne 0x407afb
push str.Failed_to_open_request._n
call fcn.004071e0
add esp, 4
xor al, al
jmp 0x407d76
push 0
push 0
push 0
push 0
push 0
push 0
mov edx, dword [ebp - 0x14f8]
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
test eax, eax
je 0x407b2b
push 0
mov eax, dword [ebp - 0x14f8]
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
test eax, eax
jne 0x407b3f
push str.Failed_to_send_request_or_receive_response._n
call fcn.004071e0
add esp, 4
xor al, al
jmp 0x407d76
push 0xffffffffffffffff
push 0x43a554
mov ecx, dword [ebp + 0xc]
call fcn.00409170
push eax
push 0
lea ecx, [ebp - 0x143c]
push ecx
mov ecx, dword [ebp + 0xc]
call fcn.00409130
mov dword [ebp - 4], 0
push 0
lea ecx, [ebp - 0x143c]
call fcn.00406580
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x407bc4
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
je 0x407bc4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Failed_to_create_directory._Error_code:__d_n
call fcn.004071e0
add esp, 8
mov byte [ebp - 0x14f1], 0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x143c]
call fcn.004065a0
mov al, byte [ebp - 0x14f1]
jmp 0x407d76
push 0xb0
lea ecx, [ebp - 0x14ec]
call fcn.00403e50
push 1
push 0x40
push 0x20
mov edx, dword [ebp + 0xc]
push edx
lea ecx, [ebp - 0x14ec]
call fcn.00408f00
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x14ec]
call fcn.00408e80
movzx eax, al
test eax, eax
jne 0x407c48
mov ecx, dword [ebp + 0xc]
call fcn.00406580
push eax
push str.Failed_to_open_local_file_for_writing._Local_file_path:__s_n
call fcn.004071e0
add esp, 8
mov byte [ebp - 0x14f2], 0
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x14ec]
call fcn.00407d90
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x143c]
call fcn.004065a0
mov al, byte [ebp - 0x14f2]
jmp 0x407d76
push 0x1000
push 0
lea ecx, [ebp - 0x1420]
push ecx
call fcn.0040e340
add esp, 0xc
mov dword [ebp - 0x1424], 0
lea edx, [ebp - 0x1424]
push edx
push 0x1000
lea eax, [ebp - 0x1420]
push eax
mov ecx, dword [ebp - 0x14f8]
push ecx
call dword [sym.imp.WINHTTP.dll_WinHttpReadData]
test eax, eax
jne 0x407cd7
push str.Failed_to_read_data._n
call fcn.004071e0
add esp, 4
lea ecx, [ebp - 0x14ec]
call fcn.00408e50
mov byte [ebp - 0x14f3], 0
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x14ec]
call fcn.00407d90
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x143c]
call fcn.004065a0
mov al, byte [ebp - 0x14f3]
jmp 0x407d76
cmp dword [ebp - 0x1424], 0
jbe 0x407cfc
mov edx, dword [ebp - 0x1424]
xor eax, eax
push eax
push edx
lea ecx, [ebp - 0x1420]
push ecx
lea ecx, [ebp - 0x14ec]
call fcn.00408f60
cmp dword [ebp - 0x1424], 0
ja 0x407c68
lea ecx, [ebp - 0x14ec]
call fcn.00408e50
mov edx, dword [ebp - 0x14f8]
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov eax, dword [ebp - 0x14fc]
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov ecx, dword [ebp - 0x1500]
push ecx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
push str.Download_and_save_complete._n
call fcn.004071e0
add esp, 4
mov byte [ebp - 0x14f4], 1
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x14ec]
call fcn.00407d90
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x143c]
call fcn.004065a0
mov al, byte [ebp - 0x14f4]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0040c56e
mov esp, ebp
pop ebp
ret