Function at 0x405cd0
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 0x419154
mov eax, dword fs:[0]
push eax
sub esp, 0xd4
mov eax, dword [0x4231e0]
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 esi, dword [ebp + 8]
mov edi, dword [ebp + 0xc]
push 0
push 0
push 0
push 1
push 0x41a6b0
call dword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov ebx, eax
mov dword [ebp - 0x90], ebx
test ebx, ebx
mov dword [ebp - 4], 0
setne al
test al, al
jne 0x405d57
mov dword [ebp - 0x74], str.Error_opening_session
lea eax, [ebp - 0x74]
push eax
lea ecx, [ebp - 0x80]
call fcn.004093c3
mov dword [ebp - 0x80], vtable.std::runtime_error.0
push 0x421310
lea eax, [ebp - 0x80]
push eax
call fcn.00408033
push 0x3c
lea eax, [ebp - 0xe0]
push 0
push eax
call fcn.00408bc0
add esp, 0xc
mov dword [ebp - 0xe0], 0x3c
lea eax, [ebp - 0xe0]
mov dword [ebp - 0xcc], 0xffffffff
mov dword [ebp - 0xb0], 0xffffffff
push eax
push 0
push 0
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpCrackUrl]
test eax, eax
jne 0x405da7
mov dword [ebp - 0x74], str.Error_parsing_url
jmp 0x405d36
mov eax, dword [ebp - 0xd4]
cmp eax, 1
je 0x405dc3
cmp eax, 2
je 0x405dc6
mov dword [ebp - 0x74], str.Unsupported_scheme
jmp 0x405d36
cmp eax, 2
mov ecx, dword [ebp - 0xd0]
sete byte [ebp - 0x81]
mov eax, dword [ebp - 0xcc]
xor edx, edx
push dword [ebp - 0x90]
mov dword [ebp - 0x2c], 7
mov dword [ebp - 0x30], 0
lea eax, [ecx + eax*2]
mov word [ebp - 0x40], dx
push eax
push ecx
lea ecx, [ebp - 0x40]
call fcn.004059e0
mov ecx, dword [ebp - 0xb4]
xor edx, edx
mov eax, dword [ebp - 0xb0]
push dword [ebp - 0x90]
mov byte [ebp - 4], 1
mov dword [ebp - 0x44], 7
lea eax, [ecx + eax*2]
mov dword [ebp - 0x48], 0
push eax
push ecx
lea ecx, [ebp - 0x58]
mov word [ebp - 0x58], dx
call fcn.004059e0
cmp dword [ebp - 0x2c], 8
lea eax, [ebp - 0x40]
push 0
push dword [ebp - 0xc8]
cmovae eax, dword [ebp - 0x40]
push eax
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov dword [ebp - 0x9c], eax
test eax, eax
mov byte [ebp - 4], 3
setne cl
test cl, cl
jne 0x405e71
mov dword [ebp - 0x74], str.Connection_failed
jmp 0x405d36
xor edx, edx
mov ecx, 0x800000
cmp byte [ebp - 0x81], dl
cmovne edx, ecx
cmp dword [ebp - 0x44], 8
push edx
push 0
push 0
push 0
lea ecx, [ebp - 0x58]
cmovae ecx, dword [ebp - 0x58]
push ecx
push 0x41a71c
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov esi, eax
mov dword [ebp - 0xa0], esi
test esi, esi
mov byte [ebp - 4], 4
setne al
test al, al
jne 0x405ec1
mov dword [ebp - 0x74], str.Request_failed
jmp 0x405d36
push 0
push 0
push 0
push 0
push 0
push 0
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
test eax, eax
jne 0x405ee4
mov dword [ebp - 0x74], str.Send_failed
jmp 0x405d36
push 0
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
test eax, eax
jne 0x405efd
mov dword [ebp - 0x74], str.Receive_failed
jmp 0x405d36
push 0
lea eax, [ebp - 0x98]
mov dword [ebp - 0x94], 0
push eax
lea eax, [ebp - 0x94]
mov dword [ebp - 0x98], 4
push eax
push 0
push 0x20000013
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
test eax, eax
jne 0x405f3f
mov dword [ebp - 0x74], str.Parsing_reply_failed
jmp 0x405d36
mov ecx, dword [ebp - 0x94]
lea eax, [ecx - 0xc8]
cmp eax, 0x63
ja 0x406135
mov dword [ebp - 0x80], 0
mov dword [ebp - 0x7c], 0
mov dword [ebp - 0x78], 0
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
mov dword [ebp - 0xa4], edi
mov byte [ebp - 4], 8
cmp edi, 0xffffffff
jne 0x405fc0
mov dword [ebp - 0x74], str.Failed_to_open_destination_file
lea eax, [ebp - 0x74]
push eax
lea ecx, [ebp - 0x1c]
call fcn.004093c3
mov dword [ebp - 0x1c], vtable.std::runtime_error.0
lea eax, [ebp - 0x1c]
push 0x421310
jmp 0x405d51
lea eax, [ebp - 0x8c]
mov dword [ebp - 0x8c], 0
push eax
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpQueryDataAvailable]
test eax, eax
je 0x406120
mov ecx, dword [ebp - 0x8c]
test ecx, ecx
je 0x406052
mov eax, dword [ebp - 0x7c]
mov edx, dword [ebp - 0x80]
sub eax, edx
cmp ecx, eax
jbe 0x406008
push ecx
lea ecx, [ebp - 0x80]
call fcn.00406440
mov ecx, dword [ebp - 0x8c]
mov edx, dword [ebp - 0x80]
lea eax, [ebp - 0x8c]
push eax
push ecx
push edx
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpReadData]
test eax, eax
je 0x40610b
push 0
lea eax, [ebp - 0x74]
mov dword [ebp - 0x74], 0
push eax
push dword [ebp - 0x8c]
push dword [ebp - 0x80]
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4060f6
cmp dword [ebp - 0x8c], 0
jne 0x405fc0
test edi, edi
je 0x40605d
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x80]
test eax, eax
je 0x40606d
push eax
call fcn.00407821
add esp, 4
mov edi, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
test esi, esi
je 0x40607a
push esi
call edi
mov eax, dword [ebp - 0x9c]
test eax, eax
je 0x406087
push eax
call edi
cmp dword [ebp - 0x44], 8
jb 0x406098
push dword [ebp - 0x58]
call fcn.00407821
add esp, 4
xor eax, eax
mov dword [ebp - 0x44], 7
cmp dword [ebp - 0x2c], 8
mov dword [ebp - 0x48], 0
mov word [ebp - 0x58], ax
jb 0x4060bd
push dword [ebp - 0x40]
call fcn.00407821
add esp, 4
xor eax, eax
mov dword [ebp - 0x2c], 7
mov dword [ebp - 0x30], 0
mov word [ebp - 0x40], ax
test ebx, ebx
je 0x4060d8
push ebx
call edi
mov al, 1
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.00408024
mov esp, ebp
pop ebp
ret
mov dword [ebp - 0x88], str.Failed_to_write_destination_file
lea eax, [ebp - 0x88]
jmp 0x405f9d
mov dword [ebp - 0x88], str.Reading_data_failed
lea eax, [ebp - 0x88]
jmp 0x405f9d
mov dword [ebp - 0x88], str.Query_data_failed
lea eax, [ebp - 0x88]
jmp 0x405f9d
mov dword [ebp - 0x14], 0xf
mov dword [ebp - 0x18], 0
mov byte [ebp - 0x28], 0
lea eax, [ebp - 0x28]
mov byte [ebp - 4], 5
push eax
push ecx
lea eax, [ebp - 0x70]
push eax
call fcn.00405bb0
add esp, 0xc
cmp dword [eax + 0x14], 0x10
mov byte [ebp - 4], 6
jb 0x406168
mov eax, dword [eax]
mov dword [ebp - 0x88], eax
lea ecx, [ebp - 0x80]
lea eax, [ebp - 0x88]
push eax
call fcn.004093c3
cmp dword [ebp - 0x5c], 0x10
mov dword [ebp - 0x80], vtable.std::runtime_error.0
mov byte [ebp - 4], 5
jb 0x406199
push dword [ebp - 0x70]
call fcn.00407821
add esp, 4
mov dword [ebp - 0x80], vtable.mailru::HttpError.0
push 0x421364
jmp 0x405d4e