Function at 0x404830
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 0x4d8105
push eax
mov eax, 0x1060
mov dword fs:[0], esp
call fcn.004b5910
push esi
push edi
mov ecx, 0x5100a3
call fcn.004b532d
push 0
push 0
push 0
push 0
push 0x4df868
call dword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov edi, eax
test edi, edi
je 0x404b86
mov edx, dword [ebp + 8]
xorps xmm0, xmm0
mov ecx, edx
mov dword [ebp - 0x68], 0
movlpd qword [ebp - 0x60], xmm0
movlpd qword [ebp - 0x54], xmm0
movlpd qword [ebp - 0x4c], xmm0
movlpd qword [ebp - 0x44], xmm0
lea esi, [ecx + 2]
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x6c], 0x3c
mov dword [ebp - 0x64], 0xffffffff
mov dword [ebp - 0x58], 0xffffffff
mov dword [ebp - 0x3c], 0xffffffff
mov dword [ebp - 0x34], 0xffffffff
nop dword [eax + eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x4048d0
lea eax, [ebp - 0x6c]
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 0x404b86
push dword [ebp - 0x5c]
lea ecx, [ebp - 0x14]
call fcn.00403700
mov eax, dword [ebp - 0x14]
mov dword [ebp - 4], 0
cmp dword [eax - 0xc], 0
jl 0x40496c
push 0x4df890
push eax
call fcn.004b87bc
mov ecx, eax
add esp, 8
test ecx, ecx
je 0x404969
mov eax, dword [ebp - 0x14]
sub ecx, eax
sar ecx, 1
cmp ecx, 0xffffffff
je 0x40496c
push ecx
lea eax, [ebp - 0x1c]
push eax
lea ecx, [ebp - 0x14]
call fcn.004057c0
push eax
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 1
call fcn.00403b80
mov edx, dword [ebp - 0x1c]
or eax, 0xffffffff
mov byte [ebp - 4], 0
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x404969
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x14]
push ebx
push 0
push dword [ebp - 0x54]
push eax
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpConnect]
test eax, eax
je 0x404b4f
xor ecx, ecx
mov esi, 0x1bb
cmp si, word [ebp - 0x54]
mov edx, 0x800000
cmove ecx, edx
push ecx
push 0
push 0
push 0
push dword [ebp - 0x40]
push 0x4df894
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov esi, eax
test esi, esi
jne 0x4049bd
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
jmp 0x404b4f
push 4
lea eax, [ebp - 0x2c]
mov dword [ebp - 0x2c], 0x3300
push eax
push 0x1f
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpSetOption]
test eax, eax
je 0x404b43
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 0x404b43
push 0
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
test eax, eax
je 0x404b43
push 0
lea eax, [ebp - 0x30]
mov dword [ebp - 0x28], 0
push eax
lea eax, [ebp - 0x28]
mov dword [ebp - 0x30], 4
push eax
push 0
push 0x20000005
xorps xmm0, xmm0
push esi
movlpd qword [ebp - 0x20], xmm0
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
test eax, eax
je 0x404b43
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 - 0x18], eax
cmp eax, 0xffffffff
je 0x404b43
lea eax, [ebp - 0x10]
mov dword [ebp - 0x10], 0
push eax
push 0x1000
lea eax, [ebp - 0x106c]
push eax
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpReadData]
test eax, eax
je 0x404b21
mov ebx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x404b21
push 0
lea ecx, [ebp - 0x24]
mov dword [ebp - 0x24], 0
push ecx
push eax
lea eax, [ebp - 0x106c]
push eax
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x404b3a
mov eax, dword [ebp - 0x1c]
add eax, dword [ebp - 0x24]
mov dword [ebp - 0x1c], eax
adc ebx, 0
cmp dword [ebp + 0x10], 0
mov dword [ebp - 0x10], ebx
je 0x404afb
mov ebx, dword [ebp - 0x28]
test ebx, ebx
je 0x404af8
push 0
push 0x64
push dword [ebp - 0x10]
push eax
call fcn.004b58d0
push 0
push ebx
push edx
push eax
call fcn.004b5820
mov ecx, dword [ebp + 0x10]
mov dword [ecx], eax
mov ebx, dword [ebp - 0x10]
lea eax, [ebp - 0x10]
mov dword [ebp - 0x10], 0
push eax
push 0x1000
lea eax, [ebp - 0x106c]
push eax
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpReadData]
test eax, eax
jne 0x404a93
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
mov esi, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
call esi
push edi
call esi
mov bl, 1
jmp 0x404b51
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
mov esi, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
call esi
push edi
call esi
xor bl, bl
mov eax, dword [ebp - 0x14]
or ecx, 0xffffffff
mov dword [ebp - 4], 0xffffffff
add eax, 0xfffffff0
lock xadd dword [eax + 0xc], ecx
dec ecx
test ecx, ecx
jg 0x404b73
mov ecx, dword [eax]
push eax
mov edx, dword [ecx]
call dword [edx + 4]
mov al, bl
pop ebx
pop edi
pop esi
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 edi
pop esi
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret