Function at 0x100015c0
Capabilities:
Connect socket
Download and write a file
Receive and write data from server to client
Receive data
Receive data on socket
Send data
Send data on socket
Send http request
Send http request with host header
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x1000c510
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x398
mov eax, dword [0x100140f4]
push ebx
push esi
push edi
lea ecx, [esp + 0x58]
mov dword [esp + 0x39c], eax
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_void_]
xor esi, esi
lea ecx, [esp + 0x74]
mov dword [esp + 0x3ac], esi
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_void_]
lea eax, [esp + 0x74]
push eax
mov eax, dword [ebp + 8]
lea ecx, [esp + 0x18]
push ecx
lea edx, [esp + 0x60]
push edx
push eax
mov byte [esp + 0x3bc], 1
mov dword [esp + 0x24], 0x50
call fcn.10006690
mov eax, dword [esp + 0x80]
mov ecx, dword [esp + 0x6c]
mov edi, 0x10
add esp, 0x10
cmp eax, edi
jae 0x10001650
lea ecx, [esp + 0x5c]
cmp dword [esp + 0x8c], edi
mov eax, dword [esp + 0x78]
jae 0x10001661
lea eax, [esp + 0x78]
push ecx
push eax
push str.GET__s_HTTP_1.0_r_nHost:__s_r_nUser_Agent:_Mozilla_4.0_r_nConnection:_close_r_nAccept:___r_n_r_n
lea ecx, [esp + 0x1a4]
push 0x1ff
push ecx
call dword [sym.imp.MSVCR71.dll__snprintf]
mov eax, dword [esp + 0x84]
add esp, 0x14
cmp eax, edi
mov eax, dword [esp + 0x5c]
mov dword [esp + 0x20], esi
mov word [esp + 0x24], si
jae 0x1000169a
lea eax, [esp + 0x5c]
push eax
lea ecx, [esp + 0x30]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_char_const__]
mov edx, dword [esp + 0x14]
push edx
lea eax, [esp + 0x30]
mov ebx, 2
push eax
lea ecx, [esp + 0x28]
mov byte [esp + 0x3b4], bl
call fcn.10006470
lea ecx, [esp + 0x2c]
mov byte [esp + 0x3ac], 1
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
mov eax, dword [esp + 0x20]
cmp eax, esi
je 0x100017cf
xor ecx, ecx
mov dword [esp + 0x48], ecx
mov dword [esp + 0x4c], ecx
mov dword [esp + 0x50], ecx
push eax
mov dword [esp + 0x58], ecx
mov word [esp + 0x4c], bx
call dword [sym.imp.WS2_32.dll_htonl]
mov edx, dword [esp + 0x24]
push edx
mov dword [esp + 0x50], eax
call dword [sym.imp.WS2_32.dll_htons]
push 6
push 1
push ebx
mov word [esp + 0x56], ax
call dword [sym.imp.WS2_32.dll_socket]
mov ebx, eax
or edi, 0xffffffff
cmp ebx, edi
mov dword [esp + 0x18], ebx
je 0x10001745
push 0x10
lea eax, [esp + 0x4c]
push eax
push ebx
call dword [sym.imp.WS2_32.dll_connect]
test eax, eax
je 0x10001763
push ebx
call dword [sym.imp.WS2_32.dll_closesocket]
lea ecx, [esp + 0x74]
mov byte [esp + 0x3ac], 0
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
mov dword [esp + 0x3ac], edi
jmp 0x100017ec
lea eax, [esp + 0x198]
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x10001770
sub eax, edx
mov edi, eax
test edi, edi
jle 0x100017cf
nop
push 0
mov ecx, edi
sub ecx, esi
push ecx
lea edx, [esp + esi + 0x1a0]
push edx
push ebx
call dword [sym.imp.WS2_32.dll_send]
test eax, eax
jle 0x100017cf
add esi, eax
cmp esi, edi
jl 0x10001780
mov eax, dword [ebp + 0xc]
cmp dword [eax + 0x18], 0x10
jb 0x100017ae
mov eax, dword [eax + 4]
jmp 0x100017b1
add eax, 4
push 0x1000e268
push eax
call dword [sym.imp.MSVCR71.dll_fopen]
add esp, 8
test eax, eax
mov dword [esp + 0x1c], eax
jne 0x10001819
push ebx
call dword [sym.imp.WS2_32.dll_closesocket]
lea ecx, [esp + 0x74]
mov byte [esp + 0x3ac], 0
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
mov dword [esp + 0x3ac], 0xffffffff
lea ecx, [esp + 0x58]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
xor al, al
mov ecx, dword [esp + 0x3a4]
mov dword fs:[0], ecx
mov ecx, dword [esp + 0x39c]
call fcn.1000bf33
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [esp + 0x10], 0xffffffff
xor eax, eax
push eax
mov ecx, 0x41
lea edi, [esp + 0x94]
rep stosd dword es:[edi], eax
mov edi, dword [sym.imp.WS2_32.dll_recv]
push 1
lea eax, [esp + 0x17]
push eax
push ebx
xor esi, esi
call edi
test eax, eax
jle 0x10001874
cmp esi, 0x104
jge 0x10001874
mov al, byte [esp + 0xf]
cmp al, 0xa
je 0x10001874
cmp al, 0xd
je 0x10001864
mov byte [esp + esi + 0x90], al
inc esi
push 0
push 1
lea ecx, [esp + 0x17]
push ecx
push ebx
call edi
test eax, eax
jg 0x10001848
mov esi, dword [sym.imp.MSVCR71.dll_strstr]
lea edx, [esp + 0x90]
push str.Content_Length:
push edx
call esi
add esp, 8
test eax, eax
je 0x100018f3
lea eax, [esp + 0x90]
push 0x1000e248
push eax
call esi
add esp, 8
test eax, eax
je 0x100018bd
mov cl, byte [eax + 1]
inc eax
test cl, cl
je 0x100018bd
mov edi, edi
cmp cl, 0x20
jne 0x100018bd
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x100018b0
push eax
lea ecx, [esp + 0x30]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_char_const__]
lea ecx, [esp + 0x2c]
push ecx
mov byte [esp + 0x3b0], 3
call fcn.10006350
add esp, 4
lea ecx, [esp + 0x2c]
mov dword [esp + 0x10], eax
mov byte [esp + 0x3ac], 1
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
lea eax, [esp + 0x90]
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x10001900
sub eax, edx
mov dword [esp + 0x28], eax
jne 0x10001821
push 0x400
call fcn.1000bed8
mov edi, eax
mov eax, dword [esp + 0x14]
add esp, 4
xor ebx, ebx
test eax, eax
jle 0x10001969
lea esp, [esp]
mov edx, dword [esp + 0x18]
push 0
push 0x400
push edi
push edx
call dword [sym.imp.WS2_32.dll_recv]
mov esi, eax
test esi, esi
jle 0x10001969
mov eax, dword [esp + 0x1c]
push eax
push esi
push 1
push edi
call dword [sym.imp.MSVCR71.dll_fwrite]
add esp, 0x10
cmp eax, esi
jne 0x10001969
mov eax, dword [esp + 0x10]
add ebx, esi
cmp ebx, eax
jl 0x10001930
push edi
call fcn.1000bf50
mov ecx, dword [esp + 0x1c]
add esp, 4
push ecx
call dword [sym.imp.WS2_32.dll_closesocket]
mov edx, dword [esp + 0x1c]
push edx
call dword [sym.imp.MSVCR71.dll_fclose]
mov eax, dword [esp + 0x14]
add esp, 4
cmp ebx, eax
jne 0x100017cf
lea ecx, [esp + 0x74]
mov byte [esp + 0x3ac], 0
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
lea ecx, [esp + 0x58]
mov dword [esp + 0x3ac], 0xffffffff
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
mov al, 1
jmp 0x100017f8