Function at 0x408d66
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Delete file
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
sub esp, 0x338
mov eax, dword [0x459660]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebx + 0xe4]
and dword [ebp - 0x2f0], 0
push esi
lea esi, [ebx + 0x94]
push edi
mov dword [ebp - 0x320], eax
mov dword [ebp - 0x2e4], esi
push 0x190
call fcn.0042b5af
pop ecx
mov edi, eax
push edi
push 2
call dword [sym.imp.WS2_32.dll_WSAStartup]
push edi
call fcn.0042b455
pop ecx
push 8
xor eax, eax
pop ecx
lea edi, [ebx + 0x98]
rep stosd dword es:[edi], eax
and dword [ebx + 0x9c], eax
mov edi, dword [ebx + 0xcc]
mov dword [ebx + 0xa0], 1
mov dword [ebx + 0xa4], 6
call fcn.0040b0df
push edi
lea eax, [ebp - 0x31c]
push eax
call fcn.0040b8bd
push esi
lea ecx, [ebx + 0x98]
push ecx
push 0x44cef0
push dword [eax]
call dword [sym.imp.WS2_32.dll_getaddrinfo]
mov ecx, dword [ebp - 0x31c]
add ecx, 0xfffffff0
call fcn.0040285f
mov eax, dword [esi]
push dword [eax + 0xc]
push dword [eax + 8]
push dword [eax + 4]
call dword [sym.imp.WS2_32.dll_socket]
mov edi, eax
cmp edi, 0xffffffff
je 0x4095e6
mov esi, dword [esi]
push dword [esi + 0x10]
push dword [esi + 0x18]
push edi
call dword [sym.imp.WS2_32.dll_connect]
test eax, eax
jne 0x40916c
call fcn.0040d7fc
push eax
lea ecx, [ebp - 0x2e0]
call fcn.0040283a
mov eax, dword [ebx + 0xd4]
mov esi, dword [ebx + 0xcc]
mov dword [ebp - 0x2fc], eax
call fcn.0040b0df
call fcn.0040b0df
push esi
lea eax, [ebp - 0x300]
push eax
call fcn.0040b8bd
push dword [ebp - 0x2fc]
mov esi, eax
lea eax, [ebp - 0x318]
push eax
call fcn.0040b8bd
push dword [esi]
push dword [eax]
lea eax, [ebp - 0x2e0]
push str.GET__s_HTTP_1.1_r_nHost:__s_r_nUser_Agent:__r_nConnection:_Close_r_nRange:_bytes1__r_n_r_n200_OK_r_n
push eax
call fcn.004078c4
mov ecx, dword [ebp - 0x318]
add esp, 0x10
add ecx, 0xfffffff0
call fcn.0040285f
mov ecx, dword [ebp - 0x300]
add ecx, 0xfffffff0
call fcn.0040285f
mov eax, dword [ebp - 0x2e0]
mov eax, dword [eax - 0xc]
push 0
push eax
lea esi, [ebp - 0x2e0]
call fcn.00405050
push eax
push edi
call dword [sym.imp.WS2_32.dll_send]
call fcn.0040d7fc
push eax
lea ecx, [ebp - 0x2f8]
call fcn.0040283a
mov esi, 0x2c8
push esi
lea eax, [ebp - 0x2d0]
push 0
push eax
call fcn.0042d800
add esp, 0xc
push 0
push esi
lea eax, [ebp - 0x2d0]
push eax
push edi
call dword [sym.imp.WS2_32.dll_recv]
push edi
call dword [sym.imp.WS2_32.dll_closesocket]
call fcn.0040b0df
lea eax, [ebp - 0x2d0]
push eax
lea eax, [ebp - 0x2d8]
push eax
call fcn.0040b83c
push str.HTTP_1.1_30
xor ecx, ecx
lea esi, [ebp - 0x2d8]
call fcn.00404e2e
test eax, eax
jl 0x408f6f
push str.Location:
xor ecx, ecx
call fcn.00404e2e
test eax, eax
jge 0x408ffa
call fcn.0040d7fc
push eax
lea ecx, [ebp - 0x2dc]
call fcn.0040283a
push 0x44cf94
xor ecx, ecx
lea esi, [ebp - 0x2d8]
call fcn.00404e2e
test eax, eax
jl 0x408faa
push str.Content_Range:_bytes
xor ecx, ecx
call fcn.00404e2e
test eax, eax
jge 0x409178
cmp dword [ebp - 0x2f0], 5
jge 0x40959a
mov ecx, dword [ebp - 0x2dc]
inc dword [ebp - 0x2f0]
add ecx, 0xfffffff0
call fcn.0040285f
mov ecx, dword [ebp - 0x2d8]
add ecx, 0xfffffff0
call fcn.0040285f
mov ecx, dword [ebp - 0x2f8]
add ecx, 0xfffffff0
call fcn.0040285f
mov ecx, dword [ebp - 0x2e0]
add ecx, 0xfffffff0
call fcn.0040285f
jmp 0x408e4c
mov eax, dword [ebp - 0x2d8]
mov edi, dword [eax - 0xc]
push str.Location:
xor ecx, ecx
lea esi, [ebp - 0x2d8]
call fcn.00404e2e
sub edi, eax
push edi
lea eax, [ebp - 0x2d4]
push eax
mov ecx, esi
call fcn.0040a85c
mov edi, 0x44cf80
push edi
xor ecx, ecx
lea esi, [ebp - 0x2d4]
call fcn.00404e2e
test eax, eax
jl 0x40906a
push edi
xor ecx, ecx
call fcn.00404e2e
push eax
lea eax, [ebp - 0x2e8]
push eax
mov ecx, esi
call fcn.00404efb
push eax
mov ecx, esi
call fcn.00402143
mov ecx, dword [ebp - 0x2e8]
add ecx, 0xfffffff0
call fcn.0040285f
push 0x44cf88
xor ecx, ecx
lea esi, [ebp - 0x2d4]
call fcn.00404e2e
mov edi, 0x44cf90
lea ecx, [eax + 2]
push edi
mov dword [ebp - 0x2fc], eax
call fcn.00404e2e
mov esi, dword [ebp - 0x2fc]
push 0xfffffffffffffffe
pop ecx
sub ecx, esi
add eax, ecx
push eax
lea eax, [esi + 2]
push eax
mov dword [ebp - 0x2fc], eax
lea eax, [ebp - 0x2ec]
push eax
lea ecx, [ebp - 0x2d4]
call fcn.00404e81
lea eax, [ebp - 0x2ec]
push eax
lea ecx, [ebx + 0xcc]
call fcn.00402143
mov eax, dword [ebp - 0x2d4]
mov eax, dword [eax - 0xc]
mov ecx, dword [ebp - 0x2fc]
sub eax, esi
dec eax
dec eax
push eax
push edi
lea esi, [ebp - 0x2d4]
call fcn.00404e2e
push eax
lea eax, [ebp - 0x2f4]
push eax
mov ecx, esi
call fcn.00404e81
lea eax, [ebp - 0x2f4]
push eax
lea ecx, [ebx + 0xd4]
call fcn.00402143
mov ecx, dword [ebp - 0x2f4]
add ecx, 0xfffffff0
call fcn.0040285f
mov ecx, dword [ebp - 0x2ec]
add ecx, 0xfffffff0
call fcn.0040285f
mov ecx, dword [ebp - 0x2d4]
add ecx, 0xfffffff0
call fcn.0040285f
mov ecx, dword [ebp - 0x2d8]
add ecx, 0xfffffff0
call fcn.0040285f
mov ecx, dword [ebp - 0x2f8]
add ecx, 0xfffffff0
call fcn.0040285f
mov ecx, dword [ebp - 0x2e0]
add ecx, 0xfffffff0
call fcn.0040285f
mov esi, dword [ebp - 0x2e4]
jmp 0x408d9a
push edi
call dword [sym.imp.WS2_32.dll_closesocket]
jmp 0x4095e6
mov eax, dword [ebp - 0x2d8]
mov edi, dword [eax - 0xc]
push str.Content_Range:_bytes
xor ecx, ecx
lea esi, [ebp - 0x2d8]
call fcn.00404e2e
sub edi, eax
push edi
lea eax, [ebp - 0x2e8]
push eax
mov ecx, esi
call fcn.0040a85c
push eax
lea ecx, [ebp - 0x2dc]
call fcn.00402143
mov ecx, dword [ebp - 0x2e8]
add ecx, 0xfffffff0
call fcn.0040285f
mov edi, 0x44cf80
push edi
xor ecx, ecx
lea esi, [ebp - 0x2dc]
call fcn.00404e2e
test eax, eax
jl 0x409202
push edi
xor ecx, ecx
call fcn.00404e2e
push eax
lea eax, [ebp - 0x2e8]
push eax
mov ecx, esi
call fcn.00404efb
push eax
mov ecx, esi
call fcn.00402143
mov ecx, dword [ebp - 0x2e8]
add ecx, 0xfffffff0
call fcn.0040285f
push 0x44cf90
xor ecx, ecx
lea esi, [ebp - 0x2dc]
call fcn.00404e2e
push eax
lea eax, [ebp - 0x2e8]
push eax
mov ecx, esi
call fcn.00404efb
push eax
mov ecx, esi
call fcn.00402143
mov ecx, dword [ebp - 0x2e8]
add ecx, 0xfffffff0
call fcn.0040285f
push str.Content_Range:_bytes_1_
mov eax, esi
push eax
call fcn.00404cad
mov eax, esi
push eax
lea ecx, [ebp - 0x2f0]
call fcn.004020b8
push dword [ebp - 0x2f0]
call fcn.0042bddc
lea esi, [ebx + 0xb8]
mov dword [esi], eax
shr eax, 3
mov dword [ebx + 0xbc], eax
xor eax, eax
lea edi, [ebx + 0xc4]
pop ecx
mov dword [ebx + 0xc0], eax
mov dword [ebx + 0xc8], eax
mov dword [edi], eax
mov dword [ebp - 0x2ec], 8
jmp 0x409295
xor eax, eax
push eax
push eax
push eax
push eax
push ebx
push 0x408926
call fcn.0041a2f2
dec dword [ebp - 0x2ec]
jne 0x409293
push str.Downloading_Skin....
call fcn.0040aa3b
mov ecx, dword [eax + 0x24]
call fcn.004136ef
call fcn.0040d7fc
push eax
lea ecx, [ebp - 0x2d4]
call fcn.0040283a
and dword [ebp - 0x2f4], 0
mov eax, dword [edi]
fild dword [edi]
test eax, eax
jge 0x4092e4
fadd dword [0x44f160]
mov eax, dword [esi]
fild dword [esi]
test eax, eax
jge 0x4092f2
fadd dword [0x44f160]
fdivp st(1)
push ecx
push ecx
lea eax, [ebp - 0x2d4]
fmul qword [0x44f158]
fstp qword [esp]
push str._.0f
push eax
call fcn.0040226e
add esp, 0x10
push 0x44d040
lea ecx, [ebp - 0x2d4]
call fcn.004050f9
lea eax, [ebx + 0xf8]
call fcn.0040a9ee
cmp dword [ebp - 0x320], eax
jne 0x409347
push dword [ebp - 0x2d4]
lea ecx, [ebx + 0x1bc]
call fcn.004136ef
cmp dword [ebx + 0xe0], 1
jne 0x409368
cmp dword [ebx + 0xc0], 7
ja 0x40937e
cmp dword [ebp - 0x2f4], 0x28
jg 0x40937e
inc dword [ebp - 0x2f4]
cmp dword [ebx + 0xc0], 7
ja 0x4093b3
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x4092d6
mov eax, dword [ebp - 0x2e4]
push dword [eax]
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
call dword [sym.imp.WS2_32.dll_WSACleanup]
mov ecx, dword [ebp - 0x2d4]
add ecx, 0xfffffff0
call fcn.0040285f
mov ecx, dword [ebp - 0x2f0]
add ecx, 0xfffffff0
call fcn.0040285f
jmp 0x4095ae
mov eax, dword [ebp - 0x2e4]
push dword [eax]
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
call dword [sym.imp.WS2_32.dll_WSACleanup]
lea ecx, [ebp - 0x334]
call fcn.00417337
lea ecx, [ebp - 0x314]
call fcn.00417337
xor edi, edi
push edi
push 0x9001
push dword [ebx + 0xd0]
lea ecx, [ebp - 0x334]
call fcn.0041734f
cmp dword [ebp - 0x330], edi
jne 0x409419
lea ecx, [ebp - 0x314]
call fcn.0041776a
lea ecx, [ebp - 0x334]
call fcn.0041776a
jmp 0x409392
mov dword [ebp - 0x2e4], edi
call fcn.0040d7fc
push eax
lea ecx, [ebp - 0x2ec]
call fcn.0040283a
push dword [ebp - 0x2e4]
push dword [ebx + 0xd8]
call fcn.00402ca1
push dword [eax + 0xc]
lea eax, [ebp - 0x2ec]
push str._sLibdownload_s__d
push eax
call fcn.0040226e
mov esi, dword [ebp - 0x2ec]
add esp, 0x14
push edi
push 0x8000
push esi
lea ecx, [ebp - 0x314]
call fcn.0041734f
cmp dword [ebp - 0x310], edi
jne 0x409482
lea ecx, [esi - 0x10]
call fcn.0040285f
jmp 0x4094e9
lea ecx, [ebp - 0x314]
call fcn.00417638
push eax
call fcn.0040d600
pop ecx
lea ecx, [ebp - 0x314]
mov edi, eax
call fcn.00417638
push eax
push edi
lea ecx, [ebp - 0x314]
call fcn.00417488
lea ecx, [ebp - 0x314]
call fcn.00417638
push eax
push edi
lea ecx, [ebp - 0x334]
call fcn.004174fe
push edi
call fcn.0040d60b
pop ecx
lea ecx, [ebp - 0x314]
call fcn.004176ff
push esi
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
lea ecx, [esi - 0x10]
call fcn.0040285f
xor edi, edi
inc dword [ebp - 0x2e4]
cmp dword [ebp - 0x2e4], 8
jl 0x40941f
lea ecx, [ebp - 0x334]
call fcn.004176ff
call fcn.0040b0df
push ecx
mov esi, esp
push 0x44d044
call fcn.00402ca1
add eax, 0xc
push eax
push esi
call fcn.00404f6d
add esp, 0xc
call fcn.0040bdbd
lea ecx, [ebp - 0x314]
call fcn.0041776a
lea ecx, [ebp - 0x334]
call fcn.0041776a
mov ecx, dword [ebp - 0x2d4]
add ecx, 0xfffffff0
call fcn.0040285f
mov ecx, dword [ebp - 0x2f0]
add ecx, 0xfffffff0
call fcn.0040285f
mov ecx, dword [ebp - 0x2dc]
add ecx, 0xfffffff0
call fcn.0040285f
mov ecx, dword [ebp - 0x2d8]
add ecx, 0xfffffff0
call fcn.0040285f
mov ecx, dword [ebp - 0x2f8]
add ecx, 0xfffffff0
call fcn.0040285f
mov ecx, dword [ebp - 0x2e0]
add ecx, 0xfffffff0
call fcn.0040285f
xor eax, eax
inc eax
jmp 0x4095e8
mov eax, dword [ebp - 0x2e4]
push dword [eax]
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
call dword [sym.imp.WS2_32.dll_WSACleanup]
mov ecx, dword [ebp - 0x2dc]
add ecx, 0xfffffff0
call fcn.0040285f
mov ecx, dword [ebp - 0x2d8]
add ecx, 0xfffffff0
call fcn.0040285f
mov ecx, dword [ebp - 0x2f8]
add ecx, 0xfffffff0
call fcn.0040285f
mov ecx, dword [ebp - 0x2e0]
add ecx, 0xfffffff0
call fcn.0040285f
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop esi
call fcn.0042b446
leave
ret