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

Disassembly:
push ebp
mov ebp, esp
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x4dd0dd
push eax
mov eax, 0x1098
mov dword fs:[0], esp
call fcn.004b8280
push ebx
push esi
mov ecx, 0x510279
call fcn.004b7c9d
lea eax, [ebp - 0x15]
mov dword [ebp - 0x40], 0x690057
push eax
lea ecx, [ebp - 0x30]
mov dword [ebp - 0x3c], 0x48006e
push ecx
lea edx, [ebp - 0x40]
mov dword [ebp - 0x38], 0x540054
push edx
lea ecx, [ebp - 0x98]
mov dword [ebp - 0x34], 0x50
call fcn.00403f10
push 0
push 0
push 0
push 0
push dword [eax]
call dword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov ebx, eax
lea ecx, [ebp - 0x98]
mov dword [ebp - 0x24], ebx
call fcn.0040c550
test ebx, ebx
je 0x405344
mov edx, dword [ebp + 8]
xorps xmm0, xmm0
mov ecx, edx
mov dword [ebp - 0x88], 0
movlpd qword [ebp - 0x80], xmm0
movlpd qword [ebp - 0x74], xmm0
movlpd qword [ebp - 0x6c], xmm0
movlpd qword [ebp - 0x64], xmm0
lea esi, [ecx + 2]
mov dword [ebp - 0x58], 0
mov dword [ebp - 0x8c], 0x3c
mov dword [ebp - 0x84], 0xffffffff
mov dword [ebp - 0x78], 0xffffffff
mov dword [ebp - 0x5c], 0xffffffff
mov dword [ebp - 0x54], 0xffffffff
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x404ff2
lea eax, [ebp - 0x8c]
sub ecx, esi
push eax
push 0
sar ecx, 1
push ecx
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpCrackUrl]
test eax, eax
je 0x405344
push edi
push dword [ebp - 0x7c]
lea ecx, [ebp - 0x10]
call fcn.00403b70
mov eax, dword [ebp - 0x10]
or edi, 0xffffffff
mov dword [ebp - 4], 0
cmp dword [eax - 0xc], 0
jl 0x4050f8
push 0x4e4908
push eax
call fcn.004bb0b9
mov ecx, eax
add esp, 8
test ecx, ecx
je 0x405094
mov eax, dword [ebp - 0x10]
sub ecx, eax
sar ecx, 1
cmp ecx, edi
je 0x405097
push ecx
lea eax, [ebp - 0x14]
push eax
lea ecx, [ebp - 0x10]
call fcn.004062a0
push eax
lea ecx, [ebp - 0x10]
mov byte [ebp - 4], 1
call fcn.00404180
mov edx, dword [ebp - 0x14]
mov eax, edi
mov byte [ebp - 4], 0
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x405094
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x10]
cmp dword [eax - 0xc], 0
jl 0x4050f8
push 0x4e496c
push eax
call fcn.004bb0b9
mov ecx, eax
add esp, 8
test ecx, ecx
je 0x4050f5
mov eax, dword [ebp - 0x10]
sub ecx, eax
sar ecx, 1
cmp ecx, 0xffffffff
je 0x4050f8
push ecx
lea eax, [ebp - 0x14]
push eax
lea ecx, [ebp - 0x10]
call fcn.004062a0
push eax
lea ecx, [ebp - 0x10]
mov byte [ebp - 4], 2
call fcn.00404180
mov edx, dword [ebp - 0x14]
mov eax, edi
mov byte [ebp - 4], 0
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x4050f5
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x10]
push 0
push dword [ebp - 0x74]
push eax
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov dword [ebp - 0x14], eax
test eax, eax
je 0x405310
mov ecx, 0x1bb
mov dword [ebp - 0x30], 0x450047
xor esi, esi
mov dword [ebp - 0x2c], 0x54
cmp cx, word [ebp - 0x74]
lea edx, [ebp - 0x30]
mov eax, 0x800000
lea ecx, [ebp - 0x28]
cmove esi, eax
lea eax, [ebp - 0x15]
push eax
push ecx
push edx
lea ecx, [ebp - 0xa4]
call fcn.00403f10
push esi
push 0
push 0
push 0
push dword [ebp - 0x60]
push dword [eax]
push dword [ebp - 0x14]
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
lea ecx, [ebp - 0xa4]
mov esi, eax
call fcn.0040c550
test esi, esi
jne 0x40517a
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
jmp 0x405310
push 4
lea eax, [ebp - 0x44]
mov dword [ebp - 0x44], 0x3300
push eax
push 0x1f
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpSetOption]
test eax, eax
je 0x405304
push 0
push 0
push 0
push 0
push 0
push 0
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
test eax, eax
je 0x405304
push 0
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
test eax, eax
je 0x405304
push 0
lea eax, [ebp - 0x48]
mov dword [ebp - 0x20], 0
push eax
lea eax, [ebp - 0x20]
mov dword [ebp - 0x48], 4
push eax
push 0
push 0x20000005
xorps xmm0, xmm0
push esi
movlpd qword [ebp - 0x50], xmm0
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
test eax, eax
je 0x405304
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x28], eax
cmp eax, 0xffffffff
je 0x405304
lea eax, [ebp - 0x1c]
mov dword [ebp - 0x1c], 0
push eax
push 0x1000
lea eax, [ebp - 0x10a4]
push eax
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpReadData]
test eax, eax
je 0x4052cf
mov edi, dword [ebp - 0x4c]
mov ebx, dword [ebp - 0x50]
nop dword [eax]
mov eax, dword [ebp - 0x1c]
test eax, eax
je 0x4052c9
push 0
lea ecx, [ebp - 0x14]
mov dword [ebp - 0x14], 0
push ecx
push eax
lea eax, [ebp - 0x10a4]
push eax
push dword [ebp - 0x28]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4052e8
add ebx, dword [ebp - 0x14]
adc edi, 0
cmp dword [ebp + 0x10], 0
je 0x4052a7
cmp dword [ebp - 0x20], 0
je 0x4052a7
push 0
push 0x64
push edi
push ebx
call fcn.004b8240
push 0
push dword [ebp - 0x20]
push edx
push eax
call fcn.004b8190
mov ecx, dword [ebp + 0x10]
mov dword [ecx], eax
lea eax, [ebp - 0x1c]
mov dword [ebp - 0x1c], 0
push eax
push 0x1000
lea eax, [ebp - 0x10a4]
push eax
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpReadData]
test eax, eax
jne 0x405250
mov ebx, dword [ebp - 0x24]
or edi, 0xffffffff
push dword [ebp - 0x28]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
mov esi, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
call esi
push ebx
call esi
mov bl, 1
jmp 0x405312
push dword [ebp - 0x28]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
mov esi, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
call esi
push dword [ebp - 0x24]
call esi
or edi, 0xffffffff
jmp 0x405310
push esi
mov esi, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
call esi
push ebx
call esi
xor bl, bl
mov eax, dword [ebp - 0x10]
mov dword [ebp - 4], 0xffffffff
add eax, 0xfffffff0
lock xadd dword [eax + 0xc], edi
dec edi
test edi, edi
pop edi
jg 0x405332
mov ecx, dword [eax]
push eax
mov edx, dword [ecx]
call dword [edx + 4]
pop esi
mov al, bl
pop ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 0xc]
xor al, al
pop esi
pop ebx
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret