Function at 0x477960
Capabilities:
Check http status code
Connect to http server
Create http request
Delete file
Download and write a file
Read data from internet
Receive and write data from server to client
Receive data
Send data
Send http request
Write file on windows

Disassembly:
push 0x58
mov eax, 0x5bbe39
call fcn.0058ec2b
xor ebx, ebx
mov dword [ebp - 4], ebx
push ebx
push ebx
push ebx
push ebx
push 0x6810b8
mov byte [ebp - 0xd], bl
call dword [sym.imp.WININET.dll_InternetOpenW]
mov ecx, eax
mov dword [ebp - 0x40], ecx
mov dword [ebp - 0x50], ecx
mov byte [ebp - 4], 1
cmp ecx, ebx
je 0x477e2c
mov eax, dword [ebp + 0x10]
mov eax, dword [eax]
push ebx
push ebx
push 3
push ebx
push ebx
push dword [ebp + 0x30]
push eax
push ecx
call dword [sym.imp.WININET.dll_InternetConnectW]
mov ecx, eax
mov dword [ebp - 0x3c], ecx
mov dword [ebp - 0x54], ecx
mov byte [ebp - 4], 2
cmp ecx, ebx
je 0x477e1a
mov eax, dword [ebp + 0x14]
mov eax, dword [eax]
push ebx
push 0x8400f200
push ebx
push ebx
push ebx
push eax
push ebx
push ecx
call dword [sym.imp.WININET.dll_HttpOpenRequestW]
mov esi, eax
mov dword [ebp - 0x20], esi
mov dword [ebp - 0x58], esi
mov byte [ebp - 4], 3
cmp esi, ebx
je 0x477e0b
push ebx
push ebx
push ebx
push ebx
push esi
call dword [sym.imp.WININET.dll_HttpSendRequestW]
test eax, eax
je 0x477e0b
push 0x13
lea edi, [ebp - 0x38]
mov dword [ebp - 0x38], esi
call fcn.004214d1
pop ecx
cmp eax, 0x191
jne 0x477a5b
mov eax, dword [ebp + 0x1c]
mov eax, dword [eax]
mov ecx, dword [eax - 0xc]
mov edi, dword [sym.imp.WININET.dll_InternetSetOptionW]
inc ecx
push ecx
push eax
push 0x1c
push esi
call edi
mov eax, dword [ebp + 0x20]
mov eax, dword [eax]
mov ecx, dword [eax - 0xc]
inc ecx
push ecx
push eax
push 0x1d
push esi
call edi
push ebx
push ebx
push ebx
push ebx
push esi
call dword [sym.imp.WININET.dll_HttpSendRequestW]
test eax, eax
je 0x477e0b
push 0x13
lea edi, [ebp - 0x38]
mov dword [ebp - 0x38], esi
call fcn.004214d1
pop ecx
cmp eax, 0xc8
jne 0x477e52
push 5
lea edi, [ebp - 0x38]
mov dword [ebp - 0x38], esi
call fcn.004214d1
cmp eax, ebx
pop ecx
mov dword [ebp - 0x24], eax
jle 0x477e0b
mov eax, dword [ebp + 0x28]
mov eax, dword [eax - 0xc]
cmp eax, ebx
je 0x477aef
push dword [ebp - 0x24]
lea eax, [ebp - 0x30]
push eax
call fcn.004888f0
mov edi, eax
mov byte [ebp - 4], 4
lea eax, [ebp - 0x34]
push 0x6880e0
push eax
lea ecx, [ebp + 0x28]
call fcn.004116ea
mov byte [ebp - 4], 5
lea ecx, [ebp - 0x38]
push edi
push ecx
mov esi, eax
call fcn.0041691a
add esp, 0x18
mov byte [ebp - 4], 6
lea edi, [ebp + 0x28]
call fcn.00408619
mov byte [ebp - 4], 5
lea ecx, [ebp - 0x38]
call fcn.004085f6
mov byte [ebp - 4], 4
lea ecx, [ebp - 0x34]
call fcn.004085f6
mov byte [ebp - 4], 3
lea ecx, [ebp - 0x30]
call fcn.004085f6
mov eax, dword [ebp + 0x18]
mov eax, dword [eax]
mov edi, dword [sym.imp.KERNEL32.dll_CreateFileW]
push ebx
push ebx
push 2
push ebx
push 1
mov esi, 0x40000000
push esi
push eax
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x30], ebx
call edi
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x5c], eax
mov byte [ebp - 4], 7
cmp eax, 0xffffffff
je 0x477ddb
mov eax, dword [ebp + 0x28]
cmp dword [eax - 0xc], ebx
je 0x477c88
push eax
lea eax, [ebp - 0x28]
push eax
call fcn.004877b0
pop ecx
pop ecx
mov byte [ebp - 4], 8
mov eax, dword [ebp - 0x28]
cmp dword [eax], ebx
je 0x477bee
mov ecx, dword [eax + 4]
cmp ecx, ebx
je 0x477bee
cmp dword [0x6c438c], 1
jl 0x477b76
push ecx
push str.Resume_buffer_found____i
push str.downloadFile
push 1
call fcn.00540a02
mov eax, dword [ebp - 0x28]
add esp, 0x10
mov ecx, dword [ebp - 0x24]
cmp dword [eax + 4], ecx
jbe 0x477ba6
cmp dword [0x6c438c], 1
jl 0x477b9b
push str.Resume_buffer_too_big
push str.downloadFile
push 1
call fcn.00540a02
add esp, 0xc
push dword [ebp + 0x28]
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
jmp 0x477bee
mov ecx, dword [eax + 4]
push ebx
lea edx, [ebp - 0x34]
push edx
mov dword [ebp - 0x34], ecx
mov eax, dword [eax]
push ecx
push eax
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x477bca
mov eax, dword [ebp - 0x34]
mov dword [ebp - 0x18], eax
jmp 0x477bee
cmp dword [0x6c438c], 1
jl 0x477bee
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Resume_buffer___unable_to_save____i
push str.downloadFile
push 1
call fcn.00540a02
add esp, 0x10
mov byte [ebp - 4], 7
lea ebx, [ebp - 0x28]
call fcn.004170a7
xor ebx, ebx
cmp dword [ebp - 0x18], ebx
jle 0x477c86
push dword [ebp - 0x18]
lea eax, [ebp - 0x2c]
push str.Range:_bytes_i__r_n
push eax
push 0x32
pop ecx
call fcn.00489120
add esp, 0xc
mov byte [ebp - 4], 9
mov eax, dword [ebp - 0x2c]
mov ecx, dword [eax - 0xc]
push 0xa0000000
push ecx
push eax
push dword [ebp - 0x20]
call dword [sym.imp.WININET.dll_HttpAddRequestHeadersW]
push ebx
push ebx
push ebx
push ebx
push dword [ebp - 0x20]
call dword [sym.imp.WININET.dll_HttpSendRequestW]
test eax, eax
jne 0x477c7a
cmp dword [0x6c438c], 1
jl 0x477c6b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Unable_to_set_byte_range____i
push str.downloadFile
push 1
call fcn.00540a02
add esp, 0x10
push ebx
push ebx
push ebx
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [ebp - 0x18], ebx
mov byte [ebp - 4], 7
lea ecx, [ebp - 0x2c]
call fcn.004085f6
xor ebx, ebx
push ebx
push ebx
push 4
push ebx
push 1
push esi
push dword [ebp + 0x28]
call edi
mov esi, eax
mov dword [ebp - 0x60], esi
mov byte [ebp - 4], 0xa
push ebx
push ebx
push dword [ebp - 0x18]
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [ebp - 0x14], ebx
mov edi, 0x10000
lea ebx, [ebp - 0x38]
call fcn.0042c18f
mov byte [ebp - 4], 0xb
mov edi, dword [ebp - 0x38]
mov ebx, dword [sym.imp.WININET.dll_InternetReadFile]
jmp 0x477d9c
cmp dword [ebp - 0x14], 0
je 0x477db4
mov eax, dword [edi]
push 0
lea ecx, [ebp - 0x14]
push ecx
push dword [ebp - 0x14]
push eax
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x477db4
cmp esi, 0xffffffff
je 0x477d0e
mov eax, dword [ebp - 0x14]
push 0
lea ecx, [ebp - 0x44]
push ecx
push eax
mov dword [ebp - 0x44], eax
push dword [edi]
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebp - 0x30]
add eax, dword [ebp - 0x14]
cmp byte [ebp + 0x2c], 0
mov dword [ebp - 0x30], eax
je 0x477d9c
fild dword [ebp - 0x24]
mov ecx, dword [ebp - 0x18]
add eax, ecx
mov dword [ebp - 0x44], eax
fstp dword [ebp - 0x48]
mov dword [ebp - 0x4c], eax
fild dword [ebp - 0x44]
test eax, eax
jge 0x477d3b
fadd dword [0x6932c8]
fstp dword [ebp - 0x44]
fld dword [ebp - 0x44]
fdiv dword [ebp - 0x48]
fmul qword [0x6932a8]
call fcn.00586df0
push eax
push 0x6ddcac
call dword [sym.imp.KERNEL32.dll_InterlockedExchange]
lea eax, [ebp - 0x2c]
push eax
call fcn.0040855f
mov byte [ebp - 4], 0xc
mov eax, dword [ebp + 8]
push 0xf
push dword [ebp + 0xc]
push dword [ebp - 0x24]
push dword [ebp - 0x4c]
push dword [eax]
lea eax, [ebp - 0x2c]
push str.Downloading__s_database____i_bytes_from__i_file__i_from__i_
call fcn.004310f7
push dword [ebp - 0x2c]
call fcn.00465d85
add esp, 0x1c
mov byte [ebp - 4], 0xb
lea ecx, [ebp - 0x2c]
call fcn.004085f6
mov eax, dword [edi + 4]
mov ecx, dword [edi]
lea edx, [ebp - 0x14]
push edx
push eax
push ecx
push dword [ebp - 0x20]
call ebx
test eax, eax
jne 0x477ccc
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
mov byte [ebp - 4], 0xa
lea ebx, [ebp - 0x38]
call fcn.004170a7
mov byte [ebp - 4], 7
cmp esi, 0xffffffff
je 0x477dd9
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor ebx, ebx
mov eax, dword [ebp - 0x30]
mov ecx, dword [ebp - 0x18]
add eax, ecx
cmp eax, dword [ebp - 0x24]
jne 0x477df5
push dword [ebp + 0x28]
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov byte [ebp - 0xd], 1
mov byte [ebp - 4], 3
cmp dword [ebp - 0x1c], 0xffffffff
je 0x477e08
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [ebp - 0x20]
mov byte [ebp - 4], 2
cmp esi, ebx
je 0x477e1a
push esi
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov byte [ebp - 4], 1
cmp dword [ebp - 0x3c], ebx
je 0x477e2c
push dword [ebp - 0x3c]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov byte [ebp - 4], bl
cmp dword [ebp - 0x40], ebx
je 0x477e3d
push dword [ebp - 0x40]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp + 0x28]
call fcn.004085f6
mov al, byte [ebp - 0xd]
call fcn.0058ed03
ret
cmp eax, 0x194
jne 0x477e0b
mov eax, dword [ebp + 0x24]
mov byte [eax], 1
jmp 0x477e0b