Function at 0x409513
Capabilities:
Check http status code
Connect to http server
Create http request
Query remote server for available data
Read data from internet
Receive data
Send data
Send http request

Disassembly:
mov eax, 0x56c80b
call fcn.0055a6a0
mov eax, 0x102cc
call fcn.0050b430
push ebx
push esi
xor ebx, ebx
test byte [0x6265a4], 1
push edi
mov edi, 0x5bbe28
jne 0x409559
or dword [0x6265a4], 1
mov dword [ebp - 4], ebx
push edi
call fcn.00504d8b
mov esi, eax
pop ecx
mov dword [0x6265a0], esi
or dword [ebp - 4], 0xffffffff
jmp 0x40955f
mov esi, dword [0x6265a0]
mov ecx, dword [ebp + 0xc]
push esi
push ebx
push edi
call fcn.00408d5d
cmp eax, ebx
jl 0x409572
add esi, eax
jmp 0x409574
xor esi, esi
mov ecx, dword [ebp + 0xc]
push esi
push ebx
lea eax, [ebp - 0x7c]
push eax
call fcn.0040208e
mov dword [ebp - 4], 1
cmp esi, ebx
jle 0x409602
cmp dword [ebp - 0x64], 8
mov eax, dword [ebp - 0x78]
jae 0x409599
lea eax, [ebp - 0x78]
push esi
mov edi, str.http:__
push edi
push eax
call fcn.00508111
add esp, 0xc
test eax, eax
je 0x409602
cmp dword [ebp + 0x10], ebx
je 0x4095e2
cmp dword [ebp - 0x64], 8
mov eax, dword [ebp - 0x78]
jae 0x4095be
lea eax, [ebp - 0x78]
push edi
push eax
push str.CHECK_PROTOCOL_ERROR
push ecx
call fcn.004032e1
pop ecx
mov esi, eax
call fcn.0040582a
mov ecx, dword [ebp + 0x10]
push eax
push 2
pop esi
call fcn.00420490
add esp, 0xc
or dword [ebp - 4], 0xffffffff
push ebx
push 1
lea ecx, [ebp - 0x7c]
call fcn.00403580
xor al, al
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
leave
ret
push 7
pop edi
push ebx
lea ecx, [ebp - 0x60]
mov dword [ebp - 0x48], edi
call fcn.00403667
mov byte [ebp - 4], 2
push ebx
lea ecx, [ebp - 0x3c]
mov dword [ebp - 0x24], edi
call fcn.00403667
mov byte [ebp - 4], 3
mov ecx, dword [ebp + 0xc]
push 1
push esi
lea eax, [ebp - 0x20]
push eax
mov dword [ebp - 0x20], 0x2f
call fcn.00408d5d
mov ecx, dword [ebp + 0xc]
mov edi, eax
cmp edi, ebx
jle 0x409691
sub eax, esi
push eax
push esi
lea eax, [ebp - 0x98]
push eax
call fcn.0040208e
mov byte [ebp - 4], 4
push 0xffffffffffffffff
push ebx
push eax
lea ecx, [ebp - 0x60]
call fcn.00403685
mov byte [ebp - 4], 3
push ebx
push 1
lea ecx, [ebp - 0x98]
call fcn.00403580
mov ecx, dword [ebp + 0xc]
push 0xffffffffffffffff
push edi
lea eax, [ebp - 0x98]
push eax
call fcn.0040208e
mov byte [ebp - 4], 5
lea ecx, [ebp - 0x3c]
jmp 0x4096a7
push 0xffffffffffffffff
push esi
lea eax, [ebp - 0x98]
push eax
call fcn.0040208e
mov byte [ebp - 4], 6
lea ecx, [ebp - 0x60]
push 0xffffffffffffffff
push ebx
push eax
call fcn.00403685
mov byte [ebp - 4], 3
push ebx
push 1
lea ecx, [ebp - 0x98]
call fcn.00403580
push ebx
push ebx
push ebx
push 1
push str.YmirPatcherv2.0.1
call dword [sym.imp.WININET.dll_InternetOpenW]
mov dword [ebp - 0x20], eax
cmp eax, ebx
jne 0x409727
cmp dword [ebp + 0x10], ebx
je 0x409704
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.INTERNET_OPEN_ERROR
call fcn.004032e1
mov esi, eax
call fcn.0040582a
mov ecx, dword [ebp + 0x10]
push eax
push 2
pop esi
call fcn.00420490
pop ecx
pop ecx
mov byte [ebp - 4], 2
push ebx
push 1
lea ecx, [ebp - 0x3c]
call fcn.00403580
mov byte [ebp - 4], 1
push ebx
push 1
lea ecx, [ebp - 0x60]
call fcn.00403580
jmp 0x4095e2
mov eax, dword [ebp - 0x5c]
push 8
pop edi
cmp dword [ebp - 0x48], edi
jae 0x409735
lea eax, [ebp - 0x5c]
push ebx
push ebx
push 3
push ebx
push ebx
push 0x50
push eax
push dword [ebp - 0x20]
call dword [sym.imp.WININET.dll_InternetConnectW]
mov dword [ebp - 0x44], eax
cmp eax, ebx
jne 0x40978d
cmp dword [ebp + 0x10], ebx
je 0x409704
mov esi, dword [ebp - 0x5c]
cmp dword [ebp - 0x48], edi
jae 0x40975e
lea esi, [ebp - 0x5c]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
push str.INTERNET_CONNECT_ERROR
push ecx
call fcn.004032e1
pop ecx
mov esi, eax
call fcn.0040582a
mov ecx, dword [ebp + 0x10]
push eax
push 2
pop esi
call fcn.00420490
add esp, 0xc
jmp 0x409704
mov eax, dword [ebp - 0x38]
cmp dword [ebp - 0x24], edi
jae 0x409798
lea eax, [ebp - 0x38]
push ebx
push SysReAllocString
push ebx
push ebx
push str.HTTP_1.0
push eax
push 0x5bbeec
push dword [ebp - 0x44]
call dword [sym.imp.WININET.dll_HttpOpenRequestW]
mov esi, eax
mov dword [ebp - 0x1c], esi
cmp esi, ebx
jne 0x4097e0
cmp dword [ebp + 0x10], ebx
je 0x409704
mov esi, dword [ebp - 0x38]
cmp dword [ebp - 0x24], edi
jae 0x4097d1
lea esi, [ebp - 0x38]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
push str.HTTP_OPEN_REQUEST_ERROR
jmp 0x40976b
push 0x200
lea eax, [ebp - 0x2d8]
push ebx
push eax
call fcn.00507370
add esp, 0xc
push ebx
push ebx
push ebx
lea eax, [ebp - 0x2d8]
push eax
push esi
call dword [sym.imp.WININET.dll_HttpSendRequestW]
test eax, eax
jne 0x409830
cmp dword [ebp + 0x10], ebx
je 0x409704
mov esi, dword [ebp - 0x38]
cmp dword [ebp - 0x24], edi
jae 0x40981e
lea esi, [ebp - 0x38]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
push str.HTTP_SEND_REQUEST_ERROR
jmp 0x40976b
push 0x40
pop edi
push edi
lea eax, [ebp - 0xd8]
push ebx
push eax
call fcn.00507370
add esp, 0xc
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0xd8]
push eax
push 0x13
push esi
mov esi, dword [sym.imp.WININET.dll_HttpQueryInfoW]
mov dword [ebp - 0x14], edi
mov dword [ebp - 0x18], ebx
call esi
test eax, eax
jne 0x40988f
cmp dword [ebp + 0x10], ebx
je 0x409704
cmp dword [ebp - 0x24], 8
mov esi, dword [ebp - 0x38]
jae 0x40987d
lea esi, [ebp - 0x38]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
push str.HTTP_QUERY_STATUS_CODE_ERROR
jmp 0x40976b
lea eax, [ebp - 0xd8]
push eax
call fcn.005081b7
pop ecx
cmp eax, 0xc8
je 0x4098e6
cmp dword [ebp + 0x10], ebx
je 0x409704
cmp dword [ebp - 0x24], 8
mov esi, dword [ebp - 0x38]
jae 0x4098b8
lea esi, [ebp - 0x38]
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
push str.HTTP_QUERY_STATUS_NOT_OK
call fcn.004032e1
mov esi, eax
call fcn.0040582a
push eax
mov ecx, dword [ebp + 0x10]
push 2
pop esi
call fcn.00420490
add esp, 0x10
jmp 0x409704
push edi
lea eax, [ebp - 0xd8]
push ebx
push eax
call fcn.00507370
add esp, 0xc
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0xd8]
push eax
push 5
push dword [ebp - 0x1c]
mov dword [ebp - 0x14], edi
mov dword [ebp - 0x18], ebx
call esi
test eax, eax
jne 0x40994f
cmp dword [ebp + 0x10], ebx
je 0x409704
cmp dword [ebp - 0x24], 8
mov esi, dword [ebp - 0x38]
jae 0x40992c
lea esi, [ebp - 0x38]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
push str.HTTP_QUERY_CONTENT_LENGTH_ERROR
push ecx
call fcn.004032e1
pop ecx
mov esi, eax
call fcn.0040582a
push eax
push str._s__path_s__error_d_
jmp 0x4098d3
lea eax, [ebp - 0xd8]
push eax
call fcn.005081cd
mov esi, dword [ebp + 8]
pop ecx
push eax
mov ecx, esi
mov dword [ebp - 0x18], eax
call fcn.00409ae1
call fcn.00409a5f
mov esi, dword [sym.imp.WININET.dll_InternetQueryDataAvailable]
xor edi, edi
jmp 0x4099be
mov eax, 0x10000
cmp dword [ebp - 0x40], eax
jae 0x409986
mov eax, dword [ebp - 0x40]
lea ecx, [ebp - 0x14]
push ecx
push eax
lea eax, [ebp - 0x102d8]
push eax
push dword [ebp - 0x1c]
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x4099e8
cmp dword [ebp - 0x14], ebx
je 0x4099cd
push dword [ebp - 0x14]
mov ecx, dword [ebp + 8]
lea eax, [ebp - 0x102d8]
push eax
call fcn.004079fe
add edi, dword [ebp - 0x14]
cmp edi, dword [ebp - 0x18]
jae 0x4099cd
push ebx
push ebx
lea eax, [ebp - 0x40]
push eax
push dword [ebp - 0x1c]
call esi
test eax, eax
jne 0x409979
push dword [ebp - 0x1c]
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
push dword [ebp - 0x44]
call esi
push dword [ebp - 0x20]
call esi
mov byte [ebp - 0xd], 1
jmp 0x409a2a
cmp dword [ebp + 0x10], ebx
je 0x409a27
cmp dword [ebp - 0x24], 8
mov esi, dword [ebp - 0x38]
jae 0x4099f9
lea esi, [ebp - 0x38]
push dword [ebp - 0x18]
push edi
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
push str.INTERNET_READ_FILE_ERROR
push ecx
call fcn.004032e1
pop ecx
mov esi, eax
call fcn.0040582a
mov ecx, dword [ebp + 0x10]
push eax
push 2
pop esi
call fcn.00420490
add esp, 0x14
mov byte [ebp - 0xd], bl
mov byte [ebp - 4], 2
push ebx
push 1
lea ecx, [ebp - 0x3c]
call fcn.00403580
mov byte [ebp - 4], 1
push ebx
push 1
lea ecx, [ebp - 0x60]
call fcn.00403580
or dword [ebp - 4], 0xffffffff
push ebx
push 1
lea ecx, [ebp - 0x7c]
call fcn.00403580
mov al, byte [ebp - 0xd]
jmp 0x4095f3