Function at 0x405ba8
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, 0x4348eb
call fcn.0041c5c3
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.0041bd90
mov eax, dword [ebp + 0x10]
xor ecx, ecx
inc ecx
add esp, 0xc
mov dword [ebp - 0x21c], ecx
cmp dword [eax - 4], ecx
jle 0x405c0b
push dword [eax - 0xc]
lea ecx, [ebp + 0x10]
call fcn.004024d2
mov eax, dword [ebp + 0x10]
push eax
lea eax, [ebp - 0x218]
push 0x104
push eax
call fcn.0041a94f
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 0x405c54
push ebx
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
je 0x405e72
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 0x405c7c
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
jmp 0x405e70
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 0x405ca6
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
mov byte [ebp - 0x21c], bl
jmp 0x405e61
push ebx
push ebx
push ebx
push ebx
push dword [ebp + 0xc]
push 0x43f994
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov dword [ebp - 0x228], eax
test eax, eax
jne 0x405cd6
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
mov byte [ebp - 0x21c], bl
jmp 0x405e55
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 0x405e35
push ebx
push dword [ebp - 0x228]
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
test eax, eax
je 0x405e35
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 0x405e35
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 0x405e04
mov eax, dword [ebp - 0x220]
inc eax
push eax
call fcn.004185ed
mov dword [ebp - 0x224], eax
pop ecx
test eax, eax
je 0x405dfc
mov ecx, dword [ebp - 0x220]
inc ecx
push ecx
push ebx
push eax
call fcn.0041bd90
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 0x405df4
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 0x405e12
mov eax, dword [ebp - 0x22c]
add eax, dword [ebp - 0x230]
push dword [ebp - 0x224]
mov dword [ebp - 0x22c], eax
call fcn.00419a2f
pop ecx
cmp dword [ebp - 0x220], ebx
ja 0x405d36
jmp 0x405e12
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x405e10
mov dword [ebp - 0x220], ebx
jmp 0x405e12
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 0x405e43
push dword [ebp + 0x10]
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
jmp 0x405e3d
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 0x405e72
mov ebx, edi
mov ecx, dword [ebp + 8]
lea ecx, [ecx - 0x10]
call fcn.004045c1
mov ecx, dword [ebp + 0xc]
add ecx, 0xfffffff0
call fcn.004045c1
mov ecx, dword [ebp + 0x10]
add ecx, 0xfffffff0
call fcn.004045c1
mov eax, ebx
call fcn.0041c572
ret 0xc