Function at 0x401000
Capabilities:
Check http status code
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 0x40d3e6
mov eax, dword fs:[0]
push eax
mov eax, 0x40ac
call fcn.00408cf0
mov eax, dword [0x41207c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
xor ebx, ebx
mov dword [ebp - 0x4064], eax
mov dword [ebp - 0x4060], ecx
mov eax, 7
xor ecx, ecx
mov dword [ebp - 0x4068], edx
mov dword [ebp - 0x405c], ebx
xor edi, edi
mov dword [ebp - 0x406c], ebx
mov dword [ebp - 0x4044], eax
mov dword [ebp - 0x4048], ebx
mov word [ebp - 0x4058], cx
mov dword [ebp - 4], ebx
xor edx, edx
mov dword [ebp - 0x4028], eax
mov dword [ebp - 0x402c], ebx
mov word [ebp - 0x403c], dx
push ebx
push 0x100
lea eax, [ebp - 0x4058]
mov byte [ebp - 4], 1
push eax
mov dword [ebp - 0x407c], 0x41023c
mov dword [ebp - 0x4078], ebx
call fcn.00401a30
mov edx, dword [ebp - 0x4048]
mov ecx, 0x100
lea eax, [ebp - 0x4058]
call fcn.00401940
cmp dword [ebp - 0x4044], 8
mov eax, dword [ebp - 0x4058]
mov dword [ebp - 0x4048], 0x100
jae 0x4010e4
lea eax, [ebp - 0x4058]
xor ecx, ecx
mov word [eax + 0x200], cx
mov edx, dword [ebp - 0x402c]
or eax, 0xffffffff
cmp edx, 0x400
jb 0x401113
mov ecx, 0x400
lea esi, [ebp - 0x403c]
call fcn.00401bf0
jmp 0x401195
mov ebx, 0x400
sub ebx, edx
sub eax, edx
cmp eax, ebx
ja 0x40112a
push str.string_too_long
call fcn.00402758
test ebx, ebx
je 0x401193
lea esi, [edx + ebx]
cmp esi, 0x7ffffffe
jbe 0x401143
push str.string_too_long
call fcn.00402758
mov eax, dword [ebp - 0x4028]
cmp eax, esi
jae 0x4011cc
push edx
push esi
lea ecx, [ebp - 0x403c]
push ecx
call fcn.00401a30
mov edx, dword [ebp - 0x402c]
test esi, esi
je 0x401193
mov ecx, ebx
lea eax, [ebp - 0x403c]
call fcn.00401940
cmp dword [ebp - 0x4028], 8
mov eax, dword [ebp - 0x403c]
mov dword [ebp - 0x402c], esi
jae 0x40118d
lea eax, [ebp - 0x403c]
xor ecx, ecx
mov word [eax + esi*2], cx
xor ebx, ebx
push 0x3c
lea edx, [ebp - 0x40b8]
push ebx
push edx
call fcn.00406240
mov eax, 8
add esp, 0xc
mov dword [ebp - 0x40b8], 0x3c
cmp dword [ebp - 0x4044], eax
jb 0x4011ee
mov ecx, dword [ebp - 0x4058]
mov dword [ebp - 0x40a8], ecx
jmp 0x4011fa
test esi, esi
jne 0x401165
cmp eax, 8
mov eax, dword [ebp - 0x403c]
mov dword [ebp - 0x402c], ecx
jae 0x4011e7
lea eax, [ebp - 0x403c]
xor edx, edx
mov word [eax], dx
jmp 0x401193
lea edx, [ebp - 0x4058]
mov dword [ebp - 0x40a8], edx
mov ecx, dword [ebp - 0x4048]
mov dword [ebp - 0x40a4], ecx
cmp dword [ebp - 0x4028], eax
jb 0x40121c
mov edx, dword [ebp - 0x403c]
mov dword [ebp - 0x408c], edx
jmp 0x401228
lea eax, [ebp - 0x403c]
mov dword [ebp - 0x408c], eax
mov eax, dword [ebp - 0x4064]
mov ecx, dword [ebp - 0x402c]
lea edx, [ebp - 0x40b8]
push edx
push ebx
push ebx
push eax
mov dword [ebp - 0x4088], ecx
call dword [sym.imp.WINHTTP.dll_WinHttpCrackUrl]
mov ecx, 0x1bb
cmp word [ebp - 0x40a0], cx
jne 0x40125d
mov edi, 1
push ebx
push ebx
push ebx
push ebx
push 0x410244
call dword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov esi, eax
mov dword [ebp - 0x4064], esi
cmp esi, ebx
je 0x40144f
cmp dword [ebp - 0x4044], 8
mov eax, dword [ebp - 0x4058]
jae 0x401291
lea eax, [ebp - 0x4058]
mov edx, edi
neg edx
sbb edx, edx
push ebx
and edx, 0x16b
add edx, 0x50
push edx
push eax
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov ecx, eax
mov dword [ebp - 0x4070], ecx
cmp ecx, ebx
je 0x40142c
cmp dword [ebp - 0x4028], 8
mov eax, dword [ebp - 0x403c]
jae 0x4012cf
lea eax, [ebp - 0x403c]
neg edi
sbb edi, edi
and edi, 0x800000
add edi, 0x100
push edi
lea edx, [ebp - 0x407c]
push edx
push ebx
push ebx
push eax
push 0x41027c
push ecx
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov dword [ebp - 0x405c], eax
cmp eax, ebx
je 0x40142c
push ebx
push ebx
push ebx
push ebx
push ebx
push ebx
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
test eax, eax
je 0x40142c
mov edi, dword [ebp - 0x405c]
push ebx
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
push ebx
lea ecx, [ebp - 0x4074]
push ecx
lea edx, [ebp - 0x20]
push edx
push ebx
push 0x13
push edi
mov esi, eax
mov dword [ebp - 0x4074], 0x10
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
test eax, eax
je 0x401426
push 0xa
lea eax, [ebp - 0x20]
push ebx
push eax
call fcn.004029ef
mov ecx, dword [ebp - 0x4068]
add esp, 0xc
mov dword [ecx], eax
cmp esi, ebx
je 0x40141c
cmp eax, 0xc8
jne 0x40141c
mov edx, dword [ebp - 0x4060]
push 0x410284
push edx
call fcn.00402ac7
mov esi, eax
add esp, 8
cmp esi, ebx
je 0x401426
mov edi, dword [sym.imp.WINHTTP.dll_WinHttpQueryDataAvailable]
nop
mov ecx, dword [ebp - 0x405c]
lea eax, [ebp - 0x4060]
push eax
push ecx
mov dword [ebp - 0x4060], ebx
call edi
test eax, eax
je 0x401426
mov eax, dword [ebp - 0x4060]
lea edx, [ebp - 0x4068]
push edx
mov edx, dword [ebp - 0x405c]
push eax
lea ecx, [ebp - 0x4020]
push ecx
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpReadData]
test eax, eax
je 0x401426
mov eax, dword [ebp - 0x4068]
cmp eax, ebx
je 0x40140d
push esi
push eax
lea eax, [ebp - 0x4020]
push 1
push eax
call fcn.00402c35
add esp, 0x10
cmp dword [ebp - 0x4068], eax
jne 0x401426
cmp dword [ebp - 0x4060], ebx
ja 0x4013a0
push esi
call fcn.00402e39
push esi
call fcn.00402f02
add esp, 8
mov dword [ebp - 0x406c], 1
mov esi, dword [ebp - 0x4064]
push esi
mov esi, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
call esi
mov eax, dword [ebp - 0x4070]
cmp eax, ebx
je 0x401442
push eax
call esi
mov eax, dword [ebp - 0x405c]
cmp eax, ebx
je 0x40144f
push eax
call esi
mov esi, 8
cmp dword [ebp - 0x4028], esi
jb 0x40146b
mov ecx, dword [ebp - 0x403c]
push ecx
call fcn.00402822
add esp, 4
xor edx, edx
mov dword [ebp - 0x4028], 7
mov dword [ebp - 0x402c], ebx
mov word [ebp - 0x403c], dx
cmp dword [ebp - 0x4044], esi
jb 0x40149b
mov eax, dword [ebp - 0x4058]
push eax
call fcn.00402822
add esp, 4
mov eax, dword [ebp - 0x406c]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00402813
mov esp, ebp
pop ebp
ret