Function at 0x4be640
Capabilities:
Check http status code
Create http request
Get http content length
Read data from internet
Receive data

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
push ebx
push esi
push edi
mov edi, ecx
mov dword [ebp - 0x20], 0
xor al, al
mov dword [ebp - 0x34], 4
mov byte [ebp - 1], al
mov ebx, dword [edi + 0x250]
test ebx, ebx
je 0x4bea17
mov eax, ebx
and eax, 3
cmp al, 3
je 0x4bea17
test bl, 1
je 0x4be68b
cmp dword [edi + 0x258], 0
je 0x4bea17
test bl, 2
je 0x4be6ac
cmp dword [edi + 0x128], 0
je 0x4bea17
test bl, 4
je 0x4be6ac
or dword [edi + 0x24c], 0x200000
push 0
push 0
push 0
push 0
push dword [edi + 0x254]
shr ebx, 1
lea esi, [edi + 0x260]
and ebx, 0xffffff01
mov dword [esi], 0
mov dword [ebp - 0x24], ebx
call dword [sym.imp.WININET.dll_InternetOpenW]
mov ecx, eax
mov dword [ebp - 8], ecx
test ecx, ecx
je 0x4bea03
mov eax, dword [edi + 0x248]
test eax, eax
jle 0x4be745
mov esi, dword [sym.imp.WININET.dll_InternetSetOptionW]
imul eax, eax, 0x3e8
push 4
mov dword [ebp - 0x10], eax
lea eax, [ebp - 0x10]
push eax
push 2
push ecx
call esi
push 4
lea eax, [ebp - 0x10]
push eax
push 5
push dword [ebp - 8]
call esi
push 4
lea eax, [ebp - 0x10]
push eax
push 6
push dword [ebp - 8]
call esi
push 4
lea eax, [ebp - 0x10]
push eax
push 7
push dword [ebp - 8]
call esi
push 4
lea eax, [ebp - 0x10]
push eax
push 8
push dword [ebp - 8]
call esi
mov ecx, dword [ebp - 8]
lea esi, [edi + 0x260]
cmp byte [edi + 0x11c], 0
lea eax, [edi + 0xc]
jne 0x4be754
mov eax, dword [edi + 8]
push 0
push dword [edi + 0x24c]
add eax, 4
push 0
push 0
push eax
push ecx
call dword [sym.imp.WININET.dll_InternetOpenUrlW]
mov ecx, eax
mov dword [ebp - 0x1c], ecx
test ecx, ecx
je 0x4be9e2
mov eax, dword [edi + 0x24c]
mov dword [ebp - 0xc], 0
mov dword [ebp - 0x30], 4
mov dword [ebp - 0x28], eax
push 0
test eax, 0x200000
je 0x4be821
lea eax, [ebp - 0x2c]
mov dword [ebp - 0x2c], 4
push eax
lea eax, [ebp - 0xc]
push eax
push 0x20000013
push ecx
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
test eax, eax
je 0x4be9d4
mov ecx, dword [ebp - 0xc]
cmp ecx, 0xc8
je 0x4be87e
lea eax, [ecx - 0x12c]
mov dword [esi], 0
cmp eax, 0x63
ja 0x4be816
xor esi, esi
lea ebx, [edi + 0x260]
mov edx, dword [ebp - 8]
lea eax, [ebp - 0xc]
push ebx
push eax
push dword [ebp - 0x28]
lea eax, [ebp - 0x1c]
mov ecx, edi
push eax
call fcn.004bf7c0
add esp, 0x10
test al, al
je 0x4be80a
inc esi
cmp esi, 5
jl 0x4be7e7
mov ecx, dword [ebp - 0xc]
lea esi, [edi + 0x260]
mov ebx, dword [ebp - 0x24]
cmp dword [esi], 0
jne 0x4be9d4
jmp 0x4be840
lea eax, [ebp - 0x30]
push eax
lea eax, [ebp - 0xc]
push eax
push 0x20000013
push ecx
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
test eax, eax
je 0x4be9d4
mov ecx, dword [ebp - 0xc]
cmp ecx, 0xc8
je 0x4be867
cmp ecx, 0x130
je 0x4be86f
cmp ecx, 0x194
jne 0x4be9d4
mov dword [esi], 4
jmp 0x4be9d4
cmp ecx, 0x130
jne 0x4be87e
mov dword [esi], 1
mov al, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [ebp - 0x1c]
lea eax, [ebp - 0x34]
push 0
push eax
lea eax, [ebp - 0x20]
push eax
push 0x20000005
push esi
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
mov edx, eax
mov al, 0
neg edx
mov byte [ebp - 0x10], al
sbb edx, edx
and edx, dword [ebp - 0x20]
mov dword [ebp - 0x24], edx
mov dword [ebp - 0x20], edx
jle 0x4be8b4
mov al, 1
mov byte [ebp - 0x10], al
jmp 0x4be8bc
mov edx, 0x4000
mov dword [ebp - 0x24], edx
test bl, bl
jne 0x4be9c1
mov bl, byte [ebp - 0x10]
mov esi, edx
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x18], 0
test bl, bl
je 0x4be8ea
mov eax, dword [edi + 0x26c]
mov ecx, edx
cmp edx, eax
cmovge ecx, eax
jmp 0x4be8f0
mov ecx, dword [edi + 0x26c]
push ecx
mov ecx, dword [edi + 0x258]
push 0
call fcn.00410bb0
mov ecx, eax
mov dword [ebp - 0x28], ecx
mov eax, dword [edi + 0x270]
test eax, eax
je 0x4be916
cmp byte [eax], 0
jne 0x4be9a7
mov eax, dword [edi + 0x26c]
test bl, bl
je 0x4be925
cmp esi, eax
cmovl eax, esi
lea edx, [ebp - 0x14]
push edx
push eax
push ecx
push dword [ebp - 0x1c]
call dword [sym.imp.WININET.dll_InternetReadFile]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x4be994
mov ecx, dword [ebp - 0x18]
add ecx, eax
mov eax, dword [edi + 0x26c]
mov dword [ebp - 0x18], ecx
test bl, bl
je 0x4be955
cmp esi, eax
cmovl eax, esi
push eax
push ecx
mov ecx, dword [edi + 0x258]
call fcn.00410bb0
mov ecx, dword [edi + 0x264]
mov dword [ebp - 0x28], eax
test ecx, ecx
je 0x4be987
push dword [edi + 0x268]
or eax, 0xffffffff
test bl, bl
cmovne eax, dword [ebp - 0x24]
push eax
push dword [ebp - 0x18]
call ecx
add esp, 0xc
mov eax, dword [ebp - 0x14]
test bl, bl
je 0x4be994
sub esi, eax
test esi, esi
jle 0x4be9ad
mov ecx, dword [ebp - 0x10]
test ecx, ecx
je 0x4be9b0
test eax, eax
je 0x4be9b0
mov ecx, dword [ebp - 0x28]
jmp 0x4be903
mov byte [ebp - 1], 0
jmp 0x4be9d4
mov ecx, dword [ebp - 0x10]
mov eax, dword [ebp - 0x18]
test ecx, ecx
mov dword [edi + 0x25c], eax
setne byte [ebp - 1]
jmp 0x4be9d4
push dword [ebp - 0x10]
mov ecx, edi
push edx
mov edx, esi
call fcn.004be320
add esp, 8
mov byte [ebp - 1], al
mov eax, dword [ebp - 0x1c]
test eax, eax
je 0x4be9e2
push eax
call dword [sym.imp.WININET.dll_InternetCloseHandle]
push dword [ebp - 8]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov al, byte [ebp - 1]
test al, al
jne 0x4bea23
mov dword [edi + 0x25c], 0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov al, byte [ebp - 1]
mov dword [edi + 0x25c], 0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [edi + 0x260], 2
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret