Function at 0x40a270
Capabilities:
Delete file
Initialize winhttp library
Receive http response
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xffffffc0
sub esp, 0x34
push ebx
push esi
mov esi, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
push edi
mov edi, ecx
mov eax, dword [edi + 0x14]
test eax, eax
je 0x40a295
push eax
call esi
mov dword [edi + 0x14], 0
mov eax, dword [edi + 0x10]
test eax, eax
je 0x40a2a6
push eax
call esi
mov dword [edi + 0x10], 0
mov eax, dword [edi + 0xc]
test eax, eax
je 0x40a2b7
push eax
call esi
mov dword [edi + 0xc], 0
push 0
push 0
push 0
push 0
push 0x4d3798
call dword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov dword [edi + 0xc], eax
test eax, eax
jne 0x40a2e6
mov dword [edi + 0x84], 1
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
push dword [edi + 0x20]
push dword [edi + 0x1c]
push dword [edi + 0x18]
push 0
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpSetTimeouts]
push 0
push 0
push 0
push dword [ebp + 8]
mov ecx, edi
mov byte [esp + 0x37], 0
mov dword [esp + 0x38], 0
mov dword [esp + 0x40], 0
mov dword [esp + 0x3c], 0
mov dword [esp + 0x44], 0
call fcn.0040ae90
test al, al
je 0x40a2db
lea eax, [esp + 0x30]
mov ecx, edi
push eax
call fcn.0040ad50
test al, al
jne 0x40a354
mov dword [edi + 0x84], 4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov ecx, edi
call fcn.0040adf0
mov dword [edi + 4], eax
cmp eax, 0x194
jne 0x40a37a
mov dword [edi + 0x84], 5
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
push 0
push 0x80
push 2
push 0
push 2
push 0x40000000
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
mov dword [esp + 0x38], ebx
cmp ebx, 0xffffffff
jne 0x40a3b5
mov dword [edi + 0x84], 7
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov esi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
push 0
push dword [esp + 0x38]
push ebx
call esi
push ebx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push 0
push 0
push 0
push ebx
call esi
lea eax, [esp + 0x28]
push eax
push dword [edi + 0x14]
call dword [sym.imp.WINHTTP.dll_WinHttpQueryDataAvailable]
test eax, eax
jne 0x40a404
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
push 0x1000
call fcn.0047e8e8
mov esi, dword [esp + 0x2c]
add esp, 4
mov ebx, eax
cmp esi, 0x1000
jbe 0x40a434
push ebx
call fcn.0047e8b0
mov esi, dword [esp + 0x2c]
push esi
call fcn.0047e8e8
add esp, 8
mov ebx, eax
lea eax, [esp + 0x2c]
push eax
push esi
push ebx
push dword [edi + 0x14]
call dword [sym.imp.WINHTTP.dll_WinHttpReadData]
test eax, eax
je 0x40a4f0
push 0
lea eax, [esp + 0x40]
push eax
push dword [esp + 0x34]
push ebx
push dword [esp + 0x48]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40a4f0
mov eax, dword [esp + 0x2c]
cmp eax, dword [esp + 0x3c]
jne 0x40a4f0
mov esi, dword [esp + 0x34]
mov ecx, dword [edi + 0x80]
add esi, eax
mov dword [esp + 0x34], esi
test ecx, ecx
je 0x40a4cd
movd xmm0, esi
mov eax, esi
cvtdq2pd xmm0, xmm0
mov edx, dword [ecx]
sub esp, 0x10
shr eax, 0x1f
addsd xmm0, qword [eax*8 + 0x4d3870]
mov eax, dword [esp + 0x40]
movsd qword [esp + 8], xmm0
movd xmm0, eax
cvtdq2pd xmm0, xmm0
shr eax, 0x1f
addsd xmm0, qword [eax*8 + 0x4d3870]
movsd qword [esp], xmm0
push 0
push dword [edi + 0x7c]
call dword [edx]
lea eax, [esp + 0x28]
push eax
push dword [edi + 0x14]
call dword [sym.imp.WINHTTP.dll_WinHttpQueryDataAvailable]
test eax, eax
je 0x40a4f0
mov esi, dword [esp + 0x28]
test esi, esi
jne 0x40a417
mov byte [esp + 0x27], 1
push ebx
call fcn.0047e8b0
add esp, 4
push dword [esp + 0x38]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov bl, byte [esp + 0x27]
test bl, bl
jne 0x40a515
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
pop edi
pop esi
mov al, bl
pop ebx
mov esp, ebp
pop ebp
ret 8