Function at 0x4058ac
Capabilities:
Check http status code
Create http request
Delete file
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
push 0xffffffffffffffff
push 0x423480
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
push ecx
sub esp, 0x1ac
push ebx
push esi
push edi
mov dword [ebp - 0x10], esp
mov dword [ebp - 0x194], 0
mov dword [ebp - 0x13c], 0
mov dword [ebp - 0x174], 0
mov dword [ebp - 0x180], 0
mov dword [ebp - 0x120], 0
mov dword [ebp - 0x170], 0
mov eax, dword [str.Accept:___r_n_r_n]
mov dword [ebp - 0x134], eax
mov ecx, dword [0x431fb0]
mov dword [ebp - 0x130], ecx
mov edx, dword [0x431fb4]
mov dword [ebp - 0x12c], edx
mov eax, dword [0x431fb8]
mov dword [ebp - 0x128], eax
mov ecx, dword [0x431fbc]
mov dword [ebp - 0x190], ecx
mov edx, dword [0x431fc0]
mov dword [ebp - 0x18c], edx
mov eax, dword [0x431fc4]
mov dword [ebp - 0x188], eax
mov ecx, dword [0x431fc8]
mov dword [ebp - 0x184], ecx
mov byte [ebp - 0x11c], 0
mov ecx, 0x40
xor eax, eax
lea edi, [ebp - 0x11b]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 4
mov dword [ebp - 0x17c], 0
mov dword [ebp - 0x124], 0
mov dword [ebp - 0x144], 0
mov dword [ebp - 0x140], 0
push 0x1000
call sub.MFC42.DLL_operatornew
add esp, 4
mov dword [ebp - 0x1ac], eax
mov edx, dword [ebp - 0x1ac]
mov dword [ebp - 0x178], edx
cmp dword [ebp - 0x178], 0
jne 0x4059e6
jmp 0x405f1b
push 0x104
lea eax, [ebp - 0x11c]
push eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.00405841
add esp, 0xc
mov dword [ebp - 0x13c], eax
cmp dword [ebp - 0x13c], 0
jne 0x405a12
jmp 0x405f1b
mov dword [ebp - 0x174], 1
cmp dword [ebp + 0x10], 0
je 0x405a39
lea edx, [ebp - 0x11c]
push edx
mov eax, dword [ebp - 0x174]
push eax
push 0
push 0
push 0
call dword [ebp + 0x10]
mov dword [ebp - 4], 0
push 0
push 0
push 0
push 1
push str.KANDownloadFile
call dword [sym.imp.WININET.dll_InternetOpenA]
mov dword [ebp - 0x170], eax
cmp dword [ebp - 0x170], 0
je 0x405a84
mov dword [ebp - 0x198], 0x2710
push 4
lea ecx, [ebp - 0x198]
push ecx
push 2
mov edx, dword [ebp - 0x170]
push edx
call dword [sym.imp.WININET.dll_InternetSetOptionA]
jmp 0x405a96
mov dword [ebp - 4], 0xffffffff
cmp dword [ebp - 0x170], 0
jne 0x405aad
mov byte [0x439650], 1
cmp dword [ebp - 0x170], 0
jne 0x405abb
jmp 0x405f1b
mov dword [ebp - 0x174], 2
cmp dword [ebp + 0x10], 0
je 0x405ae2
lea eax, [ebp - 0x11c]
push eax
mov ecx, dword [ebp - 0x174]
push ecx
push 0
push 0
push 0
call dword [ebp + 0x10]
lea edx, [ebp - 0x134]
push edx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov dword [ebp - 0x138], eax
mov dword [ebp - 4], 2
push 0
push 0x84000100
mov eax, dword [ebp - 0x138]
push eax
lea ecx, [ebp - 0x134]
push ecx
mov edx, dword [ebp + 8]
push edx
mov eax, dword [ebp - 0x170]
push eax
call dword [sym.imp.WININET.dll_InternetOpenUrlA]
mov dword [ebp - 0x120], eax
jmp 0x405b3a
mov dword [ebp - 4], 0xffffffff
cmp dword [ebp - 0x120], 0
jne 0x405b4f
jmp 0x405f1b
mov dword [ebp - 0x174], 3
cmp dword [ebp + 0x10], 0
je 0x405b76
lea ecx, [ebp - 0x11c]
push ecx
mov edx, dword [ebp - 0x174]
push edx
push 0
push 0
push 0
call dword [ebp + 0x10]
mov dword [ebp - 4], 4
push 0
lea eax, [ebp - 0x14]
push eax
lea ecx, [ebp - 0x144]
push ecx
push 0x20000013
mov edx, dword [ebp - 0x120]
push edx
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
mov dword [ebp - 0x13c], eax
jmp 0x405bb4
mov dword [ebp - 4], 0xffffffff
cmp dword [ebp - 0x13c], 0
je 0x405bd0
cmp dword [ebp - 0x144], 0xc8
je 0x405bd5
jmp 0x405f1b
mov dword [ebp - 4], 6
push 0
lea eax, [ebp - 0x14]
push eax
lea ecx, [ebp - 0x18]
push ecx
push 0x20000005
mov edx, dword [ebp - 0x120]
push edx
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
mov dword [ebp - 0x13c], eax
jmp 0x405c10
mov dword [ebp - 4], 0xffffffff
cmp dword [ebp - 0x13c], 0
jne 0x405c25
jmp 0x405f1b
mov dword [ebp - 0x174], 4
cmp dword [ebp + 0x10], 0
je 0x405c4e
lea eax, [ebp - 0x11c]
push eax
mov ecx, dword [ebp - 0x174]
push ecx
push 0
push 0
mov edx, dword [ebp - 0x18]
push edx
call dword [ebp + 0x10]
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x180], eax
cmp dword [ebp - 0x180], 0xffffffff
jne 0x405c7e
jmp 0x405f1b
mov dword [ebp - 0x168], 0
mov ecx, dword [ebp - 0x178]
mov dword [ebp - 0x158], ecx
mov dword [ebp - 0x1a0], 0
mov dword [ebp - 0x19c], 0
mov dword [ebp - 0x1a8], 0
mov dword [ebp - 0x1a4], 0
call dword [sym.imp.MSVCRT.dll_clock]
mov dword [ebp - 0x19c], eax
xor edx, edx
mov dl, byte [0x4331a0]
test edx, edx
jne 0x405cd9
jmp 0x405f4d
mov dword [ebp - 0x154], 0x1000
mov dword [ebp - 0x164], 0
mov dword [ebp - 0x16c], 0x28
mov dword [ebp - 0x160], 0
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x150], eax
mov dword [ebp - 4], 8
push 0
push 8
lea ecx, [ebp - 0x16c]
push ecx
mov edx, dword [ebp - 0x120]
push edx
call dword [sym.imp.WININET.dll_InternetReadFileExA]
mov dword [ebp - 0x13c], eax
jmp 0x405d41
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x154]
mov dword [ebp - 0x17c], eax
cmp dword [ebp - 0x13c], 0
jne 0x405d62
jmp 0x405f1b
push 0
lea ecx, [ebp - 0x124]
push ecx
mov edx, dword [ebp - 0x17c]
push edx
mov eax, dword [ebp - 0x178]
push eax
mov ecx, dword [ebp - 0x180]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [ebp - 0x13c], eax
cmp dword [ebp - 0x13c], 0
jne 0x405d9a
jmp 0x405f1b
mov edx, dword [ebp - 0x140]
add edx, dword [ebp - 0x124]
mov dword [ebp - 0x140], edx
call dword [sym.imp.MSVCRT.dll_clock]
mov dword [ebp - 0x1a8], eax
mov eax, dword [ebp - 0x1a8]
sub eax, dword [ebp - 0x19c]
mov dword [ebp - 0x1b4], eax
fild dword [ebp - 0x1b4]
fdiv dword [0x426034]
fstp dword [ebp - 0x1a4]
fld dword [ebp - 0x1a4]
fcomp dword [0x426030]
fnstsw ax
test ah, 0x40
jne 0x405e1c
mov ecx, dword [ebp - 0x17c]
mov dword [ebp - 0x1bc], ecx
mov dword [ebp - 0x1b8], 0
fild qword [ebp - 0x1bc]
fdiv dword [ebp - 0x1a4]
call sub.MSVCRT.dll__ftol
mov dword [ebp - 0x1a0], eax
mov dword [ebp - 0x174], 5
cmp dword [ebp + 0x10], 0
je 0x405e4f
lea edx, [ebp - 0x11c]
push edx
mov eax, dword [ebp - 0x174]
push eax
mov ecx, dword [ebp - 0x1a0]
push ecx
mov edx, dword [ebp - 0x140]
push edx
mov eax, dword [ebp - 0x18]
push eax
call dword [ebp + 0x10]
xor ecx, ecx
mov cl, byte [0x4331a0]
test ecx, ecx
jne 0x405e84
mov dword [ebp - 0x174], 7
cmp dword [ebp + 0x10], 0
je 0x405e84
lea edx, [ebp - 0x11c]
push edx
mov eax, dword [ebp - 0x174]
push eax
push 0
push 0
mov ecx, dword [ebp - 0x18]
push ecx
call dword [ebp + 0x10]
cmp dword [ebp - 0x17c], 0
jne 0x405c94
mov edx, dword [ebp - 0x180]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x180], 0
mov eax, dword [ebp - 0x140]
cmp eax, dword [ebp - 0x18]
je 0x405ee8
mov dword [ebp - 0x174], 0
cmp dword [ebp + 0x10], 0
je 0x405edc
lea ecx, [ebp - 0x11c]
push ecx
mov edx, dword [ebp - 0x174]
push edx
push 0
push 0
mov eax, dword [ebp - 0x18]
push eax
call dword [ebp + 0x10]
mov ecx, dword [ebp + 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
jmp 0x405f1b
mov dword [ebp - 0x174], 6
cmp dword [ebp + 0x10], 0
je 0x405f11
lea edx, [ebp - 0x11c]
push edx
mov eax, dword [ebp - 0x174]
push eax
push 0
push 0
mov ecx, dword [ebp - 0x18]
push ecx
call dword [ebp + 0x10]
mov dword [ebp - 0x194], 1
cmp dword [ebp - 0x194], 0
jne 0x405f4d
mov dword [ebp - 0x174], 0
cmp dword [ebp + 0x10], 0
je 0x405f4d
lea edx, [ebp - 0x11c]
push edx
mov eax, dword [ebp - 0x174]
push eax
push 0
push 0
mov ecx, dword [ebp - 0x18]
push ecx
call dword [ebp + 0x10]
xor edx, edx
mov dl, byte [0x4331a0]
test edx, edx
jne 0x405f82
mov dword [ebp - 0x174], 7
cmp dword [ebp + 0x10], 0
je 0x405f82
lea eax, [ebp - 0x11c]
push eax
mov ecx, dword [ebp - 0x174]
push ecx
push 0
push 0
mov edx, dword [ebp - 0x18]
push edx
call dword [ebp + 0x10]
cmp dword [ebp - 0x178], 0
je 0x405fb0
mov eax, dword [ebp - 0x178]
mov dword [ebp - 0x1b0], eax
mov ecx, dword [ebp - 0x1b0]
push ecx
call sub.MFC42.DLL_operatordelete
add esp, 4
mov dword [ebp - 0x178], 0
cmp dword [ebp - 0x180], 0
je 0x405fc6
mov edx, dword [ebp - 0x180]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x194], 0
jne 0x405fd9
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
cmp dword [ebp - 0x170], 0
je 0x405fef
mov ecx, dword [ebp - 0x170]
push ecx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
cmp dword [ebp - 0x120], 0
je 0x406005
mov edx, dword [ebp - 0x120]
push edx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov eax, dword [ebp - 0x174]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret