Function at 0x402b90
Capabilities:
Check http status code
Create http request
Download and write a file
Get http content length
Read data from internet
Receive and write data from server to client
Receive data
Set file attributes
Write file on windows

Disassembly:
sub esp, 0x134
mov eax, dword [0x45b660]
xor eax, esp
mov dword [esp + 0x130], eax
push ebx
push ebp
mov ebp, dword [esp + 0x140]
push esi
push edi
xor ebx, ebx
push 0xff
lea eax, [esp + 0x45]
push ebx
push eax
mov dword [esp + 0x3c], ebp
xor esi, esi
mov byte [esp + 0x1f], bl
mov dword [esp + 0x20], ebx
mov dword [esp + 0x40], 4
mov byte [esp + 0x4c], bl
call fcn.0041cd40
add esp, 0xc
push 0x80
push ebp
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
push ebx
push 0x80
push 2
push ebx
push ebx
push 0x40000000
push ebp
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
mov dword [esp + 0x18], edi
jne 0x402c12
xor al, al
jmp 0x402de5
push 0
push 0
push 0
push 0
push 0
call dword [sym.imp.WININET.dll_InternetOpenW]
mov ebp, eax
test ebp, ebp
mov dword [esp + 0x38], ebp
je 0x402db2
mov esi, dword [sym.imp.WININET.dll_InternetSetOptionW]
push 4
lea ecx, [esp + 0x20]
push ecx
push 2
push ebp
mov dword [esp + 0x2c], 0x4e20
call esi
push 4
lea edx, [esp + 0x20]
push edx
push 5
push ebp
call esi
push 4
lea eax, [esp + 0x20]
push eax
push 6
push ebp
call esi
push 0
push 0x84000000
push 0
push 0
push str.http:__config.pinyin.sogou.com_skins_rand.ssf
push ebp
call dword [sym.imp.WININET.dll_InternetOpenUrlW]
mov esi, eax
test esi, esi
je 0x402db2
mov edi, dword [sym.imp.WININET.dll_HttpQueryInfoW]
push 0
lea ecx, [esp + 0x2c]
push ecx
lea edx, [esp + 0x28]
push edx
push 0x20000013
push esi
mov dword [esp + 0x34], ebx
mov dword [esp + 0x3c], 4
call edi
test eax, eax
je 0x402dae
cmp dword [esp + 0x20], 0xc8
jne 0x402dae
push 0
lea eax, [esp + 0x40]
push eax
lea ecx, [esp + 0x48]
push ecx
push 1
push esi
mov dword [esp + 0x50], 0xff
call edi
push 0
lea edx, [esp + 0x38]
push edx
lea eax, [esp + 0x1c]
push eax
push 0x20000005
push esi
call edi
test eax, eax
jne 0x402cf6
mov dword [esp + 0x14], ebx
jmp 0x402d21
mov ecx, dword [esp + 0x14]
test ecx, ecx
je 0x402d21
mov eax, 0x51eb851f
mul ecx
mov ebp, edx
shr ebp, 4
cmp ebp, 0x400
jae 0x402d19
mov ebp, 0x400
jmp 0x402d26
cmp ebp, 0x100000
jbe 0x402d26
mov ebp, 0x100000
push ebp
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
xor eax, eax
test eax, eax
mov dword [esp + 0x24], eax
jbe 0x402d5e
mov edx, dword [esp + 0x18]
push 0
lea ecx, [esp + 0x30]
push ecx
push eax
push ebx
push edx
mov dword [esp + 0x40], 0
call dword [sym.imp.KERNEL32.dll_WriteFile]
lea eax, [esp + 0x24]
push eax
push ebp
push ebx
push esi
call dword [sym.imp.WININET.dll_InternetReadFile]
mov edi, eax
test edi, edi
je 0x402d7a
mov eax, dword [esp + 0x24]
test eax, eax
ja 0x402d42
mov ecx, dword [esp + 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebp, dword [esp + 0x30]
push 0x10000000
push 1
push ebp
call fcn.00439900
push 1
push ebp
call fcn.004396a0
mov ebp, dword [esp + 0x4c]
add esp, 0x14
test edi, edi
setne byte [esp + 0x13]
jmp 0x402db9
mov edi, dword [esp + 0x18]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
mov edi, dword [sym.imp.WININET.dll_InternetCloseHandle]
je 0x402dc6
push esi
call edi
test ebp, ebp
je 0x402dcd
push ebp
call edi
test ebx, ebx
je 0x402de1
push ebx
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov al, byte [esp + 0x13]
mov ecx, dword [esp + 0x140]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0041b397
add esp, 0x134
ret