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

Disassembly:
push 0x588
push 0x4234b8
call fcn.00412ebc
mov dword [ebp - 0x48], 4
xor ebx, ebx
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x20], ebx
mov byte [ebp - 0x198], bl
mov esi, dword [ebp + 8]
push esi
mov edi, dword [sym.imp.KERNEL32.dll_lstrlenA]
call edi
test eax, eax
je 0x40fb25
push esi
call fcn.0040bed6
pop ecx
test eax, eax
je 0x40fb25
cmp dword [ebp + 0x14], ebx
je 0x40f6b1
lea eax, [ebp - 0x198]
push eax
push esi
call fcn.0040c4b5
pop ecx
pop ecx
lea eax, [ebp - 0x198]
push eax
call edi
test eax, eax
je 0x40f700
push ebx
push 0x20
push 3
push ebx
push ebx
push 0x40000000
lea eax, [ebp - 0x198]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
je 0x40f700
push ebx
lea eax, [ebp - 0x20]
push eax
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x20], ebx
ja 0x40fb25
mov dword [ebp - 0x20], ebx
mov dword [ebp - 0x34], ebx
mov dword [ebp - 0x3c], ebx
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x30], 0x80004005
mov dword [ebp - 4], ebx
push ebx
push ebx
push ebx
push ebx
push 0x422f98
call dword [sym.imp.WININET.dll_InternetOpenA]
mov dword [ebp - 0x34], eax
cmp eax, ebx
je 0x40fa85
push 0xf
pop ecx
xor eax, eax
lea edi, [ebp - 0x8c]
rep stosd dword es:[edi], eax
push 0x3c
pop edi
mov dword [ebp - 0x8c], edi
lea eax, [ebp - 0x398]
mov dword [ebp - 0x7c], eax
mov eax, 0x100
mov dword [ebp - 0x78], eax
mov word [ebp - 0x74], bx
lea ecx, [ebp - 0x598]
mov dword [ebp - 0x60], ecx
mov dword [ebp - 0x5c], eax
lea ecx, [ebp - 0x498]
mov dword [ebp - 0x58], ecx
mov dword [ebp - 0x54], eax
lea eax, [ebp - 0x8c]
push eax
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push eax
push esi
call dword [sym.imp.WININET.dll_InternetCrackUrlA]
push ebx
push ebx
push 3
push 0x422fa0
push 0x422fa1
push dword [ebp - 0x74]
push dword [ebp - 0x7c]
push dword [ebp - 0x34]
call dword [sym.imp.WININET.dll_InternetConnectA]
mov dword [ebp - 0x3c], eax
cmp eax, ebx
je 0x40fa85
lea eax, [ebp - 0x298]
cmp dword [ebp - 0x5c], ebx
je 0x40f7c2
push dword [ebp - 0x60]
jmp 0x40f7c7
push 0x422fa4
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
cmp dword [ebp - 0x54], ebx
je 0x40f7e3
push dword [ebp - 0x58]
lea eax, [ebp - 0x298]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
mov dword [ebp - 0x2c], ebx
mov dword [ebp - 0x38], ebx
mov dword [ebp - 0x40], edi
mov edi, dword [sym.imp.WININET.dll_InternetErrorDlg]
mov dword [ebp - 0x2c], ebx
push ebx
push 0x4400000
push ebx
push 0x422fa6
push str.HTTP_1.1
lea eax, [ebp - 0x298]
push eax
push 0x422fb4
push dword [ebp - 0x3c]
call dword [sym.imp.WININET.dll_HttpOpenRequestA]
mov dword [ebp - 0x24], eax
cmp eax, ebx
je 0x40fa85
xor esi, esi
inc esi
mov dword [ebp - 0x1c], esi
push ebx
push ebx
push ebx
push ebx
push dword [ebp - 0x24]
call dword [sym.imp.WININET.dll_HttpSendRequestA]
test eax, eax
jne 0x40f898
cmp dword [ebp - 0x1c], ebx
je 0x40fa85
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x90], eax
mov ecx, eax
sub ecx, 0x2ee2
je 0x40f882
sub ecx, 5
je 0x40f882
sub ecx, 0x16
je 0x40f882
mov dword [ebp - 0x1c], ebx
push ebx
push 7
push eax
push dword [ebp - 0x24]
call dword [sym.imp.USER32.dll_GetDesktopWindow]
push eax
call edi
cmp eax, 0x2f00
jne 0x40f82c
jmp 0x40f829
mov dword [ebp - 0x1c], ebx
cmp dword [ebp + 0x18], ebx
je 0x40f82c
push ebx
push ebx
push eax
push ebx
call fcn.0040f4ac
add esp, 0x10
jmp 0x40f82c
cmp dword [ebp - 0x1c], ebx
je 0x40fa85
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x50], eax
mov dword [ebp - 0x44], ebx
push ebx
lea eax, [ebp - 0x48]
push eax
lea eax, [ebp - 0x44]
push eax
push 0x20000013
mov esi, dword [ebp - 0x24]
push esi
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
test eax, eax
jne 0x40f8d2
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x50], eax
mov dword [ebp - 0x1c], 1
mov edx, dword [ebp - 0x44]
cmp edx, 0x197
jne 0x40f92e
cmp dword [ebp - 0x1c], ebx
je 0x40f92e
push ebx
push 7
push dword [ebp - 0x50]
push esi
call dword [sym.imp.USER32.dll_GetDesktopWindow]
push eax
call edi
cmp eax, 0x2f00
je 0x40f905
mov dword [ebp - 0x1c], ebx
jmp 0x40f8d9
push ebx
push ebx
push ebx
push ebx
push esi
call dword [sym.imp.WININET.dll_HttpSendRequestA]
mov dword [ebp - 0x48], 4
push ebx
lea eax, [ebp - 0x48]
push eax
lea eax, [ebp - 0x44]
push eax
push 0x20000013
push esi
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
jmp 0x40f8d9
cmp edx, 0xc8
jne 0x40f97a
mov dword [ebp - 0x20], ebx
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 0x28]
add eax, ecx
mov dword [ebp - 0x94], eax
lea ecx, [ebp - 0x20]
push ecx
mov ecx, dword [ebp + 0x10]
sub ecx, dword [ebp - 0x28]
push ecx
push eax
push esi
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x40f964
mov eax, dword [ebp - 0x20]
add dword [ebp - 0x28], eax
cmp dword [ebp - 0x20], ebx
ja 0x40f936
cmp dword [ebp - 0x28], ebx
jbe 0x40fa7c
mov dword [ebp - 0x30], ebx
jmp 0x40fa7c
cmp edx, 0x190
jb 0x40fa61
cmp edx, 0x258
jae 0x40fa61
mov eax, 0x193
cmp edx, eax
je 0x40fa31
add eax, 0x61
cmp edx, eax
jne 0x40f9cd
cmp dword [ebp + 0x18], ebx
je 0x40fa45
push 1
push ebx
push eax
push ebx
call fcn.0040f4ac
add esp, 0x10
test eax, eax
je 0x40fa45
mov dword [ebp - 0x2c], 1
jmp 0x40fa45
mov ecx, 0x1f7
cmp edx, ecx
jne 0x40fa29
cmp dword [ebp - 0x38], 5
jge 0x40fa00
mov eax, dword [ebp - 0x40]
mov dword [ebp - 0x4c], eax
cmp dword [ebp - 0x4c], ebx
jl 0x40f9f7
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
dec dword [ebp - 0x4c]
jmp 0x40f9e2
inc dword [ebp - 0x38]
add dword [ebp - 0x40], 0x1e
jmp 0x40fa20
cmp dword [ebp + 0x18], ebx
je 0x40fa45
push 1
push ebx
push ecx
push ebx
call fcn.0040f4ac
add esp, 0x10
test eax, eax
je 0x40fa45
mov dword [ebp - 0x38], ebx
mov dword [ebp - 0x40], 0x3c
mov dword [ebp - 0x2c], 1
jmp 0x40fa7c
cmp edx, 0x194
je 0x40fa45
xor ecx, ecx
cmp dword [ebp + 0x18], ebx
sete cl
push ebx
push ecx
push eax
push ebx
call fcn.0040f4ac
add esp, 0x10
xor eax, eax
cmp dword [ebp - 0x44], 0x194
setne al
dec eax
and eax, 0x6c1fd
add eax, 0x80004005
mov dword [ebp - 0x30], eax
jmp 0x40fa7c
push ebx
xor eax, eax
cmp dword [ebp + 0x18], ebx
sete al
push eax
push edx
push ebx
call fcn.0040f4ac
add esp, 0x10
mov dword [ebp - 0x30], 0x80004005
cmp dword [ebp - 0x2c], ebx
jne 0x40f7f2
or dword [ebp - 4], 0xffffffff
call fcn.0040fafa
cmp dword [ebp - 0x30], ebx
jne 0x40faf3
lea eax, [ebp - 0x198]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
test eax, eax
je 0x40faf3
push ebx
push 0x20
push 4
push ebx
push ebx
push 0x40000000
lea eax, [ebp - 0x198]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
je 0x40faf3
push ebx
lea eax, [ebp - 0x20]
push eax
push dword [ebp - 0x28]
push dword [ebp + 0xc]
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp + 0x1c], ebx
je 0x40faf3
push dword [ebp + 0x1c]
lea eax, [ebp - 0x198]
push eax
call fcn.0040e134
pop ecx
pop ecx
mov eax, dword [ebp - 0x30]
jmp 0x40fb27
xor eax, eax
call fcn.00412ef7
ret