Function at 0x402c70
Capabilities:
Check if file exists
Download and write a file
Get http content length
Read data from internet
Receive and write data from server to client
Receive data
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xe8
mov eax, dword [0x5be984]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
xor bl, bl
mov dword [ebp - 0xdc], edi
mov esi, ecx
mov dword [ebp - 0xe0], eax
test edi, edi
je 0x40305e
test eax, eax
je 0x40305e
mov ecx, dword [esi + 4]
test ecx, ecx
je 0x402cbd
mov eax, dword [ecx]
push 0x573ff0
call dword [eax + 4]
push 0
lea eax, [ebp - 0xe8]
mov dword [ebp - 0xd8], 0
push eax
lea eax, [ebp - 0xd8]
mov dword [ebp - 0xe8], 4
push eax
push 0x20000005
push edi
xor bl, bl
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
test eax, eax
movzx ebx, bl
mov ecx, 1
cmovne ebx, ecx
mov ecx, dword [esi + 4]
mov dword [ebp - 0xd0], ebx
test ecx, ecx
je 0x402d1b
mov edx, dword [ecx]
or eax, 0xffffffff
test bl, bl
cmovne eax, dword [ebp - 0xd8]
push eax
call dword [edx + 0x10]
xor edi, edi
mov dword [ebp - 0xd4], edi
cmp dword [ebp + 0x10], edi
je 0x402f48
push dword [ebp - 0xe0]
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x402f48
push 0x574020
push dword [ebp - 0xe0]
lea eax, [ebp - 0xd4]
push eax
call fcn.004fb202
add esp, 0xc
test eax, eax
jne 0x402de8
mov eax, dword [ebp - 0xd4]
test eax, eax
je 0x403053
push 2
push edi
push eax
call fcn.0050cd46
push dword [ebp - 0xd4]
call fcn.0050d37c
add esp, 0x10
mov ebx, eax
cmp byte [ebp - 0xd0], 0
je 0x402da4
cmp ebx, dword [ebp - 0xd8]
je 0x403045
jae 0x402efe
push 0
push 0
push 0
push ebx
push dword [ebp - 0xdc]
call dword [sym.imp.WININET.dll_InternetSetFilePointer]
test eax, eax
jne 0x402ecd
mov ecx, dword [esi + 4]
test ecx, ecx
je 0x402dd0
mov eax, dword [ecx]
push 0x574028
call dword [eax + 4]
push 0
push 0
push dword [ebp - 0xd4]
call fcn.0050cd46
add esp, 0xc
mov ebx, dword [ebp - 0xd0]
cmp dword [ebp - 0xd4], 0
je 0x403053
mov ecx, dword [esi + 4]
test ecx, ecx
je 0x402e06
mov eax, dword [ecx]
push 0x573e58
call dword [eax + 4]
mov eax, dword [esi + 8]
test bl, bl
je 0x402f9d
mov ebx, dword [ebp - 0xd8]
cmp ebx, eax
cmova ebx, eax
push ebx
call fcn.0048460a
mov ecx, eax
add esp, 4
mov dword [ebp - 0xd0], ecx
test ecx, ecx
je 0x403045
mov eax, dword [ebp - 0xd8]
sub eax, edi
mov dword [ebp - 0xe4], 0
mov dword [ebp - 0xd8], eax
je 0x402f97
cmp eax, ebx
lea edx, [ebp - 0xe4]
push edx
cmova eax, ebx
push eax
push ecx
push dword [ebp - 0xdc]
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x402f80
push dword [ebp - 0xd4]
mov eax, dword [ebp - 0xe4]
add edi, eax
sub dword [ebp - 0xd8], eax
push eax
push 1
push dword [ebp - 0xd0]
call fcn.0050d63e
mov ecx, dword [esi + 4]
add esp, 0x10
test ecx, ecx
je 0x402ebd
mov eax, dword [ecx]
push edi
call dword [eax + 0xc]
mov ecx, dword [esi + 4]
test ecx, ecx
je 0x402ebd
mov eax, dword [ecx]
mov eax, dword [eax + 0x18]
call eax
test al, al
jne 0x402f67
mov eax, dword [ebp - 0xd8]
test eax, eax
mov ecx, dword [ebp - 0xd0]
jmp 0x402e4d
push ebx
push 0x574050
lea eax, [ebp - 0xcc]
push 0x64
push eax
call fcn.00404ae0
mov ecx, dword [esi + 4]
add esp, 0x10
test ecx, ecx
je 0x402ef7
mov eax, dword [ecx]
lea edx, [ebp - 0xcc]
push edx
call dword [eax + 4]
mov edi, ebx
jmp 0x402de2
push dword [ebp - 0xd4]
call fcn.0050c934
mov ebx, dword [ebp - 0xe0]
add esp, 4
mov dword [ebp - 0xd4], edi
push 0x24
push 0x574070
push ebx
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
cmp eax, 6
jne 0x402de2
push 0x574084
lea eax, [ebp - 0xd4]
push ebx
push eax
call fcn.004fb202
jmp 0x402ddf
push 0x574084
push dword [ebp - 0xe0]
lea eax, [ebp - 0xd4]
push eax
call fcn.004fb202
add esp, 0xc
jmp 0x402de8
mov ecx, dword [esi + 4]
push 0x57409c
mov eax, dword [ecx]
call dword [eax + 4]
mov ecx, dword [ebp - 0xd0]
push ecx
jmp 0x40303d
mov ecx, dword [esi + 4]
test ecx, ecx
je 0x402f91
mov eax, dword [ecx]
push 0x57408c
call dword [eax + 4]
mov ecx, dword [ebp - 0xd0]
push ecx
jmp 0x40303d
push eax
mov dword [ebp - 0xd0], 0
call fcn.0048460a
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x403045
lea eax, [ebp - 0xd0]
push eax
push dword [esi + 8]
push ebx
push dword [ebp - 0xdc]
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x40303c
mov eax, dword [ebp - 0xd0]
test eax, eax
je 0x40303c
push dword [ebp - 0xd4]
push eax
push 1
push ebx
call fcn.0050d63e
add edi, dword [ebp - 0xd0]
add esp, 0x10
mov ecx, dword [esi + 4]
test ecx, ecx
je 0x403012
mov eax, dword [ecx]
push edi
call dword [eax + 0xc]
mov ecx, dword [esi + 4]
mov eax, dword [ecx]
mov eax, dword [eax + 0x18]
call eax
test al, al
jne 0x40302f
lea eax, [ebp - 0xd0]
push eax
push dword [esi + 8]
push ebx
push dword [ebp - 0xdc]
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
jne 0x402fd5
jmp 0x40303c
mov ecx, dword [esi + 4]
push 0x57409c
mov eax, dword [ecx]
call dword [eax + 4]
push ebx
call fcn.00484613
add esp, 4
push dword [ebp - 0xd4]
call fcn.0050c934
add esp, 4
mov eax, dword [ebp - 0xe0]
test edi, edi
setne bl
mov ecx, dword [esi + 4]
test ecx, ecx
je 0x40306f
mov esi, dword [ecx]
movzx edx, bl
push edx
push eax
call dword [esi + 0x14]
mov ecx, dword [ebp - 4]
mov al, bl
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00484a0d
mov esp, ebp
pop ebp
ret 0xc