Function at 0x4064a0
Capabilities:
Check if file exists
Create directory
Delete file
Initialize winhttp library
Prepare http request
Receive http response
Write file on windows

Disassembly:
push 0x234
mov eax, 0x437a6e
call fcn.0041f563
mov dword [ebp - 4], 2
xor ebx, ebx
xor eax, eax
mov dword [ebp - 0x220], ebx
push 0x206
mov word [ebp - 0x218], ax
mov edi, ebx
lea eax, [ebp - 0x216]
mov dword [ebp - 0x240], ebx
push ebx
push eax
call fcn.0041ed30
mov eax, dword [ebp + 0x10]
xor ecx, ecx
inc ecx
add esp, 0xc
mov dword [ebp - 0x21c], ecx
cmp dword [eax - 4], ecx
jle 0x406503
push dword [eax - 0xc]
lea ecx, [ebp + 0x10]
call fcn.0040299d
mov eax, dword [ebp + 0x10]
push eax
lea eax, [ebp - 0x218]
push 0x104
push eax
call fcn.0041d874
add esp, 0xc
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x40654c
push ebx
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
je 0x40676a
push ebx
push ebx
push ebx
push ebx
push str.CallHandler
call dword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov esi, eax
mov dword [ebp - 0x238], esi
test esi, esi
jne 0x406574
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
jmp 0x406768
push ebx
push 0x50
push dword [ebp + 8]
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov dword [ebp - 0x23c], eax
test eax, eax
jne 0x40659e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
mov byte [ebp - 0x21c], bl
jmp 0x406759
push ebx
push ebx
push ebx
push ebx
push dword [ebp + 0xc]
push 0x442b04
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov dword [ebp - 0x228], eax
test eax, eax
jne 0x4065ce
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
mov byte [ebp - 0x21c], bl
jmp 0x40674d
push ebx
push ebx
push ebx
push ebx
push ebx
push ebx
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
xor esi, esi
inc esi
cmp eax, esi
jne 0x40672d
push ebx
push dword [ebp - 0x228]
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
test eax, eax
je 0x40672d
push ebx
push 0x80
push 4
push ebx
push esi
push 0xc0000000
push dword [ebp + 0x10]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x234], eax
cmp eax, 0xffffffff
je 0x40672d
mov esi, dword [ebp - 0x228]
mov dword [ebp - 0x22c], ebx
lea eax, [ebp - 0x220]
mov dword [ebp - 0x220], ebx
push eax
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpQueryDataAvailable]
test eax, eax
je 0x4066fc
mov eax, dword [ebp - 0x220]
inc eax
push eax
call fcn.0041b520
mov dword [ebp - 0x224], eax
pop ecx
test eax, eax
je 0x4066f4
mov ecx, dword [ebp - 0x220]
inc ecx
push ecx
push ebx
push eax
call fcn.0041ed30
add esp, 0xc
lea eax, [ebp - 0x240]
push eax
push dword [ebp - 0x220]
push dword [ebp - 0x224]
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpReadData]
test eax, eax
je 0x4066ec
push ebx
lea eax, [ebp - 0x230]
mov dword [ebp - 0x230], ebx
push eax
push dword [ebp - 0x220]
push dword [ebp - 0x224]
push dword [ebp - 0x234]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40670a
mov eax, dword [ebp - 0x22c]
add eax, dword [ebp - 0x230]
push dword [ebp - 0x224]
mov dword [ebp - 0x22c], eax
call fcn.0041c95f
pop ecx
cmp dword [ebp - 0x220], ebx
ja 0x40662e
jmp 0x40670a
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x406708
mov dword [ebp - 0x220], ebx
jmp 0x40670a
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov byte [ebp - 0x21c], bl
mov edi, eax
push dword [ebp - 0x234]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x22c], 0x10000
jae 0x40673b
push dword [ebp + 0x10]
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
jmp 0x406735
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
mov byte [ebp - 0x21c], bl
push dword [ebp - 0x228]
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov esi, dword [ebp - 0x238]
push dword [ebp - 0x23c]
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
cmp byte [ebp - 0x21c], bl
jne 0x40676a
mov ebx, edi
mov ecx, dword [ebp + 8]
lea ecx, [ecx - 0x10]
call fcn.00404b8d
mov ecx, dword [ebp + 0xc]
add ecx, 0xfffffff0
call fcn.00404b8d
mov ecx, dword [ebp + 0x10]
add ecx, 0xfffffff0
call fcn.00404b8d
mov eax, ebx
call fcn.0041f512
ret 0xc