Function at 0x4119f4
Capabilities:
Check http status code
Clear file content
Copy file
Receive http response
Set http header
Write file on windows

Disassembly:
push 0x40
mov eax, 0x4675cd
call fcn.0043d28e
mov ebx, ecx
mov dword [ebp - 0x3c], ebx
xor eax, eax
mov edi, eax
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x2c], edi
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x48], eax
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x4c], eax
mov dword [ebp - 0x38], eax
call fcn.0041229d
mov esi, eax
mov dword [ebp - 0x40], esi
test esi, esi
jne 0x411a57
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
call edi
mov esi, eax
push esi
push str.InternetGetRequestEx_:_Error_occured_while_creating_the_file______d
mov dword [ebp - 0x38], esi
call fcn.004064a1
push esi
push str.printErrorMsgForID:_Errorcode:__d
call fcn.004064a1
add esp, 0x10
jmp 0x4120df
cmp dword [ebx + 0x4c], edi
jbe 0x4120cb
cmp dword [ebx], 0
mov esi, dword [ebp - 0x24]
je 0x411b3e
lea eax, [ebp - 0x20]
push eax
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
test edi, edi
lea eax, [edi + 1]
push 0x64
cmove eax, esi
lea ecx, [ebp - 0x28]
pop edx
mov dword [ebp - 0x24], eax
lea esi, [edi + 0x7a120]
call fcn.0040f68b
push esi
push dword [ebp - 0x24]
mov esi, dword [ebp - 0x28]
push str.Range:_bytes_u__u
push esi
call fcn.0040f602
push esi
push str.InternetGetRequestByBitrate:_Content_Range_Header_message:__s
call fcn.004064a1
mov eax, dword [ebx + 0x80]
add esp, 0x18
test eax, eax
je 0x411aca
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
and dword [ebx + 0x80], 0
mov ecx, ebx
call fcn.00410647
test eax, eax
je 0x411add
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x411b2b
test esi, esi
je 0x411b0f
push 0x20000000
push 0xffffffffffffffff
push esi
push dword [ebx + 0x80]
call dword [sym.imp.WINHTTP.dll_WinHttpAddRequestHeaders]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x411b15
call edi
mov esi, eax
push esi
call fcn.0040f9b2
test esi, esi
je 0x411b15
jmp 0x411b2b
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, ebx
call fcn.004111e2
test eax, eax
jne 0x411b2b
mov ecx, ebx
call fcn.004114e8
test eax, eax
je 0x411b3b
call edi
mov ecx, dword [ebp - 0x24]
mov dword [ebp - 0x24], ecx
test eax, eax
jne 0x411cc5
mov edi, dword [ebp - 0x2c]
cmp dword [ebx + 8], 0xc8
je 0x411b54
cmp dword [ebx + 8], 0xce
jne 0x411da6
and dword [ebp - 0x48], 0
lea eax, [ebp - 0x48]
push eax
push dword [ebx + 0x80]
call dword [sym.imp.WINHTTP.dll_WinHttpQueryDataAvailable]
test eax, eax
je 0x411ff0
mov eax, dword [ebp - 0x48]
test eax, eax
je 0x411c9d
inc eax
push eax
push 2
call fcn.00443bcc
pop ecx
pop ecx
mov edi, eax
lea eax, [ebp - 0x44]
push eax
push dword [ebp - 0x48]
push edi
push dword [ebx + 0x80]
call dword [sym.imp.WINHTTP.dll_WinHttpReadData]
test eax, eax
je 0x411f30
mov eax, dword [ebp - 0x2c]
add eax, dword [ebp - 0x44]
cmp dword [ebp - 0x44], 0
mov dword [ebp - 0x2c], eax
je 0x411c6e
cmp dword [ebx + 0x24], 4
jne 0x411c56
mov esi, dword [ebp - 0x40]
push esi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push 0
lea eax, [ebp - 0x4c]
push eax
push dword [ebp - 0x44]
push edi
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x411e70
cmp dword [ebx + 0x74], 0
mov edi, dword [ebp - 0x2c]
je 0x411c93
mov ecx, dword [ebx + 0x4c]
mov eax, edi
movd xmm1, edi
cvtdq2pd xmm1, xmm1
shr eax, 0x1f
mov dword [ebx + 0x88], ecx
mov dword [ebx + 0x8c], edi
movd xmm0, ecx
addsd xmm1, qword [eax*8 + 0x487d10]
cvtdq2pd xmm0, xmm0
shr ecx, 0x1f
mulsd xmm1, qword [0x487d00]
addsd xmm0, qword [ecx*8 + 0x487d10]
divsd xmm1, xmm0
cvttsd2si eax, xmm1
movzx ecx, ax
shl ecx, 0x10
movzx eax, di
or ecx, eax
push ecx
push 0
push dword [ebx + 0x78]
push dword [ebx + 0x74]
call dword [sym.imp.USER32.dll_PostMessageW]
jmp 0x411c93
push edi
lea ecx, [ebx + 0xc]
call fcn.004125dd
push 0x479a58
lea ecx, [ebx + 0xc]
call fcn.004125dd
jmp 0x411c90
mov eax, dword [ebx + 0xc]
lea ecx, [ebx + 0xc]
mov esi, dword [eax - 0xc]
lea edi, [esi + 1]
push edi
call fcn.00404cd1
push edi
lea ecx, [ebx + 0xc]
mov byte [eax + esi], 0
call fcn.00404cab
mov ebx, dword [ebp - 0x3c]
mov edi, dword [ebp - 0x2c]
cmp dword [ebp - 0x44], 0
jne 0x411b54
cmp dword [ebx], 0
je 0x411cb7
lea eax, [ebp - 0x20]
push eax
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
push 0x258
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp edi, dword [ebx + 0x4c]
jb 0x411a60
jmp 0x4120c8
call edi
push ecx
mov edi, eax
mov dword [ebp - 0x3c], esp
mov ecx, esp
mov dword [ebp - 0x38], edi
push str.HttpSendRangeRequest
call fcn.004042c5
and dword [ebp - 4], 0
push ecx
mov ecx, esp
push str.HttpReadResponseData
call fcn.004042c5
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x24]
mov edx, edi
call fcn.004098c9
add esp, 4
mov dword [ebp - 4], 1
mov ecx, esp
mov dword [ebp - 0x3c], esp
push 0x47ea50
call fcn.004042c5
push ecx
mov byte [ebp - 4], 2
mov ecx, esp
mov dword [ebp - 0x28], esp
push 0x479a58
call fcn.004042c5
push ecx
mov byte [ebp - 4], 3
mov esi, esp
mov dword [ebp - 0x30], esi
mov eax, dword [ebp - 0x24]
add eax, 0xfffffff0
mov dword [ebp - 0x2c], esp
push eax
call fcn.00404a80
add eax, 0x10
mov dword [esi], eax
mov byte [ebp - 4], 4
mov ecx, esp
mov dword [ebp - 0x30], esp
push str.WIN_ELEC_HTTP_READRESPONSEDATA
call fcn.004042c5
push ecx
mov ecx, esp
mov byte [ebp - 4], 5
push str.TRACK_FEATURE
call fcn.004042c5
mov byte [ebp - 4], 1
call fcn.00406f9d
mov eax, dword [ebp - 0x24]
add esp, 0x14
cmp dword [eax - 4], 1
jle 0x411d8d
push dword [eax - 0xc]
lea ecx, [ebp - 0x24]
call fcn.00404809
mov eax, dword [ebp - 0x24]
push eax
call fcn.004064a1
pop ecx
push edi
call fcn.0040f9b2
or dword [ebp - 4], 0xffffffff
mov ecx, dword [ebp - 0x24]
jmp 0x4120c0
push dword [ebx + 8]
push str.InternetGetRequestByBitrate_:_Failed_with_the_http_status_code__d
call fcn.004064a1
mov esi, dword [ebx + 8]
add esp, 4
mov ecx, esp
mov dword [ebp - 0x34], esp
push str.Status_code
call fcn.004042c5
push ecx
mov ecx, esp
mov dword [ebp - 4], 0x18
push str.HttpReadResponseData
call fcn.004042c5
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x28]
mov edx, esi
call fcn.004098c9
add esp, 4
mov dword [ebp - 4], 0x19
mov ecx, esp
mov dword [ebp - 0x34], esp
push 0x47ea50
call fcn.004042c5
push ecx
mov byte [ebp - 4], 0x1a
mov ecx, esp
mov dword [ebp - 0x30], esp
push 0x479a58
call fcn.004042c5
push ecx
mov byte [ebp - 4], 0x1b
mov esi, esp
mov dword [ebp - 0x24], esi
mov eax, dword [ebp - 0x28]
add eax, 0xfffffff0
mov dword [ebp - 0x3c], esp
push eax
call fcn.00404a80
add eax, 0x10
mov dword [esi], eax
mov byte [ebp - 4], 0x1c
mov ecx, esp
mov dword [ebp - 0x24], esp
push str.WIN_ELEC_HTTP_READRESPONSEDATA
call fcn.004042c5
push ecx
mov ecx, esp
mov byte [ebp - 4], 0x1d
push str.TRACK_FEATURE
call fcn.004042c5
mov byte [ebp - 4], 0x19
call fcn.00406f9d
add esp, 0x14
push 0xd
pop eax
mov dword [ebp - 0x38], eax
jmp 0x4120b9
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
push edi
push str.InternetGetRequestByBitrate_:_Error_occured_in_WriteFile______d
mov dword [ebp - 0x38], edi
call fcn.00406531
pop ecx
mov ecx, esp
mov dword [ebp - 0x34], esp
push str.InternetGetRequestByBitrate_:_WriteFile
call fcn.004042c5
push ecx
mov ecx, esp
mov dword [ebp - 4], 0x12
push str.HttpReadResponseData
call fcn.004042c5
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x28]
mov edx, edi
call fcn.004098c9
add esp, 4
mov dword [ebp - 4], 0x13
mov ecx, esp
mov dword [ebp - 0x34], esp
push 0x47ea50
call fcn.004042c5
push ecx
mov byte [ebp - 4], 0x14
mov ecx, esp
mov dword [ebp - 0x30], esp
push 0x479a58
call fcn.004042c5
push ecx
mov byte [ebp - 4], 0x15
mov esi, esp
mov dword [ebp - 0x24], esi
mov eax, dword [ebp - 0x28]
add eax, 0xfffffff0
mov dword [ebp - 0x3c], esp
push eax
call fcn.00404a80
add eax, 0x10
mov dword [esi], eax
mov byte [ebp - 4], 0x16
mov ecx, esp
mov dword [ebp - 0x24], esp
push str.WIN_ELEC_HTTP_READRESPONSEDATA
call fcn.004042c5
push ecx
mov ecx, esp
mov byte [ebp - 4], 0x17
push str.TRACK_FEATURE
call fcn.004042c5
mov byte [ebp - 4], 0x13
jmp 0x4120ab
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
push edi
push str.InternetGetRequestByBitrate_:_Error_occured_in_WinHttpReadData______d
mov dword [ebp - 0x38], edi
call fcn.00406531
pop ecx
mov ecx, esp
mov dword [ebp - 0x34], esp
push str.InternetGetRequestByBitrate_:_WinHttpReadData
call fcn.004042c5
push ecx
mov ecx, esp
mov dword [ebp - 4], 0xc
push str.HttpReadResponseData
call fcn.004042c5
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x28]
mov edx, edi
call fcn.004098c9
add esp, 4
mov dword [ebp - 4], 0xd
mov ecx, esp
mov dword [ebp - 0x34], esp
push 0x47ea50
call fcn.004042c5
push ecx
mov byte [ebp - 4], 0xe
mov ecx, esp
mov dword [ebp - 0x30], esp
push 0x479a58
call fcn.004042c5
push ecx
mov byte [ebp - 4], 0xf
mov esi, esp
mov dword [ebp - 0x24], esi
mov eax, dword [ebp - 0x28]
add eax, 0xfffffff0
mov dword [ebp - 0x3c], esp
push eax
call fcn.00404a80
add eax, 0x10
mov dword [esi], eax
mov byte [ebp - 4], 0x10
mov ecx, esp
mov dword [ebp - 0x24], esp
push str.WIN_ELEC_HTTP_READRESPONSEDATA
call fcn.004042c5
push ecx
mov ecx, esp
mov byte [ebp - 4], 0x11
push str.TRACK_FEATURE
call fcn.004042c5
mov byte [ebp - 4], 0xd
jmp 0x4120ab
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
push edi
push str.InternetGetRequestByBitrate_:_Error_occured_in_WinHttpQueryDataAvailable______d
mov dword [ebp - 0x38], edi
call fcn.004064a1
pop ecx
mov ecx, esp
mov dword [ebp - 0x34], esp
push str.InternetGetRequestByBitrate_:_WinHttpQueryDataAvailable
call fcn.004042c5
push ecx
mov ecx, esp
mov dword [ebp - 4], 6
push str.HttpReadResponseData
call fcn.004042c5
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x28]
mov edx, edi
call fcn.004098c9
add esp, 4
mov dword [ebp - 4], 7
mov ecx, esp
mov dword [ebp - 0x34], esp
push 0x47ea50
call fcn.004042c5
push ecx
mov byte [ebp - 4], 8
mov ecx, esp
mov dword [ebp - 0x30], esp
push 0x479a58
call fcn.004042c5
push ecx
mov byte [ebp - 4], 9
mov esi, esp
mov dword [ebp - 0x24], esi
mov eax, dword [ebp - 0x28]
add eax, 0xfffffff0
mov dword [ebp - 0x3c], esp
push eax
call fcn.00404a80
add eax, 0x10
mov dword [esi], eax
mov byte [ebp - 4], 0xa
mov ecx, esp
mov dword [ebp - 0x24], esp
push str.WIN_ELEC_HTTP_READRESPONSEDATA
call fcn.004042c5
push ecx
mov ecx, esp
mov byte [ebp - 4], 0xb
push str.TRACK_FEATURE
call fcn.004042c5
mov byte [ebp - 4], 7
call fcn.00406f9d
add esp, 0x14
push edi
call fcn.0040f9b2
or dword [ebp - 4], 0xffffffff
mov ecx, dword [ebp - 0x28]
lea ecx, [ecx - 0x10]
call fcn.00401696
mov esi, dword [ebp - 0x40]
push esi
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
cmp dword [ebx + 0x24], 4
mov ecx, dword [ebx + 0x40]
jne 0x41228e
push 0
push dword [ebx + 0x3c]
push ecx
call dword [sym.imp.KERNEL32.dll_CopyFileW]
cmp eax, 1
je 0x4121cd
call edi
mov ebx, eax
push ebx
push str.InternetGetRequestEx_:_could_nt_copy_from_.tmp_file__errorcode______d
call fcn.004064a1
pop ecx
mov ecx, esp
mov dword [ebp - 0x34], esp
push str.InternetGetRequestEx___CopyFile:_couldnt_copy_from_.tmp_file
call fcn.004042c5
push ecx
mov ecx, esp
mov dword [ebp - 4], 0x1e
push str.HttpReadResponseData
call fcn.004042c5
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x28]
mov edx, ebx
call fcn.004098c9
add esp, 4
mov dword [ebp - 4], 0x1f
mov ecx, esp
mov dword [ebp - 0x34], esp
push 0x47ea50
call fcn.004042c5
push ecx
mov byte [ebp - 4], 0x20
mov ecx, esp
mov dword [ebp - 0x30], esp
push 0x479a58
call fcn.004042c5
push ecx
mov byte [ebp - 4], 0x21
mov esi, esp
mov dword [ebp - 0x24], esi
mov eax, dword [ebp - 0x28]
add eax, 0xfffffff0
mov dword [ebp - 0x3c], esp
push eax
call fcn.00404a80
add eax, 0x10
mov dword [esi], eax
mov byte [ebp - 4], 0x22
mov ecx, esp
mov dword [ebp - 0x24], esp
push str.WIN_ELEC_HTTP_READRESPONSEDATA
call fcn.004042c5
push ecx
mov ecx, esp
mov byte [ebp - 4], 0x23
push str.TRACK_FEATURE
call fcn.004042c5
mov byte [ebp - 4], 0x1f
call fcn.00406f9d
mov ecx, dword [ebp - 0x28]
add esp, 0x14
lea ecx, [ecx - 0x10]
call fcn.00401696
jmp 0x412295
push dword [ebx + 0x3c]
push dword [ebx + 0x28]
push str.InternetGetRequestEx_:_Successfully_downloaded_the_file_from_the_server__s_to_the_destination_file__s
call fcn.004064a1
add esp, 0xc
lea ecx, [ebp - 0x28]
call fcn.0040431c
mov dword [ebp - 4], 0x24
lea eax, [ebp - 0x28]
push dword [ebx + 0x3c]
push dword [ebx + 0x28]
push dword [ebx + 0x34]
push str.InternetGetRequestEx:_Successfully_downloaded_the_file__s_from_the_server__s_to_the_destination_file__s
push eax
call fcn.00404e31
add esp, 0x10
mov ecx, esp
mov dword [ebp - 0x34], esp
push 0x47ea50
call fcn.004042c5
push ecx
mov byte [ebp - 4], 0x25
mov ecx, esp
mov dword [ebp - 0x30], esp
push 0x479a58
call fcn.004042c5
push ecx
mov byte [ebp - 4], 0x26
mov esi, esp
mov dword [ebp - 0x24], esi
mov edi, dword [ebp - 0x28]
add edi, 0xfffffff0
mov dword [ebp - 0x3c], esp
push edi
call fcn.00404a80
add eax, 0x10
mov dword [esi], eax
mov byte [ebp - 4], 0x27
mov ecx, esp
mov dword [ebp - 0x24], esp
push str.WIN_ELEC_HTTP_READRESPONSEDATA
call fcn.004042c5
push ecx
mov ecx, esp
mov byte [ebp - 4], 0x28
push str.TRACK_FEATURE
call fcn.004042c5
mov byte [ebp - 4], 0x24
call fcn.00406f9d
push dword [ebx + 0x40]
call fcn.0044afc4
add esp, 0x18
mov ecx, edi
call fcn.00401696
mov ebx, dword [ebp - 0x38]
jmp 0x412295
call fcn.0040f6af
mov ebx, eax
mov eax, ebx
call fcn.0043d23d
ret