Function at 0x409800
Capabilities:
Create http request
Delete file
Download and write a file
Get file size
Read data from internet
Receive and write data from server to client
Receive data
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x531874
mov eax, dword fs:[0]
push eax
sub esp, 0x66c
mov eax, dword [0x5bc684]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 0x18]
mov esi, dword [ebp + 8]
mov edi, dword [ebp + 0xc]
mov ebx, dword [ebp + 0x14]
mov dword [ebp - 0x658], eax
mov eax, 6
mov dword [ebp - 0x62c], eax
test esi, esi
je 0x409f16
test edi, edi
je 0x409f16
cmp dword [ebp + 0x10], 0
jle 0x409f16
mov ecx, dword [0x5bbfe4]
mov dword [ebp - 0x638], ecx
mov dword [ebp - 4], 0
push 0x54f15a
lea ecx, [ebp - 0x638]
call fcn.004bfc00
push 0
push 0xe00b
lea ecx, [ebp - 0x638]
call fcn.004c1150
mov dword [ebp - 4], 1
mov edx, dword [ebp - 0x638]
push 0
push 0
push 0
push 0
push edx
call dword [sym.imp.WININET.dll_InternetOpenA]
mov dword [ebp - 0x65c], eax
test eax, eax
je 0x409efe
cmp dword [ebp + 0x10], 0
mov dword [ebp - 0x644], 0
jle 0x409ef1
sub esi, edi
mov dword [ebp - 0x624], edi
mov dword [ebp - 0x678], esi
push 0xff
lea eax, [ebp - 0x51f]
push 0
push eax
mov byte [ebp - 0x520], 0
call fcn.004ff6f0
push 0xff
lea ecx, [ebp - 0x61f]
push 0
push ecx
mov byte [ebp - 0x620], 0
call fcn.004ff6f0
push 0x103
lea edx, [ebp - 0x113]
push 0
push edx
mov byte [ebp - 0x114], 0
call fcn.004ff6f0
mov edx, dword [ebp - 0x624]
lea eax, [ebp - 0x520]
push eax
lea ecx, [ebp - 0x620]
push ecx
push 0
push 0
push edx
call fcn.004ff982
lea eax, [ebp - 0x520]
push eax
lea ecx, [ebp - 0x620]
push ecx
push 0
lea edx, [ebp - 0x114]
push 0
push edx
call fcn.004ff76a
add esp, 0x4c
test ebx, ebx
je 0x4099a2
lea eax, [ebp - 0x114]
push eax
lea esi, [ebx + 0x224]
push esi
mov ecx, ebx
call fcn.004c2c40
mov edi, dword [ebp - 0x658]
test edi, edi
je 0x4099a8
push 1
push esi
mov ecx, ebx
call fcn.004c3140
jmp 0x4099a8
mov edi, dword [ebp - 0x658]
push 0x207
lea ecx, [ebp - 0x31b]
push 0
push ecx
mov byte [ebp - 0x31c], 0
call fcn.004ff6f0
mov edx, dword [ebp - 0x678]
mov esi, dword [ebp - 0x624]
mov eax, dword [ebp - 0x65c]
add esp, 0xc
push 0
push 0
push 0
push 0
add edx, esi
push edx
push eax
call dword [sym.imp.WININET.dll_InternetOpenUrlA]
mov dword [ebp - 0x66c], eax
test eax, eax
je 0x409e62
push 0
push 0
push 2
push 0
push 3
push 0xc0000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x640], eax
cmp eax, 0xffffffff
je 0x409ded
push 0x8001
call fcn.004fc6be
xor esi, esi
add esp, 4
mov dword [ebp - 0x648], eax
mov dword [ebp - 0x630], esi
mov dword [ebp - 0x674], esi
mov dword [ebp - 0x634], esi
test edi, edi
je 0x409a58
mov ecx, dword [ebp - 0x644]
mov edx, dword [edi + ecx*4]
mov dword [ebp - 0x634], edx
mov esi, edx
mov edi, esi
mov ecx, dword [ebp - 0x648]
mov edx, dword [ebp - 0x66c]
lea eax, [ebp - 0x630]
push eax
push 0x8000
push ecx
push edx
call dword [sym.imp.WININET.dll_InternetReadFile]
mov dword [ebp - 0x650], eax
test eax, eax
je 0x409c56
mov ecx, dword [ebp - 0x630]
mov edx, dword [ebp - 0x648]
push 0
lea eax, [ebp - 0x674]
push eax
mov eax, dword [ebp - 0x640]
push ecx
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test ebx, ebx
je 0x409ce6
test edi, edi
je 0x409be4
test esi, esi
je 0x409be4
sub edi, dword [ebp - 0x630]
mov ecx, esi
sub ecx, edi
mov dword [ebp - 0x664], ecx
fild dword [ebp - 0x664]
mov dword [ebp - 0x670], edi
jns 0x409ae8
fadd dword [0x54f3d0]
fmul qword [0x54f3c8]
mov edx, esi
mov dword [ebp - 0x664], edx
fild dword [ebp - 0x664]
test edx, edx
jns 0x409b06
fadd dword [0x54f3d0]
fdivp st(1)
fstp dword [ebp - 0x628]
fld dword [ebp - 0x628]
fcomp qword [0x54f3c0]
fnstsw ax
test ah, 0x41
jne 0x409b2d
fld dword [0x54f3bc]
fstp dword [ebp - 0x628]
push 0x103
lea eax, [ebp - 0x41f]
push 0
push eax
mov byte [ebp - 0x420], 0
call fcn.004ff6f0
mov eax, 0x10624dd3
mul esi
mov ecx, edx
mov eax, 0x10624dd3
mul edi
shr ecx, 6
shr edx, 6
inc ecx
inc edx
add esp, 0xc
cmp edx, ecx
jbe 0x409b68
xor edx, edx
fld dword [ebp - 0x628]
fnstcw word [ebp - 0x626]
movzx eax, word [ebp - 0x626]
or eax, 0xc00
mov dword [ebp - 0x664], eax
fldcw word [ebp - 0x664]
fistp qword [ebp - 0x668]
mov esi, dword [ebp - 0x668]
push esi
push ecx
fldcw word [ebp - 0x626]
sub ecx, edx
push ecx
lea ecx, [ebp - 0x114]
push ecx
lea edx, [ebp - 0x420]
push str._s___uK_of__uK___u__
push edx
call fcn.004ff1e4
add esp, 0x18
lea eax, [ebp - 0x420]
push eax
lea edi, [ebx + 0x224]
push edi
mov ecx, ebx
call fcn.004c2c40
push esi
push edi
mov ecx, ebx
call fcn.004c3140
mov edi, dword [ebp - 0x670]
jmp 0x409c09
push 1
push 2
lea esi, [ebx + 0x224]
push esi
mov ecx, ebx
call fcn.004c3170
cmp dword [ebx + 0x334], 0x64
jb 0x409c09
push 2
push esi
mov ecx, ebx
call fcn.004c3140
push 0
mov ecx, ebx
call fcn.004c2a10
cmp dword [ebx + 4], 1
jne 0x409ce0
lea eax, [ebp - 0x114]
push eax
lea ecx, [ebp - 0x31c]
push str.Download__s_cancelled_by_user.
push ecx
call fcn.004ff1e4
push 0
lea edx, [ebp - 0x31c]
push 0xc
push edx
call fcn.00407720
add esp, 0x18
mov dword [ebp - 0x62c], 0x4c7
jmp 0x409d11
cmp dword [ebp + 0x1c], 0
je 0x409ce6
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [0x5bbfe4]
mov esi, eax
mov dword [ebp - 0x63c], ecx
mov byte [ebp - 4], 2
push 0x54f15a
lea ecx, [ebp - 0x63c]
call fcn.004bfc00
push 0
push 0xe011
lea ecx, [ebp - 0x63c]
call fcn.004c1150
mov byte [ebp - 4], 3
mov eax, dword [ebp - 0x63c]
push esi
lea edx, [ebp - 0x114]
push edx
push eax
lea ecx, [ebp - 0x31c]
push str._s_n_n_s___Reason_1:__d
push ecx
call fcn.004ff1e4
push 0
lea edx, [ebp - 0x31c]
push 0xc
push edx
call fcn.00407720
add esp, 0x20
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x63c]
call fcn.004bfa40
mov esi, dword [ebp - 0x634]
cmp dword [ebp - 0x630], 0
je 0x409cfe
cmp dword [ebp - 0x650], 1
je 0x409a5a
jmp 0x409d11
cmp dword [ebp - 0x650], 1
jne 0x409d11
mov dword [ebp - 0x62c], 0
mov eax, dword [ebp - 0x640]
push 0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ecx, dword [ebp - 0x640]
push ecx
mov esi, eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [ebp - 0x648]
push edx
call fcn.004808a0
add esp, 4
test esi, esi
jne 0x409dbe
mov esi, dword [ebp - 0x624]
push esi
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
push 0
push 0xe011
lea ecx, [ebp - 0x64c]
mov dword [ebp - 0x62c], 0xd
call fcn.00406200
mov byte [ebp - 4], 5
mov eax, dword [ebp - 0x64c]
push 0xd
push esi
push eax
lea ecx, [ebp - 0x31c]
push str._s_n_n_s___Reason_3:__d
push ecx
call fcn.004ff1e4
push 0
lea edx, [ebp - 0x31c]
push 0xc
push edx
call fcn.00407720
add esp, 0x20
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x64c]
call fcn.004bfa40
mov edx, dword [ebp - 0x66c]
push edx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
jmp 0x409ec8
cmp dword [ebp - 0x62c], 0x4c7
jne 0x409e53
mov eax, dword [ebp - 0x624]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
mov edx, dword [ebp - 0x66c]
push edx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
jmp 0x409ec8
cmp dword [ebp + 0x1c], 0
je 0x409e53
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0
push 0xe011
lea ecx, [ebp - 0x660]
mov esi, eax
call fcn.00406200
mov byte [ebp - 4], 7
mov ecx, dword [ebp - 0x624]
mov edx, dword [ebp - 0x660]
push esi
push ecx
push edx
lea eax, [ebp - 0x31c]
push str._s_n_n_s___Reason_2:__d
push eax
call fcn.004ff1e4
push 0
lea ecx, [ebp - 0x31c]
push 0xc
push ecx
call fcn.00407720
add esp, 0x20
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x660]
call fcn.004bfa40
mov edx, dword [ebp - 0x66c]
push edx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
jmp 0x409ec8
cmp dword [ebp + 0x1c], 0
je 0x409ec8
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0
push 0xe012
lea ecx, [ebp - 0x654]
mov esi, eax
call fcn.00406200
mov byte [ebp - 4], 9
mov ecx, dword [ebp - 0x654]
lea eax, [ebp - 0x114]
push eax
push esi
push ecx
lea edx, [ebp - 0x31c]
push str._s:__d____s
push edx
call fcn.004ff1e4
push 0
lea eax, [ebp - 0x31c]
push 0xb
push eax
call fcn.00407720
add esp, 0x20
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x654]
call fcn.004bfa40
cmp dword [ebp - 0x62c], 0
jne 0x409ef1
mov eax, dword [ebp - 0x644]
add dword [ebp - 0x624], 0x104
inc eax
mov dword [ebp - 0x644], eax
cmp eax, dword [ebp + 0x10]
jl 0x4098e6
mov ecx, dword [ebp - 0x65c]
push ecx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x638]
call fcn.004bfa40
mov eax, dword [ebp - 0x62c]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004fe1f5
mov esp, ebp
pop ebp
ret