Function at 0x404e20
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 0x4dcc5d
push eax
mov eax, 0x1098
mov dword fs:[0], esp
call fcn.004b7e10
push ebx
push esi
mov ecx, 0x510279
call fcn.004b782d
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.00403ee0
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.0040c340
test ebx, ebx
je 0x405254
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 0x404f02
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 0x405254
push edi
push dword [ebp - 0x7c]
lea ecx, [ebp - 0x10]
call fcn.00403b40
mov eax, dword [ebp - 0x10]
or edi, 0xffffffff
mov dword [ebp - 4], 0
cmp dword [eax - 0xc], 0
jl 0x405008
push 0x4e4908
push eax
call fcn.004bac49
mov ecx, eax
add esp, 8
test ecx, ecx
je 0x404fa4
mov eax, dword [ebp - 0x10]
sub ecx, eax
sar ecx, 1
cmp ecx, edi
je 0x404fa7
push ecx
lea eax, [ebp - 0x14]
push eax
lea ecx, [ebp - 0x10]
call fcn.004061b0
push eax
lea ecx, [ebp - 0x10]
mov byte [ebp - 4], 1
call fcn.00404150
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 0x404fa4
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 0x405008
push 0x4e496c
push eax
call fcn.004bac49
mov ecx, eax
add esp, 8
test ecx, ecx
je 0x405005
mov eax, dword [ebp - 0x10]
sub ecx, eax
sar ecx, 1
cmp ecx, 0xffffffff
je 0x405008
push ecx
lea eax, [ebp - 0x14]
push eax
lea ecx, [ebp - 0x10]
call fcn.004061b0
push eax
lea ecx, [ebp - 0x10]
mov byte [ebp - 4], 2
call fcn.00404150
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 0x405005
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 0x405220
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.00403ee0
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.0040c340
test esi, esi
jne 0x40508a
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
jmp 0x405220
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 0x405214
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 0x405214
push 0
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
test eax, eax
je 0x405214
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 0x405214
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 0x405214
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 0x4051df
mov edi, dword [ebp - 0x4c]
mov ebx, dword [ebp - 0x50]
nop dword [eax]
mov eax, dword [ebp - 0x1c]
test eax, eax
je 0x4051d9
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 0x4051f8
add ebx, dword [ebp - 0x14]
adc edi, 0
cmp dword [ebp + 0x10], 0
je 0x4051b7
cmp dword [ebp - 0x20], 0
je 0x4051b7
push 0
push 0x64
push edi
push ebx
call fcn.004b7dd0
push 0
push dword [ebp - 0x20]
push edx
push eax
call fcn.004b7d20
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 0x405160
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 0x405222
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 0x405220
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 0x405242
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