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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x54
and dword [ebp - 0x50], 0
xorps xmm0, xmm0
push ebx
push esi
push edi
mov edi, ecx
movlpd qword [ebp - 0x48], xmm0
mov ebx, edx
mov ecx, 0x36ee80
mov dword [ebp - 0x10], ebx
mov esi, dword [edi]
mov eax, dword [esi + 0x19c]
test eax, eax
cmovne ecx, eax
mov eax, dword [edi + ebx*4 + 0x130]
mov dword [ebp - 0x34], eax
xor eax, eax
and dword [ebp - 0x2c], eax
cmp dword [edi + ebx*4 + 0x484], 2
mov dword [ebp - 0x3c], ecx
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x4c], eax
jne 0x5178b4
xor eax, eax
jmp 0x51818c
and dword [edi + 0x1f8], eax
mov eax, dword [ebp - 0x44]
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x48]
mov dword [ebp - 0x14], eax
cmp dword [edi + ebx*4 + 0x484], 0
jne 0x517afa
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.00500cc1
mov eax, dword [esi + 0xd4]
add esp, 0x10
test eax, eax
je 0x517903
push eax
call dword [sym.imp.MSVCR120.dll_free]
and dword [esi + 0xd4], 0
pop ecx
xor eax, eax
inc eax
push 0xc
push eax
call dword [0x5b6c50]
mov ebx, eax
pop ecx
pop ecx
test ebx, ebx
je 0x5180c0
movzx eax, word [ebp + 0xc]
push eax
push dword [ebp + 8]
push str._s:_hu
call fcn.0050af90
add esp, 0xc
mov dword [ebp - 0x44], eax
test eax, eax
je 0x5180c7
push 1
push eax
mov edx, str.CONNECT
mov ecx, edi
call fcn.00504f72
push dword [ebp - 0x44]
mov dword [ebp - 0xc], eax
call dword [sym.imp.MSVCR120.dll_free]
add esp, 0xc
cmp dword [ebp - 0xc], 0
jne 0x517ad4
cmp dword [edi + 0x114], 1
mov eax, 0x5708be
mov dword [ebp - 0x24], eax
mov ecx, 0x589c04
mov dword [ebp - 0x20], eax
mov edx, 0x5708be
mov eax, 0x589c08
cmovne eax, ecx
mov ecx, dword [edi + 0x1b8]
mov dword [ebp - 0x1c], eax
test ecx, ecx
movzx eax, word [ebp + 0xc]
push eax
mov eax, 0x57dcf8
cmove eax, edx
push eax
push dword [ebp + 8]
mov eax, str.___:__t
cmove eax, edx
push eax
push str._s_s_s:_hu
call fcn.0050af90
add esp, 0x14
mov dword [ebp - 0x28], eax
test eax, eax
je 0x5180c7
mov edx, str.Host:
mov ecx, esi
call fcn.0050494f
test eax, eax
jne 0x5179ee
push dword [ebp - 0x28]
push str.Host:__s_r_n
call fcn.0050af90
mov dword [ebp - 0x24], eax
pop ecx
pop ecx
test eax, eax
je 0x5180b0
mov edx, str.Proxy_Connection:
mov ecx, esi
call fcn.0050494f
test eax, eax
mov ecx, str.Proxy_Connection:_Keep_Alive_r_n
mov eax, 0x5708be
mov edx, str.User_Agent:
cmovne ecx, eax
mov dword [ebp - 0x44], ecx
mov ecx, esi
call fcn.0050494f
test eax, eax
jne 0x517a2d
cmp dword [esi + 0x3a4], eax
je 0x517a2d
mov eax, dword [edi + 0x22c]
mov dword [ebp - 0x20], eax
push dword [ebp - 0x44]
mov eax, dword [edi + 0x228]
mov ecx, 0x5708be
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.0050545d
mov dword [ebp - 0xc], eax
add esp, 0x20
mov eax, dword [ebp - 0x24]
test eax, eax
je 0x517a72
cmp byte [eax], 0
je 0x517a72
push eax
call dword [sym.imp.MSVCR120.dll_free]
pop ecx
push dword [ebp - 0x28]
call dword [sym.imp.MSVCR120.dll_free]
mov eax, dword [ebp - 0xc]
pop ecx
test eax, eax
jne 0x517ac1
mov edx, ebx
mov ecx, edi
call fcn.00505812
mov dword [ebp - 0xc], eax
test eax, eax
jne 0x517ac1
push 0x57fbc0
push ebx
call fcn.0050545d
mov dword [ebp - 0xc], eax
pop ecx
pop ecx
test eax, eax
jne 0x517ac1
push dword [ebp - 0x10]
mov edx, edi
mov ecx, ebx
push eax
lea eax, [esi + 0x86c4]
push eax
call fcn.005052cf
add esp, 0xc
mov dword [ebp - 0xc], eax
xor ebx, ebx
test eax, eax
je 0x517aeb
push str.Failed_sending_CONNECT_to_proxy
push esi
call fcn.00500d35
pop ecx
pop ecx
test ebx, ebx
je 0x517ae0
push ebx
call dword [sym.imp.MSVCR120.dll_free]
pop ecx
mov eax, dword [ebp - 0xc]
test eax, eax
jne 0x51818c
mov eax, dword [ebp - 0x10]
xor ebx, ebx
inc ebx
mov dword [edi + eax*4 + 0x484], ebx
jmp 0x517afd
xor ebx, ebx
inc ebx
push dword [edi + 0x124]
push dword [edi + 0x120]
call fcn.00508db9
push edx
push eax
call fcn.00508dcf
mov ecx, dword [ebp - 0x3c]
add esp, 0x10
sub ecx, eax
test ecx, ecx
jle 0x51817c
cmp dword [esi + 0x540], 2
jne 0x517b47
mov ecx, dword [ebp - 0x34]
or edx, 0xffffffff
push 0
push 0xffffffffffffffff
call fcn.00507d77
pop ecx
pop ecx
test eax, eax
je 0x5178ad
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 0x517ce7
cmp dword [ebp - 0x2c], 0
jne 0x518189
push dword [edi + 0x124]
push dword [edi + 0x120]
call fcn.00508db9
push edx
push eax
call fcn.00508dcf
mov ecx, dword [ebp - 0x3c]
add esp, 0x10
sub ecx, eax
test ecx, ecx
jle 0x51804b
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.00507d77
pop ecx
pop ecx
cmp eax, 0xffffffff
je 0x518041
test eax, eax
je 0x517ccb
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.00501180
add esp, 0xc
cmp eax, 0x51
je 0x517cda
test eax, eax
jne 0x517c75
mov ebx, dword [ebp - 0x38]
mov dword [ebp - 0x44], ebx
test ebx, ebx
jg 0x517c36
xor ebx, ebx
mov dword [ebp - 8], ebx
cmp dword [esi + 0x118], ebx
je 0x517c1e
cmp dword [esi + 0x85fc], ebx
je 0x517c1e
inc eax
mov dword [edi + 0x1f8], eax
jmp 0x517ccb
push str.Proxy_CONNECT_aborted
xor eax, eax
inc eax
push esi
mov dword [ebp - 0x2c], eax
call fcn.00500d35
pop ecx
pop ecx
jmp 0x517ccb
add dword [ebp - 0x28], ebx
cmp dword [ebp - 8], 1
jle 0x517d29
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 0x517c7c
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 0x517cc8
jl 0x517c75
test ecx, ecx
jne 0x517cc8
xor ebx, ebx
mov dword [ebp - 8], ebx
jmp 0x517ccb
and dword [ebp - 0x1c], 0
lea eax, [ebp - 0x1c]
push eax
mov edx, ecx
mov ecx, edi
push ebx
call fcn.00518dc9
pop ecx
pop ecx
cmp eax, 0xffffffff
jne 0x517cb7
push str.chunk_reading_DONE_n
push esi
call fcn.00500cc1
pop ecx
pop ecx
xor ebx, ebx
mov dword [ebp - 8], ebx
mov eax, dword [ebp - 0x10]
mov dword [edi + eax*4 + 0x484], 2
jmp 0x517ccb
push dword [ebp - 0x1c]
push str.Read__zd_bytes_of_chunk__continue_n
push esi
call fcn.00500cc1
add esp, 0xc
mov ebx, dword [ebp - 8]
mov ecx, edi
call fcn.0050865f
test eax, eax
jne 0x5180d0
cmp dword [ebp - 0x28], 0x4000
jb 0x517b5e
mov eax, dword [ebp - 0x2c]
test eax, eax
jne 0x518189
cmp dword [esi + 0x86b0], 0xc8
je 0x518063
mov ecx, edi
call fcn.00504cde
test eax, eax
jne 0x51818c
mov eax, dword [ebp - 0x30]
cmp dword [edi + 0x1a0], 0
push 1
pop ecx
cmovne eax, ecx
mov dword [ebp - 0x30], eax
jmp 0x518066
xor eax, eax
mov dword [ebp - 0x1c], eax
test ebx, ebx
jle 0x517cc8
mov ecx, dword [ebp - 0x24]
mov edx, dword [ebp - 0x20]
inc edx
cmp byte [ecx], 0xa
mov dword [ebp - 0x20], edx
jne 0x517ef0
cmp dword [esi + 0x2e4], 0
je 0x517d63
mov ecx, dword [ebp - 0xc]
xor eax, eax
push edi
push edx
push ecx
lea edx, [eax + 1]
mov ecx, esi
call fcn.005012e0
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.0050104b
pop ecx
pop ecx
test eax, eax
jne 0x51818c
mov ecx, dword [ebp - 0xc]
mov al, byte [ecx]
cmp al, 0xd
je 0x517f05
cmp al, 0xa
je 0x517f05
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.00514e2d
pop ecx
test eax, eax
je 0x517dcd
mov edx, dword [esi + 0x90]
cmp edx, 0x191
je 0x517def
mov edx, dword [ebp - 0xc]
mov ecx, str.Proxy_authenticate:
push 0x13
call fcn.00514e2d
pop ecx
test eax, eax
je 0x517e07
mov edx, dword [esi + 0x90]
cmp edx, 0x197
jne 0x517e07
push dword [ebp - 0xc]
mov ecx, edi
call fcn.0050506d
pop ecx
test eax, eax
jne 0x51818c
jmp 0x517ed3
mov edx, dword [ebp - 0xc]
mov ecx, str.Content_Length:
push 0xf
call fcn.00514e2d
pop ecx
test eax, eax
je 0x517e3a
mov eax, dword [ebp - 0xc]
push 0xa
add eax, 0xf
push 0
push eax
call dword [sym.imp.MSVCR120.dll__strtoi64]
add esp, 0xc
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x18], edx
jmp 0x517ed3
mov ecx, dword [ebp - 0xc]
mov edx, str.Connection:
push str.close
call fcn.00505564
pop ecx
test eax, eax
jne 0x517e9f
mov ecx, dword [ebp - 0xc]
mov edx, str.Transfer_Encoding:
push str.chunked
call fcn.00505564
pop ecx
test eax, eax
je 0x517e88
push str.CONNECT_responded_chunked_n
push esi
call fcn.00500cc1
and dword [edi + 0x18], 0
xor eax, eax
inc eax
and dword [edi + 0x24], 0
pop ecx
pop ecx
mov dword [ebp - 0x4c], eax
mov dword [edi + 0x1c], eax
jmp 0x517ed3
mov ecx, dword [ebp - 0xc]
mov edx, str.Proxy_Connection:
push str.close
call fcn.00505564
pop ecx
test eax, eax
je 0x517ea7
xor eax, eax
inc eax
mov dword [ebp - 0x30], eax
jmp 0x517ed3
lea ebx, [esi + 0x90]
push ebx
lea eax, [ebp - 0x50]
push eax
push str.HTTP_1._d__d
push dword [ebp - 0xc]
call dword [sym.imp.MSVCR120.dll_sscanf]
add esp, 0x10
cmp eax, 2
jne 0x517ed0
mov eax, dword [ebx]
mov dword [esi + 0x86b0], eax
mov ebx, dword [ebp - 0x44]
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 0x517d38
jmp 0x517cc8
and dword [ebp - 0x28], 0
lea eax, [esi + 0x55c]
cmp dword [esi + 0x90], 0x197
mov dword [ebp - 0x24], eax
jne 0x51800f
cmp dword [esi + 0x860c], 0
jne 0x51800f
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 0x517f82
push edx
push ecx
push str.Ignore__lld_bytes_of_response_body_n
push esi
call fcn.00500cc1
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 0x518039
jl 0x517ca2
test ecx, ecx
jne 0x518039
jmp 0x517ca2
mov eax, dword [ebp - 0x4c]
test eax, eax
je 0x517ca2
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.00500cc1
mov eax, dword [ebp - 0xc]
add esp, 0xc
inc eax
cmp byte [eax], 0xa
jne 0x517fbc
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x1c]
inc eax
jmp 0x517fbf
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.00518dc9
pop ecx
pop ecx
cmp eax, 0xffffffff
jne 0x517fff
push str.chunk_reading_DONE_n
push esi
call fcn.00500cc1
mov eax, dword [ebp - 0x10]
xor ebx, ebx
pop ecx
pop ecx
mov dword [ebp - 8], ebx
mov dword [edi + eax*4 + 0x484], 2
jmp 0x517caa
push dword [ebp - 0x38]
push str.Read__zd_bytes_of_chunk__continue_n
push esi
call fcn.00500cc1
jmp 0x518036
xor eax, eax
cmp dword [esi + 0x86b0], 0xc8
mov dword [ebp - 8], eax
jne 0x518039
sub ebx, dword [ebp - 0x1c]
lea eax, [ebx - 1]
test eax, eax
je 0x518039
push eax
push str.Proxy_CONNECT_followed_by__zd_bytes_of_opaque_data._Data_ignored__known_bug_39_
push esi
call fcn.00500d35
add esp, 0xc
mov ebx, dword [ebp - 8]
jmp 0x517ca7
push str.Proxy_CONNECT_aborted_due_to_select_poll_error
jmp 0x517c23
push str.Proxy_CONNECT_aborted_due_to_timeout
push esi
call fcn.00500d35
pop ecx
pop ecx
push 2
pop eax
mov dword [ebp - 0x2c], eax
jmp 0x517cea
mov eax, dword [ebp - 0x30]
test eax, eax
je 0x518073
cmp dword [esi + 0xd4], 0
jne 0x5180d7
cmp dword [esi + 0xd4], 0
mov ebx, dword [ebp - 0x10]
je 0x5180f0
cmp dword [edi + ebx*4 + 0x484], 2
jne 0x5180a1
and dword [edi + ebx*4 + 0x484], 0
push 0
push str.TUNNEL_STATE_switched_to:__d_n
push esi
call fcn.00500cc1
add esp, 0xc
cmp dword [esi + 0xd4], 0
jne 0x5178c6
jmp 0x5180f0
push dword [ebp - 0x28]
mov esi, dword [sym.imp.MSVCR120.dll_free]
call esi
pop ecx
push ebx
call esi
pop ecx
push 0x1b
jmp 0x51818b
push ebx
call dword [sym.imp.MSVCR120.dll_free]
jmp 0x5180bf
push 0x2a
jmp 0x51818b
mov ebx, dword [ebp - 0x10]
mov ecx, edi
mov edx, dword [edi + ebx*4 + 0x130]
call fcn.0050004b
or dword [edi + ebx*4 + 0x130], 0xffffffff
mov eax, dword [esi + 0x90]
cmp eax, 0xc8
je 0x51812f
push eax
push str.Received_HTTP_code__d_from_proxy_after_CONNECT
push esi
call fcn.00500d35
mov eax, dword [ebp - 0x30]
add esp, 0xc
test eax, eax
je 0x518125
cmp dword [esi + 0xd4], 0
je 0x518125
xor eax, eax
inc eax
mov dword [edi + 0x1f8], eax
and dword [edi + ebx*4 + 0x484], 0
jmp 0x518189
mov dword [edi + ebx*4 + 0x484], 2
mov eax, dword [edi + 0x228]
test eax, eax
je 0x518153
push eax
call dword [sym.imp.MSVCR120.dll_free]
and dword [edi + 0x228], 0
pop ecx
and dword [edi + 0x228], 0
xor eax, eax
inc eax
push str.Proxy_replied_OK_to_CONNECT_request_n
push esi
mov dword [esi + 0x8600], eax
call fcn.00500cc1
and dword [esi + 0xc8], 0
pop ecx
pop ecx
jmp 0x5178ad
push str.Proxy_CONNECT_aborted_due_to_timeout
push esi
call fcn.00500d35
pop ecx
pop ecx
push 0x38
pop eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret