Function at 0x408e60
Capabilities:
Create http request
Get http content length
Read data from internet
Receive data

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x42c
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
cmp dword [edi + 0x18], 0x10
mov esi, ecx
lea eax, [edi + 4]
mov dword [esp + 0x1c], esi
mov dword [esp + 0x14], eax
jb 0x408e87
mov eax, dword [eax]
push eax
push str.get_url___s__
call fcn.004012a0
push eax
call fcn.00401330
add esp, 0xc
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x3c]
push ecx
push 0x26
xor bl, bl
push 0
mov byte [esp + 0x22], bl
mov dword [esp + 0x34], 0x400
call dword [sym.imp.WININET.dll_InternetQueryOptionA]
mov eax, dword [esp + 0x38]
cmp eax, 3
jne 0x408ef7
cmp dword [esi + 0x18], 0x10
jb 0x408ee2
mov edx, dword [esp + 0x40]
mov ecx, dword [esp + 0x3c]
mov eax, dword [esi + 4]
push 0
push edx
add esi, 4
push ecx
push 3
jmp 0x408f47
mov edx, dword [esp + 0x40]
mov ecx, dword [esp + 0x3c]
push 0
push edx
add esi, 4
push ecx
mov eax, esi
push 3
jmp 0x408f47
test eax, eax
jne 0x408f2c
cmp dword [esi + 0x18], 0x10
jb 0x408f17
mov edx, dword [esp + 0x40]
mov ecx, dword [esp + 0x3c]
mov eax, dword [esi + 4]
push 0
push edx
add esi, 4
push ecx
push 0
jmp 0x408f47
mov edx, dword [esp + 0x40]
mov ecx, dword [esp + 0x3c]
push 0
push edx
add esi, 4
push ecx
mov eax, esi
push 0
jmp 0x408f47
cmp dword [esi + 0x18], 0x10
jb 0x408f3a
mov eax, dword [esi + 4]
add esi, 4
jmp 0x408f3f
add esi, 4
mov eax, esi
push 0
push 0
push 0
push 1
push eax
call dword [sym.imp.WININET.dll_InternetOpenA]
mov dword [esp + 0x18], eax
test eax, eax
jne 0x408f75
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str._InternetOpen_failed_with__d
call fcn.004012a0
push eax
call fcn.00401330
add esp, 0xc
jmp 0x40926f
cmp dword [edi + 0x18], 0x10
mov edx, dword [str.Accept:___r_n_r_n]
mov eax, dword [0x4297ec]
mov ecx, dword [0x4297f0]
mov dword [esp + 0x28], edx
mov edx, dword [0x4297f4]
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], ecx
mov dword [esp + 0x34], edx
jb 0x408faa
mov eax, dword [esp + 0x14]
mov edi, dword [eax]
jmp 0x408fae
mov edi, dword [esp + 0x14]
push 0
push 0
lea ecx, [esp + 0x30]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push eax
mov eax, dword [esp + 0x24]
lea edx, [esp + 0x34]
push edx
push edi
mov edi, dword [sym.imp.WININET.dll_InternetOpenUrlA]
push eax
call edi
mov ebx, eax
mov dword [esp + 0x20], ebx
test ebx, ebx
jne 0x409074
cmp dword [esp + 0x38], 1
je 0x409051
mov ecx, dword [esp + 0x18]
push ecx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov edx, dword [esp + 0x1c]
mov ebx, 0x10
cmp dword [edx + 0x18], ebx
jb 0x409001
mov esi, dword [esi]
push 0
push 0
push 0
push 1
push esi
call dword [sym.imp.WININET.dll_InternetOpenA]
mov dword [esp + 0x18], eax
test eax, eax
je 0x409051
mov eax, dword [ebp + 8]
cmp dword [eax + 0x18], ebx
jb 0x409028
mov ecx, dword [esp + 0x14]
mov esi, dword [ecx]
jmp 0x40902c
mov esi, dword [esp + 0x14]
push 0
push 0
lea edx, [esp + 0x30]
push edx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov ecx, dword [esp + 0x20]
push eax
lea eax, [esp + 0x34]
push eax
push esi
push ecx
call edi
mov dword [esp + 0x20], eax
test eax, eax
jne 0x409070
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str._InternetOpenUrl_failed_with__d
call fcn.004012a0
push eax
call fcn.00401330
add esp, 0xc
jmp 0x409260
mov ebx, dword [esp + 0x20]
push str._InternetOpenUrlW_ok
push ecx
call fcn.004012a0
add esp, 4
push eax
call fcn.00401330
add esp, 8
push 0
lea edx, [esp + 0x28]
push edx
lea eax, [esp + 0x24]
push eax
push 0x20000005
push ebx
mov dword [esp + 0x38], 4
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
test eax, eax
jne 0x4090d1
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str._HttpQueryInfo_failed__unknown_content_length__gle___d
call fcn.004012a0
push eax
call fcn.00401330
add esp, 0xc
mov dword [esp + 0x1c], 0
mov esi, dword [ebp + 0xc]
mov edi, dword [esi + 8]
test edi, edi
je 0x409129
push 0
push 0
push 0
push edi
push ebx
call dword [sym.imp.WININET.dll_InternetSetFilePointer]
cmp eax, edi
je 0x409112
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str._InternetSetFilePointer_failed__gle___d
call fcn.004012a0
push eax
call fcn.00401330
add esp, 0xc
push 0
mov ecx, esi
call fcn.00404820
jmp 0x409129
mov eax, dword [esi + 8]
push eax
push str._InternetSetFilePointer_OK__already_downloaded__d_byte_s_
call fcn.004012a0
push eax
call fcn.00401330
add esp, 0xc
mov ecx, dword [esp + 0x1c]
push ecx
push str._Download_started._Content_length__d
call fcn.004012a0
push eax
call fcn.00401330
add esp, 0xc
mov byte [esp + 0x13], 0
mov eax, dword [esi]
mov edx, eax
sub edx, dword [esi + 8]
cmp edx, 0x2000
jae 0x4091bb
lea edi, [eax + 0x100000]
cmp edi, eax
jbe 0x4091bb
push edi
call fcn.00412d5e
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x40919b
mov ecx, dword [esi + 4]
test ecx, ecx
je 0x409194
mov eax, dword [esi]
cmp eax, edi
jb 0x40917d
mov eax, edi
push eax
push ecx
push ebx
call fcn.004158a0
mov eax, dword [esi + 4]
add esp, 0xc
push eax
call fcn.00416320
add esp, 4
mov dword [esi], edi
mov dword [esi + 4], ebx
jmp 0x4091b7
push str._Memory_allocation_failed
push ecx
mov byte [esp + 0x1b], 0
call fcn.004012a0
add esp, 4
push eax
call fcn.00401330
add esp, 8
mov ebx, dword [esp + 0x20]
mov ecx, dword [esi + 8]
mov edx, dword [esi]
sub edx, ecx
cmp edx, 0x2000
jb 0x40920c
mov eax, dword [esi + 4]
lea edx, [esp + 0x14]
push edx
push 0x2000
add eax, ecx
push eax
push ebx
mov dword [esp + 0x24], 0
call dword [sym.imp.WININET.dll_InternetReadFile]
cmp eax, 1
sete al
mov byte [esp + 0x13], al
test al, al
je 0x409238
mov eax, dword [esp + 0x14]
test eax, eax
jbe 0x40920c
mov ecx, dword [esi + 8]
add ecx, eax
push ecx
mov ecx, esi
call fcn.00404820
cmp byte [esp + 0x13], 0
je 0x409238
cmp dword [esp + 0x14], 0
ja 0x409146
mov eax, dword [esp + 0x1c]
test eax, eax
jne 0x409230
cmp dword [esi + 8], eax
seta byte [esp + 0x12]
jmp 0x409238
cmp dword [esi + 8], eax
sete byte [esp + 0x12]
movzx edx, byte [esp + 0x12]
mov esi, dword [esi + 8]
push edx
push esi
push str._Recv_finished___d_recvd__ret__d
push ecx
call fcn.004012a0
add esp, 4
push eax
call fcn.00401330
add esp, 0x10
push ebx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov eax, dword [esp + 0x18]
push eax
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov bl, byte [esp + 0x12]
movzx ecx, bl
push ecx
push str.__get_url_return__d
call fcn.004012a0
push eax
call fcn.00401330
add esp, 0xc
pop edi
pop esi
mov al, bl
pop ebx
mov esp, ebp
pop ebp
ret 8