Function at 0x4022a0
Capabilities:
Check http status code
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 ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x2768
call fcn.00406f40
mov eax, dword [0x40c060]
push ebx
mov dword [esp + 0x2768], eax
mov eax, dword [esi + 0x5c]
push edi
mov edi, 0x10
cmp eax, edi
jb 0x4022cf
mov eax, dword [esi + 0x48]
jmp 0x4022d2
lea eax, [esi + 0x48]
mov edx, dword [esi]
push eax
push 0xb
mov ecx, esi
call dword [edx + 8]
cmp dword [esi + 0x40], edi
jb 0x4022e6
mov eax, dword [esi + 0x2c]
jmp 0x4022e9
lea eax, [esi + 0x2c]
push 0
push 0x4000000
push 0
push 0
push str.HTTP_1.0
push eax
mov eax, dword [esi + 8]
push 0x408a50
push eax
call dword [sym.imp.WININET.dll_HttpOpenRequestA]
mov ebx, eax
test ebx, ebx
mov dword [esp + 0x18], ebx
je 0x40242c
push 0
push 0
push 0
push 0
push ebx
call dword [sym.imp.WININET.dll_HttpSendRequestA]
test eax, eax
jne 0x402344
call dword [sym.imp.KERNEL32.dll_GetLastError]
xor al, al
mov ecx, dword [esp + 0x276c]
call fcn.00406fae
pop edi
pop ebx
mov esp, ebp
pop ebp
ret
push 0
lea ecx, [esp + 0x24]
push ecx
lea edx, [esp + 0x50]
push edx
push 0x13
mov dword [esp + 0x30], edi
mov edi, dword [sym.imp.WININET.dll_HttpQueryInfoA]
push ebx
call edi
lea eax, [esp + 0x48]
push eax
call dword [sym.imp.MSVCR71.dll_atoi]
add esp, 4
cmp eax, 0xc8
jne 0x40242c
xor ecx, ecx
mov dword [esp + 0x29], ecx
mov dword [esp + 0x2d], ecx
mov dword [esp + 0x31], ecx
mov dword [esp + 0x35], ecx
mov dword [esp + 0x39], ecx
mov dword [esp + 0x3d], ecx
mov dword [esp + 0x41], ecx
mov word [esp + 0x45], cx
lea edx, [esp + 0x1c]
push edx
lea eax, [esp + 0x28]
push eax
mov byte [esp + 0x4f], cl
mov byte [esp + 0x30], 0
mov dword [esp + 0x24], ecx
lea ecx, [esp + 0x30]
push ecx
push 5
push ebx
mov dword [esp + 0x38], 0x20
call edi
test eax, eax
je 0x40242c
mov byte [esp + 0x58], 0
xor eax, eax
mov ecx, 0x9c3
lea edi, [esp + 0x59]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea edx, [esp + 0x28]
xor edi, edi
push edx
mov dword [esp + 0x10], edi
call dword [sym.imp.MSVCR71.dll_atol]
mov dword [esp + 0x14], eax
mov dword [esi + 0x7c], eax
mov dword [esi + 0x80], edi
mov eax, dword [esi + 0x5c]
add esp, 4
cmp eax, 0x10
jb 0x40240b
mov eax, dword [esi + 0x48]
jmp 0x40240e
lea eax, [esi + 0x48]
push 0x408a4c
push eax
call dword [sym.imp.MSVCR71.dll_fopen]
add esp, 8
test eax, eax
mov dword [esp + 0x14], eax
jne 0x402440
push ebx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
xor al, al
mov ecx, dword [esp + 0x276c]
call fcn.00406fae
pop edi
pop ebx
mov esp, ebp
pop ebp
ret
lea eax, [esp + 0xc]
push eax
push 0x2710
lea ecx, [esp + 0x60]
push ecx
push ebx
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x40255e
mov edi, edi
mov eax, dword [esp + 0xc]
test eax, eax
je 0x40255e
mov edx, dword [esp + 0x14]
push edx
push 1
push eax
lea eax, [esp + 0x64]
push eax
call dword [sym.imp.MSVCR71.dll_fwrite]
mov eax, dword [esp + 0x1c]
mov ecx, dword [esi + 0x80]
add edi, eax
add ecx, eax
add esp, 0x10
mov dword [esp + 8], edi
mov dword [esi + 0x80], ecx
call dword [sym.imp.WINMM.dll_timeGetTime]
mov edx, dword [esi + 0x78]
sub eax, edx
cmp eax, 0xbb8
jb 0x4024e6
mov ebx, dword [esi + 0x80]
mov edi, edx
call dword [sym.imp.WINMM.dll_timeGetTime]
mov edx, dword [esi + 0x6c]
mov ecx, eax
mov eax, ebx
sub eax, edx
imul eax, eax, 0x3e8
sub ecx, edi
xor edx, edx
div ecx
add edi, 0xbb8
mov dword [esi + 0x6c], ebx
mov ebx, dword [esp + 0x18]
mov dword [esi + 0x78], edi
mov edi, dword [esp + 8]
mov dword [esi + 0x70], eax
call dword [sym.imp.WINMM.dll_timeGetTime]
sub eax, dword [esi + 0x74]
cmp eax, 0xc8
jb 0x402540
test edi, edi
mov ebx, dword [esi]
mov dword [esp + 8], edi
fild dword [esp + 8]
jge 0x40250a
fadd dword [0x409b98]
mov edx, dword [esp + 0x10]
fild dword [esp + 0x10]
test edx, edx
jge 0x40251c
fadd dword [0x409b98]
fdivp st(1)
fmul dword [0x409b94]
call fcn.00407318
push eax
push 0xa
mov ecx, esi
call dword [ebx + 4]
mov eax, dword [esi + 0x74]
mov ebx, dword [esp + 0x18]
add eax, 0xc8
mov dword [esi + 0x74], eax
lea eax, [esp + 0xc]
push eax
push 0x2710
lea ecx, [esp + 0x60]
push ecx
push ebx
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
jne 0x402460
test edi, edi
mov eax, dword [esi]
mov dword [esp + 8], edi
fild dword [esp + 8]
jge 0x402572
fadd dword [0x409b98]
mov edx, dword [esp + 0x10]
fild dword [esp + 0x10]
test edx, edx
jge 0x402584
fadd dword [0x409b98]
fdivp st(1)
mov dword [esp + 8], eax
fmul dword [0x409b94]
call fcn.00407318
push eax
mov eax, dword [esp + 0xc]
push 0xa
mov ecx, esi
call dword [eax + 4]
mov eax, dword [esp + 0x14]
push eax
call dword [sym.imp.MSVCR71.dll_fclose]
add esp, 4
push ebx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
cmp dword [esi + 0x5c], 0x10
jb 0x4025c1
mov eax, dword [esi + 0x48]
jmp 0x4025c4
lea eax, [esi + 0x48]
mov edx, dword [esi]
push eax
push 0xc
mov ecx, esi
call dword [edx + 8]
mov ecx, dword [esp + 0x276c]
mov al, 1
call fcn.00406fae
pop edi
pop ebx
mov esp, ebp
pop ebp
ret