Function at 0x40f640
Capabilities:
Check http status code
Delete file
Initialize winhttp library
Prepare http request
Read http header
Receive http response
Set http header

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x432c60
mov eax, dword fs:[0]
push eax
sub esp, 0x58
push ebx
push esi
push edi
mov eax, dword [0x448090]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov dword [ebp - 0x14], edi
mov esi, dword [ebp + 8]
lea ecx, [ebp - 0x30]
lea eax, [esi + 0x448]
push eax
call fcn.00403130
lea edx, [esi + 0x144a]
mov dword [ebp - 4], 0
test edx, edx
jne 0x40f694
xor ecx, ecx
jmp 0x40f6af
mov ecx, edx
lea esi, [ecx + 2]
lea esp, [esp]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40f6a0
sub ecx, esi
sar ecx, 1
push ecx
push edx
lea ecx, [ebp - 0x30]
call fcn.004032b0
xor esi, esi
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x1c], esi
mov byte [ebp - 4], 1
cmp dword [edi], 0
je 0x40f70e
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
push dword [edi]
lea ecx, [ebp - 0x50]
push dword [edi + 0x1c]
push str.Restatrning_of_downloading_url__attempt_:__s___u
push 2
push 3
push 0x95
push str.CDownloader::PerformOnline
push str.Downloader.cpp
call fcn.0041e2e0
push eax
call fcn.0041e500
add esp, 0x18
inc dword [edi]
push 0
push 0
push 0
push 1
push dword [edi + 0xc]
call dword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov dword [ebp - 0x44], eax
mov byte [ebp - 4], 2
test eax, eax
je 0x40fc27
mov ebx, dword [ebp + 8]
push 0
movzx ecx, word [ebx + 0x244c]
push ecx
lea ecx, [ebx + 0x42]
push ecx
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov dword [ebp - 0x40], eax
mov byte [ebp - 4], 3
test eax, eax
je 0x40fbff
xor ecx, ecx
cmp dword [ebx + 0x2450], 3
mov edx, 0x800000
cmove ecx, edx
push ecx
push 0
push 0
push 0
push dword [ebp - 0x30]
push 0
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov ebx, eax
mov dword [ebp - 0x3c], ebx
mov byte [ebp - 4], 4
test ebx, ebx
je 0x40f867
cmp dword [ebp - 0x18], 0
je 0x40f808
mov eax, dword [0x448020]
mov ecx, 0x448020
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x34], eax
push dword [ebp - 0x18]
lea eax, [ebp - 0x34]
push str.Range:_bytes_u_
push eax
mov byte [ebp - 4], 5
call fcn.004025d0
mov edi, dword [ebp - 0x34]
add esp, 0xc
push 0x10000000
push dword [edi - 0xc]
push edi
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpAddRequestHeaders]
test eax, eax
jne 0x40f7e7
mov dword [ebp - 0x18], eax
test esi, esi
je 0x40f7e2
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor esi, esi
mov dword [ebp - 0x1c], esi
add edi, 0xfffffff0
mov byte [ebp - 4], 4
lea eax, [edi + 0xc]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40f805
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov edi, dword [ebp - 0x14]
push 0
push 0
push 0
push 0
push 0
push 0
push ebx
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x24], 4
call dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
test eax, eax
je 0x40f867
push 0
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
test eax, eax
je 0x40f867
push 0
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x38]
push eax
push 0
push 0x20000013
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
test eax, eax
je 0x40f867
mov eax, dword [ebp - 0x38]
cmp eax, 0xc8
je 0x40f887
cmp eax, 0xce
je 0x40f89e
mov ecx, dword [edi + 0x18]
test ecx, ecx
je 0x40f87d
cmp dword [edi], 6
jne 0x40f87d
push dword [edi + 0x20]
mov eax, dword [ecx]
push 3
call dword [eax + 0xc]
mov edi, 3
jmp 0x40fb73
mov dword [ebp - 0x18], 0
test esi, esi
je 0x40f899
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor esi, esi
mov dword [ebp - 0x1c], esi
mov eax, dword [0x448020]
mov ecx, 0x448020
call dword [eax + 0xc]
lea edi, [eax + 0x10]
mov dword [ebp - 0x28], edi
push 0
lea eax, [ebp - 0x24]
push eax
push 0
push 0
push 5
mov byte [ebp - 4], 6
push ebx
mov dword [ebp - 0x24], 4
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
test eax, eax
jne 0x40f9bb
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x40f9bb
mov edx, dword [ebp - 0x24]
shr edx, 1
js 0x40faf5
mov eax, dword [edi - 8]
mov ecx, 1
sub ecx, dword [edi - 4]
sub eax, edx
or eax, ecx
jge 0x40f90e
push edx
lea ecx, [ebp - 0x28]
call fcn.004026b0
mov edi, dword [ebp - 0x28]
push 0
lea eax, [ebp - 0x24]
push eax
push edi
push 0
push 5
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
test eax, eax
je 0x40f9bb
mov eax, dword [ebp - 0x24]
shr eax, 1
cmp eax, 0xffffffff
jne 0x40f93e
push dword [edi - 8]
push edi
call fcn.00420547
add esp, 8
test eax, eax
js 0x40faf5
cmp eax, dword [edi - 8]
jg 0x40faf5
xor ecx, ecx
push 0xa
push ecx
mov dword [edi - 0xc], eax
push edi
mov word [edi + eax*2], cx
call fcn.0042142c
mov edx, eax
mov eax, dword [ebp - 0x18]
add edx, eax
add esp, 0xc
mov dword [ebp - 0x20], edx
test eax, eax
jne 0x40f9bb
mov ecx, dword [ebp - 0x14]
cmp dword [ecx + 0x14], eax
jne 0x40f9aa
mov edx, dword [ecx + 0x28]
mov eax, dword [edx]
test eax, eax
jne 0x40f99f
mov eax, dword [ebp - 0x20]
mov dword [edx], eax
inc eax
push eax
call fcn.00420b5d
mov edi, dword [ebp - 0x14]
mov edx, dword [ebp - 0x20]
mov ecx, dword [edi + 0x24]
add esp, 4
mov dword [ecx], eax
jmp 0x40f9ac
mov edx, dword [ebp - 0x20]
cmp eax, edx
jb 0x40fae1
mov edi, ecx
mov ecx, dword [edi + 0x18]
test ecx, ecx
je 0x40f9be
mov eax, dword [ecx]
push edx
call dword [eax + 4]
jmp 0x40f9be
mov edi, dword [ebp - 0x14]
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x60], 0
mov dword [ebp - 0x5c], 0
mov dword [ebp - 0x58], 0
mov dword [ebp - 0x54], 0
push 0xfc00
lea ecx, [ebp - 0x60]
mov byte [ebp - 4], 7
call fcn.00410640
test al, al
je 0x40fa02
call fcn.004080f0
mov dword [ebp - 0x5c], 0xfc00
cmp dword [edi + 4], 0
mov esi, dword [ebp - 0x18]
jne 0x40fa68
jmp 0x40fa10
cmp esi, dword [ebp - 0x20]
jae 0x40fa68
mov ebx, dword [ebp - 0x3c]
lea eax, [ebp - 0x2c]
push eax
push dword [ebp - 0x5c]
push dword [ebp - 0x60]
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpReadData]
test eax, eax
je 0x40fa6b
mov eax, dword [ebp - 0x2c]
test eax, eax
je 0x40fa6b
push esi
lea ecx, [ebp - 0x1c]
push ecx
push eax
push dword [ebp - 0x60]
mov ecx, edi
call fcn.0040fcf0
mov dword [ebp - 0x18], eax
test eax, eax
jne 0x40faff
add esi, dword [ebp - 0x2c]
mov ecx, dword [edi + 0x18]
mov dword [ebp - 0x18], esi
test ecx, ecx
je 0x40fa62
mov eax, dword [ecx]
push esi
call dword [eax + 8]
cmp dword [edi + 4], 0
je 0x40fa10
mov ebx, dword [ebp - 0x3c]
mov eax, dword [ebp - 0x60]
test eax, eax
je 0x40fa7b
push eax
call fcn.00420629
add esp, 4
mov byte [ebp - 4], 4
mov edx, dword [ebp - 0x28]
add edx, 0xfffffff0
or ecx, 0xffffffff
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40fa9c
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
push ebx
mov ebx, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
call ebx
push dword [ebp - 0x40]
call ebx
mov byte [ebp - 4], 1
push dword [ebp - 0x44]
call ebx
cmp dword [edi + 4], 0
mov ebx, dword [ebp - 0x20]
jne 0x40fb8f
test ebx, ebx
je 0x40fb8f
cmp esi, ebx
je 0x40fb8f
cmp dword [edi], 6
jge 0x40fb8f
mov esi, dword [ebp - 0x1c]
jmp 0x40f6d0
mov eax, dword [ecx + 0x28]
mov dword [eax], edx
push dword [ecx + 0x20]
push 5
call fcn.004100a0
mov dword [ebp - 0x18], eax
jmp 0x40fb52
push 0x80070057
call fcn.00402950
mov esi, dword [ebp - 0x1c]
test esi, esi
je 0x40fb12
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor esi, esi
mov dword [ebp - 0x1c], esi
push dword [edi + 0x20]
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov edx, dword [edi + 0x18]
test edx, edx
je 0x40fb3f
cmp dword [edi], 6
mov ecx, dword [ebp - 0x18]
je 0x40fb34
cmp ecx, 3
je 0x40fb3f
cmp ecx, 4
je 0x40fb3f
push dword [edi + 0x20]
mov eax, dword [edx]
push ecx
mov ecx, edx
call dword [eax + 0xc]
mov eax, dword [ebp - 0x60]
test eax, eax
je 0x40fb4f
push eax
call fcn.00420629
add esp, 4
mov edi, dword [ebp - 0x28]
add edi, 0xfffffff0
mov byte [ebp - 4], 4
lea eax, [edi + 0xc]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40fb70
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov edi, dword [ebp - 0x18]
test ebx, ebx
je 0x40fbed
push ebx
mov ebx, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
call ebx
push dword [ebp - 0x40]
call ebx
push dword [ebp - 0x44]
call ebx
jmp 0x40fc42
mov esi, dword [ebp - 0x1c]
test esi, esi
je 0x40fba2
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor esi, esi
mov dword [ebp - 0x1c], esi
test ebx, ebx
je 0x40fbd8
cmp dword [ebp - 0x18], ebx
je 0x40fbd8
push dword [edi + 0x20]
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov eax, dword [edi + 4]
push dword [edi + 0x20]
test eax, eax
mov eax, 1
mov ecx, 4
cmovne ecx, eax
push ecx
mov ecx, edi
call fcn.004100a0
mov esi, dword [ebp - 0x1c]
mov edi, eax
jmp 0x40fc42
mov ecx, dword [edi + 0x18]
test ecx, ecx
je 0x40fbe9
push dword [edi + 0x20]
mov eax, dword [ecx]
push 0
call dword [eax + 0xc]
xor edi, edi
jmp 0x40fc42
push dword [ebp - 0x40]
mov ebx, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
call ebx
push dword [ebp - 0x44]
call ebx
jmp 0x40fc42
mov ecx, dword [edi + 0x18]
test ecx, ecx
je 0x40fc15
cmp dword [edi], 6
jne 0x40fc15
push dword [edi + 0x20]
mov eax, dword [ecx]
push 3
call dword [eax + 0xc]
push dword [ebp - 0x44]
mov ebx, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov edi, 3
call ebx
jmp 0x40fc42
mov ecx, dword [edi + 0x18]
test ecx, ecx
je 0x40fc3d
cmp dword [edi], 6
jne 0x40fc3d
push dword [edi + 0x20]
mov eax, dword [ecx]
push 3
call dword [eax + 0xc]
mov edi, 3
test esi, esi
je 0x40fc4d
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 4], 0xffffffff
mov esi, dword [ebp - 0x30]
add esi, 0xfffffff0
or ecx, 0xffffffff
lea eax, [esi + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40fc71
mov ecx, dword [esi]
push esi
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4