Function at 0x10004310
Capabilities:
Check internet connectivity via wininet
Create http request
Get http content length
Read data from internet
Receive data

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x10029a6c
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
push ecx
mov eax, 0x21e4
call fcn.10013090
mov eax, dword [0x10035a8c]
push ebx
push esi
push edi
mov ebx, ecx
push 0x1002b599
lea ecx, [esp + 0x10]
mov dword [esp + 0x21f0], eax
call fcn.10002a00
mov edi, dword [ebp + 0xc]
push edi
lea eax, [esp + 0x10]
push str._SD__downloader_state:_begin_download_file:_s
push eax
mov dword [esp + 0x2208], 0
call fcn.100029a0
add esp, 0xc
push 0x116
push 0x5c
push str..Downloader.cpp
call fcn.10012fc0
add esp, 8
inc eax
push eax
push str._s:_d
call fcn.10007550
mov ecx, dword [esp + 0x18]
push ecx
call fcn.10007550
mov esi, dword [ebp + 8]
push esi
lea edx, [esp + 0x20]
push str._SD__downloader_state:_download_by_URL:_s
push edx
call fcn.100029a0
add esp, 0x1c
push 0x118
push 0x5c
push str..Downloader.cpp
call fcn.10012fc0
add esp, 8
inc eax
push eax
push str._s:_d
call fcn.10007550
mov eax, dword [esp + 0x18]
push eax
call fcn.10007550
add esp, 0x10
test esi, esi
je 0x10004a8d
test edi, edi
je 0x10004a8d
push 0
lea ecx, [esp + 0x3c]
push ecx
call dword [sym.imp.WININET.dll_InternetGetConnectedState]
push 0x11f
push 0x5c
push str..Downloader.cpp
call fcn.10012fc0
add esp, 8
inc eax
push eax
push str._s:_d
call fcn.10007550
push str._SD__downloader_state:_get_internet_connect_state_ok.
call fcn.10007550
mov al, byte [esp + 0x48]
add esp, 0x10
test al, 4
push 0
push 0
push 0
jne 0x1000443f
push 4
jmp 0x10004441
push 0
push str.Mozilla_4.0__compatible__MSIE_6.0__Windows_NT_5.0__MyIE2__.NET_CLR_1.1.4322_
call dword [sym.imp.WININET.dll_InternetOpenA]
test eax, eax
mov dword [esp + 0x14], eax
jne 0x100044a5
push 0x12a
push 0x5c
push str..Downloader.cpp
call fcn.10012fc0
add esp, 8
inc eax
push eax
push str._s:_d
call fcn.10007550
push str._SD__downloader__state:_internet_open_failed.
call fcn.10007550
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff0
add esp, 0x10
mov dword [esp + 0x21fc], 0xffffffff
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jmp 0x10004aac
push 0x12e
push 0x5c
push str..Downloader.cpp
call fcn.10012fc0
add esp, 8
inc eax
push eax
push str._s:_d
call fcn.10007550
push str._SD__downloader__state:_internet_open_ok.
call fcn.10007550
mov ecx, 0x25
mov esi, str.Accept:__r_nAccept_Language:zh_cn_r_nAccept_Encoding:gzip_deflate_r_nUser_Agent:Mozilla_4.0__compatible_MSIE_6.0_Windows_NT_5.0_MyIE2_.NET_CLR_1.1.4322_
lea edi, [esp + 0x2058]
rep movsd dword es:[edi], dword [esi]
lea eax, [esp + 0x2058]
add esp, 0x10
movsb byte es:[edi], byte [esi]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x100044f0
mov ecx, dword [ebp + 8]
mov edi, dword [esp + 0x14]
push 0
push 0x84000100
sub eax, edx
push eax
lea eax, [esp + 0x2054]
push eax
push ecx
push edi
call dword [sym.imp.WININET.dll_InternetOpenUrlA]
mov esi, eax
test esi, esi
mov dword [esp + 0x44], esi
jne 0x1000457a
push 0x135
push 0x5c
push str..Downloader.cpp
call fcn.10012fc0
add esp, 8
inc eax
push eax
push str._s:_d
call fcn.10007550
push str._SD__downloader_state:_open_url_failed.
call fcn.10007550
add esp, 0x10
push edi
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov eax, dword [esp + 0xc]
add eax, 0xfffffff0
mov dword [esp + 0x21fc], 0xffffffff
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jmp 0x10004aac
push 0x139
push 0x5c
push str..Downloader.cpp
call fcn.10012fc0
add esp, 8
inc eax
push eax
push str._s:_d
call fcn.10007550
push str._SD__downloader_state:_open_url_ok.
call fcn.10007550
add esp, 0x10
push 0
lea eax, [esp + 0x40]
push eax
lea ecx, [esp + 0x28]
push ecx
push 0x20000005
push esi
mov dword [esp + 0x34], 0
mov dword [esp + 0x50], 4
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
test eax, eax
jne 0x10004615
push 0x140
push 0x5c
push str..Downloader.cpp
call fcn.10012fc0
add esp, 8
inc eax
push eax
push str._s:_d
call fcn.10007550
push str._SD__downloader_state:_query_file_information_failed.
call fcn.10007550
add esp, 0x10
push edi
call dword [sym.imp.WININET.dll_InternetCloseHandle]
lea ecx, [esp + 0xc]
call fcn.10001b40
jmp 0x10004ab6
push 0x145
push 0x5c
push str..Downloader.cpp
call fcn.10012fc0
add esp, 8
inc eax
push eax
push str._s:_d
call fcn.10007550
push str._SD__downloader_state:_query_file_information_ok.
call fcn.10007550
mov eax, dword [esp + 0x30]
add esp, 0x10
test eax, eax
jne 0x10004685
push 0x149
push 0x5c
push str..Downloader.cpp
call fcn.10012fc0
add esp, 8
inc eax
push eax
push str._s:_d
call fcn.10007550
push str._SD__downloader_state:_file_size_is_zero.
call fcn.10007550
add esp, 0x10
lea ecx, [esp + 0xc]
call fcn.10001b40
jmp 0x10004ab6
push 0x1002b599
lea ecx, [esp + 0x1c]
call fcn.10002a00
mov edx, dword [esp + 0x20]
push edx
lea eax, [esp + 0x1c]
push str._SD__downloader_state:__file_size___d_
push eax
mov byte [esp + 0x2208], 1
call fcn.100029a0
add esp, 0xc
push 0x150
push 0x5c
push str..Downloader.cpp
call fcn.10012fc0
add esp, 8
inc eax
push eax
push str._s:_d
call fcn.10007550
mov ecx, dword [esp + 0x24]
push ecx
call fcn.10007550
xor eax, eax
add esp, 0x10
mov ecx, 0x41
lea edi, [esp + 0x20e0]
rep stosd dword es:[edi], eax
push ebx
lea ecx, [esp + 0x20]
call fcn.10002a00
push 1
lea edx, [esp + 0x44]
push edx
lea ecx, [esp + 0x24]
mov byte [esp + 0x2204], 2
call fcn.10003680
push 0x1002b7d4
push eax
call fcn.100035e0
add esp, 8
lea ecx, [esp + 0x40]
mov byte [esp + 0x13], al
call fcn.10001b40
mov al, byte [esp + 0x13]
test al, al
je 0x1000477f
mov eax, dword [ebp + 0xc]
mov edx, eax
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x10004740
mov edi, ebx
sub eax, edx
dec edi
lea esp, [esp]
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x10004750
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
lea edx, [esp + 0x20e0]
rep movsb byte es:[edi], byte [esi]
mov eax, ebx
sub edx, ebx
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x10004773
jmp 0x100047cf
mov edi, ebx
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x10004782
mov ax, word [0x1002b7d4]
mov word [edi], ax
mov eax, dword [ebp + 0xc]
mov esi, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x10004798
mov edi, ebx
sub eax, esi
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x100047a4
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
lea edx, [esp + 0x20e0]
rep movsb byte es:[edi], byte [esi]
mov eax, ebx
sub edx, ebx
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x100047c5
lea ecx, [esp + 0x20e0]
push ecx
lea edx, [esp + 0x10]
push str._SD__downloader_state:_file_save_path_:__s
push edx
call fcn.100029a0
add esp, 0xc
push 0x163
push 0x5c
push str..Downloader.cpp
call fcn.10012fc0
add esp, 8
inc eax
push eax
push str._s:_d
call fcn.10007550
mov eax, dword [esp + 0x18]
push eax
call fcn.10007550
add esp, 0x10
lea ecx, [esp + 0x28]
call fcn.100206d7
push 0
push 0x1001
lea ecx, [esp + 0x20e8]
push ecx
lea ecx, [esp + 0x34]
mov byte [esp + 0x2208], 3
call fcn.1002096f
test eax, eax
jne 0x10004880
push 0x168
push 0x5c
push str..Downloader.cpp
call fcn.10012fc0
add esp, 8
inc eax
push eax
push str._s:_d
call fcn.10007550
push str._SD__downloader_state:_create_file_failed.
call fcn.10007550
mov edx, dword [esp + 0x24]
add esp, 0x10
push edx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
jmp 0x100049b2
push 0x16e
push 0x5c
push str..Downloader.cpp
call fcn.10012fc0
add esp, 8
inc eax
push eax
push str._s:_d
call fcn.10007550
push str._SD__downloader_state:_create_file_ok.
call fcn.10007550
mov esi, dword [sym.imp.WININET.dll_InternetReadFile]
xor eax, eax
add esp, 0x10
mov ecx, 0x200
lea edi, [esp + 0x48]
rep stosd dword es:[edi], eax
mov edi, dword [esp + 0x44]
mov dword [esp + 0x24], eax
lea eax, [esp + 0x24]
push eax
push 0x800
lea ecx, [esp + 0x50]
push ecx
push edi
call esi
test eax, eax
je 0x10004971
push 0x17e
push 0x5c
push str..Downloader.cpp
call fcn.10012fc0
add esp, 8
inc eax
push eax
push str._s:_d
call fcn.10007550
push str._SD__downloader_state:_read_data_from_internet_ok.
call fcn.10007550
mov eax, dword [esp + 0x34]
add esp, 0x10
test eax, eax
je 0x100049e3
push eax
lea edx, [esp + 0x4c]
push edx
lea ecx, [esp + 0x30]
call fcn.1002042a
push 0x187
push 0x5c
push str..Downloader.cpp
call fcn.10012fc0
add esp, 8
inc eax
push eax
push str._s:_d
call fcn.10007550
push str._SD__downloader_state:_write_data_to_local_file.
call fcn.10007550
add esp, 0x10
lea eax, [esp + 0x24]
push eax
push 0x800
lea ecx, [esp + 0x50]
push ecx
push edi
call esi
test eax, eax
jne 0x100048e2
lea ecx, [esp + 0x28]
call fcn.10020675
mov edx, dword [esp + 0x14]
push edx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
push 0x179
push 0x5c
push str..Downloader.cpp
call fcn.10012fc0
add esp, 8
inc eax
push eax
push str._s:_d
call fcn.10007550
push str._SD__downloader_state:_read_data_from_internet_failed.
call fcn.10007550
add esp, 0x10
lea ecx, [esp + 0x28]
mov byte [esp + 0x21fc], 2
call fcn.10020716
lea ecx, [esp + 0x1c]
call fcn.10001b40
lea ecx, [esp + 0x18]
call fcn.10001b40
lea ecx, [esp + 0xc]
call fcn.10001b40
jmp 0x10004ab6
push 0x181
push 0x5c
push str..Downloader.cpp
call fcn.10012fc0
add esp, 8
inc eax
push eax
push str._s:_d
call fcn.10007550
push str._SD__downloader_state:_recv_end_flag._download_ok.
call fcn.10007550
add esp, 0x10
lea ecx, [esp + 0x28]
call fcn.10020510
lea ecx, [esp + 0x28]
call fcn.10020675
mov eax, dword [esp + 0x14]
push eax
call dword [sym.imp.WININET.dll_InternetCloseHandle]
push 0x190
push 0x5c
push str..Downloader.cpp
call fcn.10012fc0
add esp, 8
inc eax
push eax
push str._s:_d
call fcn.10007550
push str._SD__downloader_state:_return_in__BOOL_DownloadPatch_const_char_lpszUrl_const_char_lpszLocalFileName__
call fcn.10007550
add esp, 0x10
lea ecx, [esp + 0x28]
mov byte [esp + 0x21fc], 2
call fcn.10020716
lea ecx, [esp + 0x1c]
call fcn.10001b40
lea ecx, [esp + 0x18]
call fcn.10001b40
lea ecx, [esp + 0xc]
call fcn.10001b40
mov eax, 1
jmp 0x10004ab8
mov eax, dword [esp + 0xc]
add eax, 0xfffffff0
mov dword [esp + 0x21fc], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x10004ab6
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
call dword [edx + 4]
xor eax, eax
mov ecx, dword [esp + 0x21f4]
mov dword fs:[0], ecx
mov ecx, dword [esp + 0x21ec]
call fcn.1001291b
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8