Function at 0x1002f643
Capabilities:
Check for time delay via gettickcount
Check http status code

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x4c
push ebx
push esi
push edi
mov edi, ecx
mov ebx, edx
xor edx, edx
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0x48], edx
mov ecx, 0x36ee80
mov dword [ebp - 0x14], edx
mov esi, dword [edi]
mov dword [ebp - 0x18], edx
mov dword [ebp - 0x30], edx
mov dword [ebp - 0x44], edx
mov eax, dword [esi + 0x19c]
test eax, eax
mov dword [ebp - 0x2c], edx
cmovne ecx, eax
cmp dword [edi + ebx*4 + 0x4b0], 2
mov eax, dword [edi + ebx*4 + 0x130]
mov dword [ebp - 0x3c], ecx
mov dword [ebp - 0x34], eax
jne 0x1002f697
xor eax, eax
jmp 0x1002ff53
mov dword [edi + 0x21c], edx
cmp dword [edi + ebx*4 + 0x4b0], edx
jne 0x1002f8cb
movzx eax, word [ebp + 0xc]
push eax
push dword [ebp + 8]
push str.Establish_HTTP_proxy_tunnel_to__s:_hu_n
push esi
call fcn.10018194
mov eax, dword [esi + 0xd4]
add esp, 0x10
test eax, eax
je 0x1002f6d8
push eax
call fcn.1003b2a7
and dword [esi + 0xd4], 0
pop ecx
xor eax, eax
inc eax
push 0xc
push eax
call dword [0x1014537c]
mov ebx, eax
pop ecx
pop ecx
test ebx, ebx
je 0x1002fe8f
movzx eax, word [ebp + 0xc]
push eax
push dword [ebp + 8]
push str._s:_hu
call fcn.1001eaa8
add esp, 0xc
mov dword [ebp - 0x40], eax
test eax, eax
je 0x1002fe88
push 1
push eax
mov edx, str.CONNECT
mov ecx, edi
call fcn.10023bc8
push dword [ebp - 0x40]
mov dword [ebp - 0xc], eax
call fcn.1003b2a7
add esp, 0xc
cmp dword [ebp - 0xc], 0
jne 0x1002f8a6
cmp dword [edi + 0x114], 1
mov eax, 0x1012f673
mov dword [ebp - 0x24], eax
mov ecx, 0x10131db0
mov dword [ebp - 0x20], eax
mov edx, 0x1012f673
mov eax, 0x10131db4
cmovne eax, ecx
mov ecx, dword [edi + 0x1dc]
mov dword [ebp - 0x1c], eax
test ecx, ecx
movzx eax, word [ebp + 0xc]
push eax
mov eax, 0x1012f8c0
cmove eax, edx
push eax
push dword [ebp + 8]
mov eax, 0x1012f8c4
cmove eax, edx
push eax
push str._s_s_s:_hu
call fcn.1001eaa8
add esp, 0x14
mov dword [ebp - 0x28], eax
test eax, eax
je 0x1002fe88
mov edx, str.Host:
mov ecx, esi
call fcn.10023588
test eax, eax
jne 0x1002f7c2
push dword [ebp - 0x28]
push str.Host:__s_r_n
call fcn.1001eaa8
mov dword [ebp - 0x24], eax
pop ecx
pop ecx
test eax, eax
je 0x1002fe7f
mov edx, str.Proxy_Connection:
mov ecx, esi
call fcn.10023588
test eax, eax
mov ecx, str.Proxy_Connection:_Keep_Alive_r_n
mov eax, 0x1012f673
mov edx, str.User_Agent:
cmovne ecx, eax
mov dword [ebp - 0x40], ecx
mov ecx, esi
call fcn.10023588
test eax, eax
jne 0x1002f801
cmp dword [esi + 0x3a4], eax
je 0x1002f801
mov eax, dword [edi + 0x250]
mov dword [ebp - 0x20], eax
push dword [ebp - 0x40]
mov eax, dword [edi + 0x24c]
mov ecx, 0x1012f673
push dword [ebp - 0x20]
test eax, eax
cmovne ecx, eax
push ecx
push dword [ebp - 0x24]
push dword [ebp - 0x1c]
push dword [ebp - 0x28]
push str.CONNECT__s_HTTP__s_r_n_s_s_s_s
push ebx
call fcn.10024103
mov dword [ebp - 0xc], eax
add esp, 0x20
mov eax, dword [ebp - 0x24]
test eax, eax
je 0x1002f845
cmp byte [eax], 0
je 0x1002f845
push eax
call fcn.1003b2a7
pop ecx
push dword [ebp - 0x28]
call fcn.1003b2a7
mov eax, dword [ebp - 0xc]
pop ecx
test eax, eax
jne 0x1002f893
mov edx, ebx
mov ecx, edi
call fcn.10024536
mov dword [ebp - 0xc], eax
test eax, eax
jne 0x1002f893
push 0x1012fe98
push ebx
call fcn.10024103
mov dword [ebp - 0xc], eax
pop ecx
pop ecx
test eax, eax
jne 0x1002f893
push dword [ebp - 0x10]
mov edx, edi
mov ecx, ebx
push eax
lea eax, [esi + 0x86c4]
push eax
call fcn.10023f75
add esp, 0xc
mov dword [ebp - 0xc], eax
xor ebx, ebx
test eax, eax
je 0x1002f8bc
push str.Failed_sending_CONNECT_to_proxy
push esi
call fcn.10018208
pop ecx
pop ecx
test ebx, ebx
je 0x1002f8b1
push ebx
call fcn.1003b2a7
pop ecx
mov eax, dword [ebp - 0xc]
test eax, eax
jne 0x1002ff53
mov eax, dword [ebp - 0x10]
xor ebx, ebx
inc ebx
mov dword [edi + eax*4 + 0x4b0], ebx
jmp 0x1002f8ce
xor ebx, ebx
inc ebx
push dword [edi + 0x124]
push dword [edi + 0x120]
call fcn.1002f4e0
push edx
push eax
call fcn.1002f4f6
mov ecx, dword [ebp - 0x3c]
add esp, 0x10
sub ecx, eax
test ecx, ecx
jle 0x1002ff43
cmp dword [esi + 0x540], 2
jne 0x1002f918
mov ecx, dword [ebp - 0x34]
or edx, 0xffffffff
push 0
push 0xffffffffffffffff
call fcn.100301b6
pop ecx
pop ecx
test eax, eax
je 0x1002f690
and dword [ebp - 0x28], 0
lea eax, [esi + 0x55c]
and dword [ebp - 0x20], 0
mov dword [ebp - 0x24], eax
mov dword [ebp - 0xc], eax
mov dword [ebp - 8], ebx
test ebx, ebx
je 0x1002fab8
cmp dword [ebp - 0x2c], 0
jne 0x1002ff50
push dword [edi + 0x124]
push dword [edi + 0x120]
call fcn.1002f4e0
push edx
push eax
call fcn.1002f4f6
mov ecx, dword [ebp - 0x3c]
add esp, 0x10
sub ecx, eax
test ecx, ecx
jle 0x1002fe1b
mov edx, 0x3e8
cmp ecx, edx
mov eax, edx
cmovl eax, ecx
mov ecx, dword [ebp - 0x34]
push eax
push 0xffffffffffffffff
or edx, 0xffffffff
call fcn.100301b6
pop ecx
pop ecx
cmp eax, 0xffffffff
je 0x1002fe11
test eax, eax
je 0x1002fa9c
mov edx, dword [ebp - 0x34]
lea eax, [ebp - 0x38]
push eax
mov eax, 0x4000
mov ecx, edi
sub eax, dword [ebp - 0x28]
push eax
push dword [ebp - 0x24]
call fcn.10018653
add esp, 0xc
cmp eax, 0x51
je 0x1002faab
test eax, eax
jne 0x1002fa46
mov ebx, dword [ebp - 0x38]
mov dword [ebp - 0x40], ebx
test ebx, ebx
jg 0x1002fa07
xor ebx, ebx
mov dword [ebp - 8], ebx
cmp dword [esi + 0x118], ebx
je 0x1002f9ef
cmp dword [esi + 0x85fc], ebx
je 0x1002f9ef
inc eax
mov dword [edi + 0x21c], eax
jmp 0x1002fa9c
push str.Proxy_CONNECT_aborted
xor eax, eax
inc eax
push esi
mov dword [ebp - 0x2c], eax
call fcn.10018208
pop ecx
pop ecx
jmp 0x1002fa9c
add dword [ebp - 0x28], ebx
cmp dword [ebp - 8], 1
jle 0x1002fafb
mov eax, dword [ebp - 0x14]
lea ecx, [esi + 0x55c]
and dword [ebp - 0x28], 0
or eax, dword [ebp - 0x18]
mov dword [ebp - 0x24], ecx
je 0x1002fa4d
mov ecx, dword [ebp - 0x14]
mov eax, ebx
cdq
sub ecx, eax
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x14], ecx
sbb eax, edx
mov dword [ebp - 0x18], eax
test eax, eax
jg 0x1002fa99
jl 0x1002fa46
test ecx, ecx
jne 0x1002fa99
xor ebx, ebx
mov dword [ebp - 8], ebx
jmp 0x1002fa9c
and dword [ebp - 0x1c], 0
lea eax, [ebp - 0x1c]
push eax
mov edx, ecx
mov ecx, edi
push ebx
call fcn.100313b5
pop ecx
pop ecx
cmp eax, 0xffffffff
jne 0x1002fa88
push str.chunk_reading_DONE_n
push esi
call fcn.10018194
pop ecx
pop ecx
xor ebx, ebx
mov dword [ebp - 8], ebx
mov eax, dword [ebp - 0x10]
mov dword [edi + eax*4 + 0x4b0], 2
jmp 0x1002fa9c
push dword [ebp - 0x1c]
push str.Read__zd_bytes_of_chunk__continue_n
push esi
call fcn.10018194
add esp, 0xc
mov ebx, dword [ebp - 8]
mov ecx, edi
call fcn.1001fcac
test eax, eax
jne 0x1002fe96
cmp dword [ebp - 0x28], 0x4000
jb 0x1002f92f
mov eax, dword [ebp - 0x2c]
test eax, eax
jne 0x1002ff50
cmp dword [esi + 0x86b0], 0xc8
je 0x1002fe33
mov ecx, edi
call fcn.1002390a
test eax, eax
jne 0x1002ff53
mov eax, dword [ebp - 0x30]
xor edx, edx
cmp dword [edi + 0x1c4], edx
push 1
pop ecx
cmovne eax, ecx
mov dword [ebp - 0x30], eax
jmp 0x1002fe38
xor eax, eax
mov dword [ebp - 0x1c], eax
test ebx, ebx
jle 0x1002fa99
mov ecx, dword [ebp - 0x24]
mov edx, dword [ebp - 0x20]
inc edx
cmp byte [ecx], 0xa
mov dword [ebp - 0x20], edx
jne 0x1002fcc0
cmp dword [esi + 0x2e4], 0
je 0x1002fb35
mov ecx, dword [ebp - 0xc]
xor eax, eax
push edi
push edx
push ecx
lea edx, [eax + 1]
mov ecx, esi
call fcn.100187b1
add esp, 0xc
cmp dword [esi + 0x2c8], 0
mov ecx, edi
push 2
pop edx
push 3
pop eax
push dword [ebp - 0x20]
cmovne edx, eax
push dword [ebp - 0xc]
call fcn.1001851e
pop ecx
pop ecx
test eax, eax
jne 0x1002ff53
mov ecx, dword [ebp - 0xc]
mov al, byte [ecx]
cmp al, 0xd
je 0x1002fcd5
cmp al, 0xa
je 0x1002fcd5
mov edx, dword [ebp - 0x20]
push 0x11
mov al, byte [edx + ecx]
mov byte [edx + ecx], 0
mov edx, ecx
mov ecx, str.WWW_Authenticate:
mov byte [ebp - 1], al
call fcn.1002dd70
pop ecx
test eax, eax
je 0x1002fb9f
mov edx, dword [esi + 0x90]
cmp edx, 0x191
je 0x1002fbc1
mov edx, dword [ebp - 0xc]
mov ecx, str.Proxy_authenticate:
push 0x13
call fcn.1002dd70
pop ecx
test eax, eax
je 0x1002fbd9
mov edx, dword [esi + 0x90]
cmp edx, 0x197
jne 0x1002fbd9
push dword [ebp - 0xc]
mov ecx, edi
call fcn.10023cc3
pop ecx
test eax, eax
jne 0x1002ff53
jmp 0x1002fca3
mov edx, dword [ebp - 0xc]
mov ecx, str.Content_Length:
push 0xf
call fcn.1002dd70
pop ecx
test eax, eax
je 0x1002fc0b
mov eax, dword [ebp - 0xc]
push 0xa
add eax, 0xf
push 0
push eax
call fcn.1003c847
add esp, 0xc
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x18], edx
jmp 0x1002fca3
mov ecx, dword [ebp - 0xc]
mov edx, str.Connection:
push str.close
call fcn.1002420a
pop ecx
test eax, eax
jne 0x1002fc70
mov ecx, dword [ebp - 0xc]
mov edx, str.Transfer_Encoding:
push str.chunked
call fcn.1002420a
pop ecx
test eax, eax
je 0x1002fc59
push str.CONNECT_responded_chunked_n
push esi
call fcn.10018194
and dword [edi + 0x18], 0
xor eax, eax
inc eax
and dword [edi + 0x24], 0
pop ecx
pop ecx
mov dword [ebp - 0x44], eax
mov dword [edi + 0x1c], eax
jmp 0x1002fca3
mov ecx, dword [ebp - 0xc]
mov edx, str.Proxy_Connection:
push str.close
call fcn.1002420a
pop ecx
test eax, eax
je 0x1002fc78
xor eax, eax
inc eax
mov dword [ebp - 0x30], eax
jmp 0x1002fca3
lea ebx, [esi + 0x90]
push ebx
lea eax, [ebp - 0x48]
push eax
push str.HTTP_1._d__d
push dword [ebp - 0xc]
call fcn.1003b45c
add esp, 0x10
cmp eax, 2
jne 0x1002fca0
mov eax, dword [ebx]
mov dword [esi + 0x86b0], eax
mov ebx, dword [ebp - 0x40]
mov ecx, dword [ebp - 0xc]
mov edx, dword [ebp - 0x20]
mov al, byte [ebp - 1]
mov byte [edx + ecx], al
xor edx, edx
mov ecx, dword [ebp - 0x24]
mov dword [ebp - 0x20], edx
lea eax, [ecx + 1]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x1c]
inc ecx
inc eax
mov dword [ebp - 0x24], ecx
mov dword [ebp - 0x1c], eax
cmp eax, ebx
jl 0x1002fb0a
jmp 0x1002fa99
and dword [ebp - 0x28], 0
lea eax, [esi + 0x55c]
cmp dword [esi + 0x90], 0x197
mov dword [ebp - 0x24], eax
jne 0x1002fddf
cmp dword [esi + 0x860c], 0
jne 0x1002fddf
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x18]
push 2
pop eax
mov dword [ebp - 8], eax
mov eax, ecx
or eax, edx
je 0x1002fd52
push edx
push ecx
push str.Ignore__lld_bytes_of_response_body_n
push esi
call fcn.10018194
sub ebx, dword [ebp - 0x1c]
add esp, 0x10
mov ecx, dword [ebp - 0x14]
mov eax, ebx
cdq
sub ecx, eax
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x14], ecx
sbb eax, edx
mov dword [ebp - 0x18], eax
test eax, eax
jg 0x1002fe09
jl 0x1002fa73
test ecx, ecx
jne 0x1002fe09
jmp 0x1002fa73
mov eax, dword [ebp - 0x44]
test eax, eax
je 0x1002fa73
xor eax, eax
inc eax
mov dword [esi + 0xc8], eax
mov eax, ebx
sub eax, dword [ebp - 0x1c]
push eax
push str._zd_bytes_of_chunk_left_n
push esi
call fcn.10018194
mov eax, dword [ebp - 0xc]
add esp, 0xc
inc eax
cmp byte [eax], 0xa
jne 0x1002fd8c
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x1c]
inc eax
jmp 0x1002fd8f
mov eax, dword [ebp - 0x1c]
mov edx, dword [ebp - 0xc]
lea ecx, [ebp - 0x38]
push ecx
sub ebx, eax
mov ecx, edi
push ebx
lea edx, [edx + 1]
call fcn.100313b5
pop ecx
pop ecx
cmp eax, 0xffffffff
jne 0x1002fdcf
push str.chunk_reading_DONE_n
push esi
call fcn.10018194
mov eax, dword [ebp - 0x10]
xor ebx, ebx
pop ecx
pop ecx
mov dword [ebp - 8], ebx
mov dword [edi + eax*4 + 0x4b0], 2
jmp 0x1002fa7b
push dword [ebp - 0x38]
push str.Read__zd_bytes_of_chunk__continue_n
push esi
call fcn.10018194
jmp 0x1002fe06
xor eax, eax
cmp dword [esi + 0x86b0], 0xc8
mov dword [ebp - 8], eax
jne 0x1002fe09
sub ebx, dword [ebp - 0x1c]
lea eax, [ebx - 1]
test eax, eax
je 0x1002fe09
push eax
push str.Proxy_CONNECT_followed_by__zd_bytes_of_opaque_data._Data_ignored__known_bug_39_
push esi
call fcn.10018208
add esp, 0xc
mov ebx, dword [ebp - 8]
jmp 0x1002fa78
push str.Proxy_CONNECT_aborted_due_to_select_poll_error
jmp 0x1002f9f4
push str.Proxy_CONNECT_aborted_due_to_timeout
push esi
call fcn.10018208
pop ecx
pop ecx
push 2
pop eax
mov dword [ebp - 0x2c], eax
jmp 0x1002fabb
mov eax, dword [ebp - 0x30]
xor edx, edx
test eax, eax
je 0x1002fe44
cmp dword [esi + 0xd4], edx
jne 0x1002fe9d
mov ebx, dword [ebp - 0x10]
cmp dword [esi + 0xd4], edx
je 0x1002feb8
cmp dword [edi + ebx*4 + 0x4b0], 2
jne 0x1002fe71
push edx
push str.TUNNEL_STATE_switched_to:__d_n
push esi
mov dword [edi + ebx*4 + 0x4b0], edx
call fcn.10018194
add esp, 0xc
xor edx, edx
cmp dword [esi + 0xd4], edx
jne 0x1002f69d
jmp 0x1002feb8
push dword [ebp - 0x28]
call fcn.1003b2a7
pop ecx
push ebx
call fcn.1003b2a7
pop ecx
push 0x1b
jmp 0x1002ff52
push 0x2a
jmp 0x1002ff52
mov ebx, dword [ebp - 0x10]
mov ecx, edi
mov edx, dword [edi + ebx*4 + 0x130]
call fcn.1001753e
or dword [edi + ebx*4 + 0x130], 0xffffffff
xor edx, edx
mov eax, dword [esi + 0x90]
cmp eax, 0xc8
je 0x1002fef7
push eax
push str.Received_HTTP_code__d_from_proxy_after_CONNECT
push esi
call fcn.10018208
mov eax, dword [ebp - 0x30]
add esp, 0xc
test eax, eax
je 0x1002feed
cmp dword [esi + 0xd4], 0
je 0x1002feed
xor eax, eax
inc eax
mov dword [edi + 0x21c], eax
and dword [edi + ebx*4 + 0x4b0], 0
jmp 0x1002ff50
mov dword [edi + ebx*4 + 0x4b0], 2
mov eax, dword [edi + 0x24c]
test eax, eax
je 0x1002ff1b
push eax
call fcn.1003b2a7
xor edx, edx
pop ecx
mov dword [edi + 0x24c], edx
xor eax, eax
mov dword [edi + 0x24c], edx
inc eax
push str.Proxy_replied_OK_to_CONNECT_request_n
push esi
mov dword [esi + 0x8600], eax
call fcn.10018194
and dword [esi + 0xc8], 0
pop ecx
pop ecx
jmp 0x1002f690
push str.Proxy_CONNECT_aborted_due_to_timeout
push esi
call fcn.10018208
pop ecx
pop ecx
push 0x38
pop eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret