Function at 0x4012da
Capabilities:
Connect to http server
Create http request
Download and write a file
Print debug messages
Read data from internet
Receive and write data from server to client
Receive data
Reference http user-agent string
Write file on windows

Disassembly:
jmp 0x403ffa
push ebp
lea ebp, [esp - 0x17ec]
mov eax, 0x17ec
call fcn.004071a0
push 0xffffffffffffffff
push 0x4326ef
mov eax, dword fs:[0]
push eax
sub esp, 0x14
mov eax, dword [0x43e1e4]
xor eax, ebp
mov dword [ebp + 0x17e8], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, dword [ebp + 0x1814]
push edi
mov dword [ebp - 4], 4
call fcn.004074d5
pop ecx
xor ebx, ebx
push ebx
push ebx
push ebx
push ebx
push str.Mozilla_5.0__Windows_NT_6.1__AppleWebKit_536.5__KHTML__like_Gecko__Chrome_19.0.1084.46_Safari_536.5
mov esi, eax
call dword [sym.imp.WININET.dll_InternetOpenW]
cmp eax, ebx
mov dword [ebp - 0x20], eax
jne 0x4040d5
push str._Statistics__Upload__Failed_to_open_hSession_handle_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
push ebx
push 1
lea ecx, [ebp + 0x17f4]
call fcn.0040122b
mov ecx, dword [ebp + 0x1810]
add ecx, 0xfffffff0
call fcn.0040101e
lea ecx, [edi - 0x10]
call fcn.0040101e
mov ecx, dword [ebp + 0x1818]
add ecx, 0xfffffff0
call fcn.0040101e
mov ecx, dword [ebp + 0x181c]
add ecx, 0xfffffff0
call fcn.0040101e
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x17e8]
xor ecx, ebp
call fcn.00406c83
add ebp, 0x17ec
leave
ret
push ebx
push ebx
push 3
push ebx
push ebx
push esi
mov esi, dword [ebp + 0x1810]
push esi
push eax
call dword [sym.imp.WININET.dll_InternetConnectW]
cmp eax, ebx
mov dword [ebp - 0x1c], eax
jne 0x404112
push str._Statistics__Upload__Failed_to_open_hConnect_handle_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
push ebx
push 1
lea ecx, [ebp + 0x17f4]
call fcn.0040122b
lea ecx, [esi - 0x10]
jmp 0x404087
push ebx
push ebx
push ebx
push ebx
push ebx
push dword [ebp + 0x1818]
push str.POST
push eax
call dword [sym.imp.WININET.dll_HttpOpenRequestW]
cmp eax, ebx
mov dword [ebp - 0x14], eax
jne 0x404143
push str._Statistics__Upload__Failed_to_open_request_handle_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
mov byte [ebp - 0xd], bl
jmp 0x4042c1
mov esi, dword [sym.imp.WININET.dll_HttpAddRequestHeadersW]
mov edi, 0xa0000000
push edi
push 0xffffffffffffffff
push str.Content_type:_application_x_www_form_urlencoded_r_n
push eax
call esi
push edi
push 0xffffffffffffffff
push str.Accept:__r_n
push dword [ebp - 0x14]
call esi
push edi
push 0xffffffffffffffff
push str.Accept_Charset:utf_8_r_n
push dword [ebp - 0x14]
call esi
push edi
mov edi, dword [ebp - 0x14]
push 0xffffffffffffffff
push str.Accept_Language:zh_CN_r_n
push edi
call esi
sub esp, 0x1c
lea eax, [ebp + 0x17f4]
mov ecx, esp
mov dword [ebp - 0x18], esp
push eax
call fcn.00401339
push ebx
push edi
call fcn.00401217
add esp, 0x24
cmp al, bl
je 0x40429f
mov eax, dword [ebp + 0x181c]
cmp dword [eax - 0xc], ebx
mov byte [ebp - 0xd], 1
je 0x40423b
push ebx
push 0x80
push 2
push ebx
push ebx
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x4042a2
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x18], ebx
push 0x3e7
lea eax, [ebp + 0x1401]
push ebx
push eax
mov byte [ebp + 0x1400], bl
call fcn.00407250
add esp, 0xc
lea eax, [ebp - 0x14]
push eax
push 0x3e8
lea eax, [ebp + 0x1400]
push eax
push edi
call dword [sym.imp.WININET.dll_InternetReadFile]
cmp eax, ebx
je 0x40422d
push ebx
lea eax, [ebp - 0x18]
push eax
push dword [ebp - 0x14]
lea eax, [ebp + 0x1400]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [ebp - 0x14], ebx
jne 0x4041e1
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4042a2
push 0x13ff
lea eax, [ebp + 1]
push ebx
push eax
mov dword [ebp - 0x14], ebx
mov byte [ebp], bl
call fcn.00407250
add esp, 0xc
lea eax, [ebp - 0x14]
push eax
push 0x1400
lea eax, [ebp]
push eax
push edi
call dword [sym.imp.WININET.dll_InternetReadFile]
cmp eax, ebx
je 0x4042a2
cmp dword [ebp - 0x14], ebx
jbe 0x4042a2
lea eax, [ebp]
push eax
lea ecx, [ebp - 0x18]
call fcn.0040112c
push ebx
push str._s_o__s_
lea ecx, [ebp - 0x18]
call fcn.004011c7
cmp eax, 0xffffffff
jne 0x404292
mov byte [ebp - 0xd], bl
mov ecx, dword [ebp - 0x18]
add ecx, 0xfffffff0
call fcn.0040101e
jmp 0x4042a2
mov byte [ebp - 0xd], bl
push edi
call dword [sym.imp.WININET.dll_InternetCloseHandle]
test eax, eax
jne 0x4042bb
push str._Statistics__Upload__Failed_to_close_Request_handle_n
mov byte [ebp - 0xd], bl
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
mov edi, dword [ebp + 0x1814]
push dword [ebp - 0x1c]
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
test eax, eax
jne 0x4042de
push str._Statistics__Upload__Failed_to_close_Connect_handle_n
mov byte [ebp - 0xd], bl
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
push dword [ebp - 0x20]
call esi
test eax, eax
jne 0x40433d
push str._Statistics__Upload__Failed_to_close_Session_handle_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
mov byte [ebp - 0xd], bl
push ebx
push 1
lea ecx, [ebp + 0x17f4]
call fcn.0040122b
mov ecx, dword [ebp + 0x1810]
add ecx, 0xfffffff0
call fcn.0040101e
lea ecx, [edi - 0x10]
call fcn.0040101e
mov ecx, dword [ebp + 0x1818]
add ecx, 0xfffffff0
call fcn.0040101e
mov ecx, dword [ebp + 0x181c]
add ecx, 0xfffffff0
call fcn.0040101e
mov al, byte [ebp - 0xd]
jmp 0x4040b2
push 0x43f84c
lea ecx, [ebp - 0x18]
call fcn.00401253
movzx eax, byte [ebp - 0xd]
push eax
lea eax, [ebp - 0x18]
push str._Statistics__Upload__bReturn___d
push eax
mov byte [ebp - 4], 5
call fcn.00401122
mov esi, dword [ebp - 0x18]
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
lea ecx, [esi - 0x10]
call fcn.0040101e
mov al, byte [ebp - 0xd]
mov byte [ebp - 0xd], al
jmp 0x4042f5