Function at 0x402f80
Capabilities:
Connect socket
Initialize winsock library
Receive data
Receive data on socket
Resolve dns
Send data
Send data on socket
Send http request
Send http request with host header

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x413238
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x5f0
mov eax, dword [0x41b5c0]
push ebx
push esi
mov dword [esp + 0x5f0], eax
push edi
lea eax, [esp + 0x460]
push eax
push 0x202
call dword [0x4153cc]
test eax, eax
je 0x402fd7
call dword [0x4153d8]
mov ecx, dword [ebp + 0xc]
mov dword [ecx], eax
jmp 0x4031dd
xor esi, esi
push esi
push 1
push 2
call dword [0x4153ec]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x402ffb
call dword [0x4153d8]
mov edx, dword [ebp + 0xc]
mov dword [edx], eax
jmp 0x4031dd
push str.update.kankan.xunlei.com
call dword [0x4153c8]
cmp eax, esi
je 0x40303c
mov word [esp + 0x48], 2
mov edx, dword [eax + 0xc]
mov eax, dword [edx]
mov ecx, dword [eax]
push 0x50
mov dword [esp + 0x50], ecx
call dword [0x4153d4]
push 0x10
lea edx, [esp + 0x4c]
push edx
push ebx
mov word [esp + 0x56], ax
call dword [0x4153dc]
cmp eax, 0xffffffff
jne 0x403053
call dword [0x4153d8]
mov ecx, dword [ebp + 0xc]
push ebx
mov dword [ecx], eax
call dword [0x4153e0]
jmp 0x4031dd
push str.GET__kankanliteupdate.xml_HTTP_1.1_r_nHost:_update.kankan.xunlei.com_r_nConnection:_close_r_n_r_n
lea ecx, [esp + 0x14]
call dword [0x41516c]
mov edi, dword [0x4153e4]
mov eax, dword [esp + 0x24]
mov dword [esp + 0x604], esi
cmp dword [esp + 0x28], 0x10
mov ecx, dword [esp + 0x14]
jae 0x403082
lea ecx, [esp + 0x14]
push 0
sub eax, esi
push eax
add ecx, esi
push ecx
push ebx
call edi
cmp eax, 0xffffffff
je 0x403102
add esi, eax
mov eax, dword [esp + 0x24]
cmp esi, eax
jb 0x403073
xor eax, eax
mov byte [esp + 0x58], 0
mov ecx, 0x100
lea edi, [esp + 0x59]
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x2c]
call dword [0x4151b4]
mov edi, dword [0x4153e8]
mov byte [esp + 0x604], 1
jmp 0x4030d0
push 0
push 0x400
lea eax, [esp + 0x60]
push eax
push ebx
call edi
mov esi, eax
test esi, esi
jle 0x403124
lea ecx, [esp + 0x58]
push ecx
lea ecx, [esp + 0x30]
mov byte [esp + esi + 0x5c], 0
call dword [0x415174]
cmp esi, 0xffffffff
jne 0x4030d0
or edi, esi
jmp 0x40312b
call dword [0x4153d8]
mov edx, dword [ebp + 0xc]
push ebx
mov dword [edx], eax
call dword [0x4153e0]
mov dword [esp + 0x604], 0xffffffff
jmp 0x4031d3
or edi, 0xffffffff
cmp esi, edi
jne 0x40313f
call dword [0x4153d8]
mov edx, dword [ebp + 0xc]
push ebx
mov dword [edx], eax
call dword [0x4153e0]
jmp 0x4031ba
push ebx
call dword [0x4153e0]
cmp dword [esp + 0x44], 0x10
mov eax, dword [esp + 0x30]
jae 0x403155
lea eax, [esp + 0x30]
push 0x4154e8
push eax
call dword [0x41527c]
mov esi, eax
add esp, 8
test esi, esi
je 0x4031b1
mov eax, dword [ebp + 0xc]
mov ebx, dword [ebp + 8]
mov ecx, ebx
mov dword [eax], 0
add esi, 4
call dword [0x4151c0]
push esi
mov ecx, ebx
call dword [0x4151bc]
lea ecx, [esp + 0x2c]
mov byte [esp + 0x604], 0
call dword [0x41515c]
lea ecx, [esp + 0x10]
mov dword [esp + 0x604], edi
call dword [0x41515c]
mov al, 1
jmp 0x4031df
mov ecx, dword [ebp + 0xc]
mov dword [ecx], 0
lea ecx, [esp + 0x2c]
mov byte [esp + 0x604], 0
call dword [0x41515c]
mov dword [esp + 0x604], edi
lea ecx, [esp + 0x10]
call dword [0x41515c]
xor al, al
mov ecx, dword [esp + 0x5fc]
mov dword fs:[0], ecx
mov ecx, dword [esp + 0x5f4]
call fcn.00412959
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8