Function at 0x402780
Capabilities:
Initialize winhttp library
Prepare http request
Receive http response
Reference http user-agent string
Set http header
Write file on windows

Disassembly:
push ebx
mov ebx, esp
sub esp, 8
and esp, 0xfffffff8
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4252b0
mov eax, dword fs:[0]
push eax
push ebx
sub esp, 0xa78
mov eax, dword [0x431040]
xor eax, ebp
mov dword [ebp - 0x14], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0xa20], edx
mov esi, ecx
push 0
push 0
push 0
push 0
push str.Mozilla_5.0__Windows_NT_10.0__Win64__x64__AppleWebKit_537.36__KHTML__like_Gecko__Chrome_70.0.3538.77_Safari_537.36
mov dword [ebp - 0xa1c], 0x80004005
call dword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov dword [ebp - 0xa80], eax
test eax, eax
je 0x402c01
cmp dword [esi + 0x14], 0xf
lea eax, [ebp - 0x218]
mov edi, dword [esi + 0x10]
xorps xmm0, xmm0
mov dword [ebp - 0xa68], eax
lea eax, [ebp - 0xa18]
movlpd qword [ebp - 0xa74], xmm0
mov dword [ebp - 0xa6c], 0
movlpd qword [ebp - 0xa60], xmm0
movlpd qword [ebp - 0xa58], xmm0
mov dword [ebp - 0xa50], 0
movlpd qword [ebp - 0xa44], xmm0
mov dword [ebp - 0xa78], 0x3c
mov dword [ebp - 0xa64], pe_nt_image_headers32
mov dword [ebp - 0xa4c], eax
mov dword [ebp - 0xa48], 0x400
jbe 0x402870
add edi, dword [esi]
mov esi, dword [esi]
jmp 0x402872
add edi, esi
movups xmmword [ebp - 0xa38], xmm0
cmp esi, edi
jne 0x40289e
xor ecx, ecx
mov edx, 7
xor eax, eax
mov dword [ebp - 0xa28], ecx
mov dword [ebp - 0xa24], edx
mov word [ebp - 0xa38], ax
jmp 0x4029d1
sub edi, esi
mov dword [ebp - 0xa28], 0
mov eax, 7
mov dword [ebp - 0xa24], eax
cmp edi, 0x7ffffffe
ja 0x402c25
cmp edi, eax
jbe 0x402977
mov eax, edi
or eax, 7
cmp eax, 0x7ffffffe
jbe 0x402927
mov ecx, SysReAllocString
mov dword [ebp - 0xa3c], SysReAllocString
add ecx, ecx
cmp ecx, 0x1000
jb 0x402958
lea eax, [ecx + 0x23]
cmp eax, ecx
jbe 0x402c2a
push eax
call fcn.00409e38
add esp, 4
test eax, eax
je 0x402c2f
lea ecx, [eax + 0x23]
and ecx, 0xffffffe0
mov dword [ecx - 4], eax
mov eax, dword [ebp - 0xa3c]
mov dword [ebp - 0xa38], ecx
mov dword [ebp - 0xa24], eax
jmp 0x40297d
mov ecx, 0xa
cmp eax, ecx
cmovb eax, ecx
mov dword [ebp - 0xa3c], eax
lea ecx, [eax + 1]
cmp ecx, 0x7fffffff
ja 0x402c2a
add ecx, ecx
jne 0x4028e6
mov dword [ebp - 0xa38], ecx
mov dword [ebp - 0xa24], eax
jmp 0x40297d
push ecx
call fcn.00409e38
mov ecx, eax
add esp, 4
mov eax, dword [ebp - 0xa3c]
mov dword [ebp - 0xa38], ecx
mov dword [ebp - 0xa24], eax
jmp 0x40297d
mov ecx, dword [ebp - 0xa38]
cmp eax, 7
lea edx, [ebp - 0xa38]
cmova edx, ecx
mov dword [ebp - 0xa7c], edx
mov ecx, edx
mov edx, edi
test edi, edi
je 0x4029b3
nop word [eax + eax]
movsx ax, byte [esi]
lea ecx, [ecx + 2]
lea esi, [esi + 1]
mov word [ecx - 2], ax
sub edx, 1
jne 0x4029a0
mov eax, dword [ebp - 0xa7c]
xor ecx, ecx
mov dword [ebp - 0xa28], edi
mov word [eax + edi*2], cx
mov edx, dword [ebp - 0xa24]
mov ecx, dword [ebp - 0xa28]
cmp edx, 7
mov dword [ebp - 4], 0
lea edx, [ebp - 0xa78]
push edx
push 0
lea eax, [ebp - 0xa38]
cmova eax, dword [ebp - 0xa38]
push ecx
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpCrackUrl]
mov esi, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
test eax, eax
je 0x402bbd
push 0
push dword [ebp - 0xa60]
push dword [ebp - 0xa68]
push dword [ebp - 0xa80]
call dword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov ecx, eax
mov dword [ebp - 0xa84], ecx
test ecx, ecx
je 0x402bbd
xor eax, eax
mov edi, 0x1bb
cmp word [ebp - 0xa60], di
mov edx, 0x800000
cmove eax, edx
push eax
push 0
push 0
push 0
push dword [ebp - 0xa4c]
push 0x42dd54
push ecx
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov edi, eax
test edi, edi
je 0x402bb5
push 0x20000000
push 0xffffffffffffffff
push str.Mozilla_5.0__Windows_NT_10.0__Win64__x64__AppleWebKit_537.36__KHTML__like_Gecko__Chrome_70.0.3538.77_Safari_537.36
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpAddRequestHeaders]
push 0
push 0
push 0
push 0
push 0
push 0
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
test eax, eax
je 0x402bb2
push 0
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
test eax, eax
je 0x402bb2
mov eax, dword [ebp - 0xa20]
cmp dword [eax + 0x14], 0xf
jbe 0x402ab7
mov eax, dword [eax]
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0xa7c], eax
cmp eax, 0xffffffff
je 0x402bb2
mov dword [ebp - 0xa1c], 0
nop dword [eax]
lea eax, [ebp - 0xa3c]
mov dword [ebp - 0xa3c], 0
push eax
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpQueryDataAvailable]
test eax, eax
je 0x402b96
mov eax, dword [ebp - 0xa3c]
test eax, eax
je 0x402b96
inc eax
push eax
call fcn.0040a0c7
mov esi, eax
mov eax, dword [ebp - 0xa3c]
inc eax
push eax
push 0
push esi
call fcn.0040b890
add esp, 0x10
lea eax, [ebp - 0xa1c]
push eax
push dword [ebp - 0xa3c]
push esi
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpReadData]
test eax, eax
je 0x402b8d
push 0
lea eax, [ebp - 0xa20]
mov dword [ebp - 0xa20], 0
push eax
push dword [ebp - 0xa1c]
push esi
push dword [ebp - 0xa7c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call fcn.00409c33
add esp, 4
cmp dword [ebp - 0xa3c], 0
ja 0x402af0
jmp 0x402b96
push esi
call fcn.00409c33
add esp, 4
push dword [ebp - 0xa7c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov dword [ebp - 0xa1c], 0
push edi
call esi
push dword [ebp - 0xa84]
call esi
push dword [ebp - 0xa80]
call esi
mov ecx, dword [ebp - 0xa24]
cmp ecx, 7
jbe 0x402c01
mov edx, dword [ebp - 0xa38]
lea ecx, [ecx*2 + 2]
mov eax, edx
cmp ecx, 0x1000
jb 0x402bf7
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x402c2f
push ecx
push edx
call fcn.0040a0b9
add esp, 8
mov eax, dword [ebp - 0xa1c]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.00409c25
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret
call fcn.00401520
call fcn.00401480
call fcn.00410aa9
int3