Function at 0x408650
Capabilities:
Initialize winhttp library
Prepare http request
Read http header
Receive http response
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x49ed65
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
mov eax, 0x109c
call fcn.0047be20
push esi
mov ecx, 0x4d5279
call fcn.0047b83a
push 0
push 0
push 0
push 0
push str.WinHTTP_Example_1.0
call dword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
jne 0x4086a0
xor al, al
jmp 0x408aee
push 0x3c
push 0
lea eax, [ebp - 0xa8]
push eax
call fcn.0047e8a0
add esp, 0xc
push 0x3c
push 0
lea ecx, [ebp - 0xa8]
push ecx
call fcn.0047e8a0
add esp, 0xc
mov dword [ebp - 0xa8], 0x3c
mov dword [ebp - 0xa0], 0xffffffff
mov dword [ebp - 0x94], 0xffffffff
mov dword [ebp - 0x78], 0xffffffff
mov dword [ebp - 0x70], 0xffffffff
mov edx, dword [ebp + 8]
mov dword [ebp - 0x28], edx
mov eax, dword [ebp - 0x28]
add eax, 2
mov dword [ebp - 0x54], eax
mov ecx, dword [ebp - 0x28]
mov dx, word [ecx]
mov word [ebp - 0x2e], dx
add dword [ebp - 0x28], 2
cmp word [ebp - 0x2e], 0
jne 0x408701
mov eax, dword [ebp - 0x28]
sub eax, dword [ebp - 0x54]
sar eax, 1
mov dword [ebp - 0x58], eax
lea ecx, [ebp - 0xa8]
push ecx
push 0
mov edx, dword [ebp - 0x58]
push edx
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpCrackUrl]
test eax, eax
jne 0x408743
xor al, al
jmp 0x408aee
mov ecx, dword [ebp - 0x98]
push ecx
lea ecx, [ebp - 0x14]
call fcn.004067e0
mov dword [ebp - 4], 0
push 0
push 0x4a5e90
lea ecx, [ebp - 0x14]
call fcn.00408c00
mov dword [ebp - 0x44], eax
cmp dword [ebp - 0x44], 0xffffffff
je 0x4087a6
mov edx, dword [ebp - 0x44]
push edx
lea eax, [ebp - 0x64]
push eax
lea ecx, [ebp - 0x14]
call fcn.0040a0c0
mov dword [ebp - 0x5c], eax
mov ecx, dword [ebp - 0x5c]
mov dword [ebp - 0x60], ecx
mov byte [ebp - 4], 1
mov edx, dword [ebp - 0x60]
push edx
lea ecx, [ebp - 0x14]
call fcn.00407340
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x64]
call fcn.00407090
push 0
movzx eax, word [ebp - 0x90]
push eax
lea ecx, [ebp - 0x14]
call fcn.004074e0
push eax
mov ecx, dword [ebp - 0x18]
push ecx
call dword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov dword [ebp - 0x4c], eax
cmp dword [ebp - 0x4c], 0
jne 0x4087e7
mov byte [ebp - 0x19], 0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x14]
call fcn.00407090
mov al, byte [ebp - 0x19]
jmp 0x408aee
mov dword [ebp - 0x48], 0
movzx edx, word [ebp - 0x90]
cmp edx, 0x1bb
jne 0x408804
mov dword [ebp - 0x48], 0x800000
mov eax, dword [ebp - 0x48]
push eax
push 0
push 0
push 0
mov ecx, dword [ebp - 0x7c]
push ecx
push 0x4a5e94
mov edx, dword [ebp - 0x4c]
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x40884f
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov byte [ebp - 0x1a], 0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x14]
call fcn.00407090
mov al, byte [ebp - 0x1a]
jmp 0x408aee
mov dword [ebp - 0x68], 0x3300
push 4
lea ecx, [ebp - 0x68]
push ecx
push 0x1f
mov edx, dword [ebp - 0x10]
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpSetOption]
test eax, eax
jne 0x40889b
mov eax, dword [ebp - 0x10]
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov ecx, dword [ebp - 0x18]
push ecx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov byte [ebp - 0x1b], 0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x14]
call fcn.00407090
mov al, byte [ebp - 0x1b]
jmp 0x408aee
push 0
push 0
push 0
push 0
push 0
push 0
mov edx, dword [ebp - 0x10]
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
test eax, eax
jne 0x4088e4
mov eax, dword [ebp - 0x10]
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov ecx, dword [ebp - 0x18]
push ecx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov byte [ebp - 0x1c], 0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x14]
call fcn.00407090
mov al, byte [ebp - 0x1c]
jmp 0x408aee
push 0
mov edx, dword [ebp - 0x10]
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
test eax, eax
jne 0x408923
mov eax, dword [ebp - 0x10]
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov ecx, dword [ebp - 0x18]
push ecx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov byte [ebp - 0x1d], 0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x14]
call fcn.00407090
mov al, byte [ebp - 0x1d]
jmp 0x408aee
mov dword [ebp - 0x38], 0
xorps xmm0, xmm0
movlpd qword [ebp - 0x40], xmm0
mov dword [ebp - 0x6c], 4
push 0
lea edx, [ebp - 0x6c]
push edx
lea eax, [ebp - 0x38]
push eax
push 0
push 0x20000005
mov ecx, dword [ebp - 0x10]
push ecx
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
test eax, eax
jne 0x408987
mov edx, dword [ebp - 0x10]
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov byte [ebp - 0x1e], 0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x14]
call fcn.00407090
mov al, byte [ebp - 0x1e]
jmp 0x408aee
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
mov ecx, dword [ebp + 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x2c], eax
cmp dword [ebp - 0x2c], 0xffffffff
jne 0x4089db
mov edx, dword [ebp - 0x10]
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov byte [ebp - 0x1f], 0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x14]
call fcn.00407090
mov al, byte [ebp - 0x1f]
jmp 0x408aee
mov ecx, 1
test ecx, ecx
je 0x408aba
mov dword [ebp - 0x34], 0
lea edx, [ebp - 0x34]
push edx
push 0x1000
lea eax, [ebp - 0x10a8]
push eax
mov ecx, dword [ebp - 0x10]
push ecx
call dword [sym.imp.WINHTTP.dll_WinHttpReadData]
test eax, eax
je 0x408a13
cmp dword [ebp - 0x34], 0
jne 0x408a18
jmp 0x408aba
mov dword [ebp - 0x50], 0
push 0
lea edx, [ebp - 0x50]
push edx
mov eax, dword [ebp - 0x34]
push eax
lea ecx, [ebp - 0x10a8]
push ecx
mov edx, dword [ebp - 0x2c]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x408a74
mov eax, dword [ebp - 0x2c]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x10]
push ecx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov edx, dword [ebp - 0x18]
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov byte [ebp - 0x20], 0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x14]
call fcn.00407090
mov al, byte [ebp - 0x20]
jmp 0x408aee
mov eax, dword [ebp - 0x50]
xor ecx, ecx
add eax, dword [ebp - 0x40]
adc ecx, dword [ebp - 0x3c]
mov dword [ebp - 0x40], eax
mov dword [ebp - 0x3c], ecx
cmp dword [ebp + 0x10], 0
je 0x408ab5
cmp dword [ebp - 0x38], 0
je 0x408ab5
push 0
push 0x64
mov edx, dword [ebp - 0x3c]
push edx
mov eax, dword [ebp - 0x40]
push eax
call fcn.0047bde0
mov ecx, dword [ebp - 0x38]
xor esi, esi
push esi
push ecx
push edx
push eax
call fcn.0047bd30
mov edx, dword [ebp + 0x10]
mov dword [edx], eax
jmp 0x4089db
mov eax, dword [ebp - 0x2c]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x10]
push ecx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov edx, dword [ebp - 0x18]
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov byte [ebp - 0x21], 1
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x14]
call fcn.00407090
mov al, byte [ebp - 0x21]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop esi
mov esp, ebp
pop ebp
ret