Function at 0x51f040
Capabilities:
Check http status code

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
mov ecx, dword [ebp + 0xc]
xorps xmm0, xmm0
push ebx
push esi
mov esi, dword [ebp + 8]
xor bl, bl
push edi
mov dword [ebp - 0x38], 0
movlpd qword [ebp - 0x34], xmm0
mov eax, dword [esi + ecx*4 + 0x168]
add ecx, 0x128
mov edi, dword [esi]
mov dword [ebp - 0x2c], eax
xor al, al
cmp dword [esi + ecx*4], 2
lea ecx, [esi + ecx*4]
mov byte [ebp - 1], bl
mov byte [ebp - 2], al
mov dword [ebp - 0x28], 0
mov dword [ebp - 8], ecx
je 0x51fa1c
mov byte [esi + 0x230], al
mov eax, dword [ebp - 0x30]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x34]
mov dword [ebp - 0x18], eax
cmp dword [ecx], 0
jne 0x51f2e2
push dword [ebp + 0x14]
push dword [ebp + 0x10]
push str.Establish_HTTP_proxy_tunnel_to__s:_hu_n
push edi
call fcn.004f18d0
push dword [edi + 0x104]
call dword [0x8054c4]
add esp, 0x14
mov dword [edi + 0x104], 0
call fcn.005084b0
mov ebx, eax
test ebx, ebx
je 0x51f8e5
push dword [ebp + 0x14]
push dword [ebp + 0x10]
push str._s:_hu
call fcn.004f2060
add esp, 0xc
mov dword [ebp - 0x24], eax
test eax, eax
je 0x51f8dc
push 1
push eax
push str.CONNECT
push esi
call fcn.00508fe0
push dword [ebp - 0x24]
mov esi, eax
call dword [0x8054c4]
add esp, 0x14
test esi, esi
jne 0x51f2c8
mov edx, dword [ebp + 8]
mov ecx, 0x74a6ac
mov eax, 0x74a6b0
mov esi, 0x724c94
mov dword [ebp - 0x14], esi
mov dword [ebp - 0x20], esi
cmp dword [edx + 0x14c], 1
cmovne eax, ecx
mov cl, byte [edx + 0x221]
mov dword [ebp - 0x30], eax
mov eax, dword [ebp + 0x10]
cmp eax, dword [edx + 0x98]
je 0x51f16d
push 0x3a
push eax
call fcn.004c41f0
add esp, 8
test eax, eax
setne cl
push dword [ebp + 0x14]
test cl, cl
mov edx, 0x724c94
mov eax, 0x7487e4
cmove eax, edx
push eax
push dword [ebp + 0x10]
mov eax, 0x7487e8
cmove eax, edx
push eax
push str._s_s_s:_hu
call fcn.004f2060
add esp, 0x14
mov dword [ebp - 0x24], eax
test eax, eax
je 0x51f8dc
push str.Host:
push dword [ebp + 8]
call fcn.00508a10
add esp, 8
test eax, eax
jne 0x51f1d5
push dword [ebp - 0x24]
push str.Host:__s_r_n
call fcn.004f2060
mov esi, eax
add esp, 8
mov dword [ebp - 0x14], esi
test esi, esi
je 0x51f8b5
push str.Proxy_Connection:
push dword [ebp + 8]
call fcn.00508a10
test eax, eax
mov ecx, str.Proxy_Connection:_Keep_Alive_r_n
mov eax, 0x724c94
push str.User_Agent:
push dword [ebp + 8]
cmovne ecx, eax
mov dword [ebp - 0xc], ecx
call fcn.00508a10
add esp, 0x10
test eax, eax
jne 0x51f21c
cmp dword [edi + 0x370], eax
je 0x51f21c
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x260]
mov dword [ebp - 0x20], eax
push dword [ebp - 0xc]
mov eax, dword [ebp + 8]
mov ecx, 0x724c94
push dword [ebp - 0x20]
mov eax, dword [eax + 0x25c]
test eax, eax
cmovne ecx, eax
push ecx
push esi
push dword [ebp - 0x30]
push dword [ebp - 0x24]
push str.CONNECT__s_HTTP__s_r_n_s_s_s_s
push ebx
call fcn.00508670
mov esi, eax
add esp, 0x20
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x51f263
cmp byte [eax], 0
je 0x51f263
push eax
call dword [0x8054c4]
add esp, 4
push dword [ebp - 0x24]
call dword [0x8054c4]
add esp, 4
test esi, esi
jne 0x51f2b4
push ebx
push 1
push dword [ebp + 8]
call fcn.005086e0
mov esi, eax
add esp, 0xc
test esi, esi
jne 0x51f2b4
push 0x746770
push ebx
call fcn.00508670
mov esi, eax
add esp, 8
test esi, esi
jne 0x51f2b4
push dword [ebp + 0xc]
push eax
lea eax, [edi + 0x86ec]
push eax
push dword [ebp + 8]
push ebx
call fcn.005084c0
add esp, 0x14
mov esi, eax
xor ebx, ebx
test esi, esi
je 0x51f2c8
push str.Failed_sending_CONNECT_to_proxy
push edi
call fcn.004f1830
add esp, 8
push ebx
call fcn.00508480
add esp, 4
test esi, esi
jne 0x51f8d3
mov eax, dword [ebp - 8]
mov dword [eax], 1
push 1
push 0
push edi
call fcn.00500b20
add esp, 0xc
test eax, eax
jle 0x51fa25
cmp byte [ebp + 0x18], 0
jne 0x51f316
push 0
push 0xffffffffffffffff
push 0xffffffffffffffff
push dword [ebp - 0x2c]
call fcn.004fff20
add esp, 0x10
test eax, eax
je 0x51fa1c
lea eax, [edi + 0x584]
mov dword [ebp - 0x24], 0
mov ecx, 1
mov dword [ebp - 0x20], eax
mov dword [ebp - 0xc], ecx
mov esi, eax
xor ebx, ebx
test ecx, ecx
je 0x51f828
cmp dword [ebp - 0x28], 0
jne 0x51f9ce
push 1
push 0
push edi
call fcn.00500b20
mov ecx, eax
add esp, 0xc
test ecx, ecx
jle 0x51f8fd
mov eax, 0x3e8
cmp ecx, eax
cmovl eax, ecx
push eax
push 0xffffffffffffffff
push 0xffffffffffffffff
push dword [ebp - 0x2c]
call fcn.004fff20
add esp, 0x10
cmp eax, 0xffffffff
je 0x51f7f0
test eax, eax
je 0x51f805
lea eax, [ebp - 0x10]
push eax
mov eax, 0x4000
sub eax, dword [ebp - 0x24]
push eax
push dword [ebp - 0x20]
push dword [ebp - 0x2c]
push dword [ebp + 8]
call fcn.004f1950
add esp, 0x14
cmp eax, 0x51
je 0x51f818
test eax, eax
je 0x51f3bb
xor eax, eax
mov dword [ebp - 0xc], eax
jmp 0x51f805
mov ecx, dword [ebp - 0x10]
test ecx, ecx
jg 0x51f3fb
xor eax, eax
mov dword [ebp - 0xc], eax
cmp dword [edi + 0x140], eax
je 0x51f3f1
cmp dword [edi + 0x8620], eax
je 0x51f3f1
mov eax, dword [ebp + 8]
push str.Proxy_CONNECT_connection_closed_n
push edi
mov byte [eax + 0x230], 1
call fcn.004f18d0
jmp 0x51f802
push str.Proxy_CONNECT_aborted
jmp 0x51f7f5
add dword [ebp - 0x24], ecx
cmp dword [ebp - 0xc], 1
jle 0x51f4a3
mov eax, dword [ebp - 0x18]
lea edx, [edi + 0x584]
or eax, dword [ebp - 0x1c]
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x20], edx
je 0x51f44f
mov eax, ecx
mov ecx, dword [ebp - 0x18]
cdq
sub ecx, eax
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x18], ecx
sbb eax, edx
mov dword [ebp - 0x1c], eax
test eax, eax
jg 0x51f805
jl 0x51f445
test ecx, ecx
jne 0x51f805
xor eax, eax
mov dword [ebp - 0xc], eax
jmp 0x51f805
lea eax, [ebp - 0x14]
mov dword [ebp - 0x14], 0
push eax
push ecx
push edx
push dword [ebp + 8]
call fcn.005202b0
add esp, 0x10
cmp eax, 0xffffffff
jne 0x51f48d
push str.chunk_reading_DONE_n
push edi
call fcn.004f18d0
add esp, 8
xor eax, eax
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 8]
mov dword [eax], 2
jmp 0x51f805
push dword [ebp - 0x14]
push str.Read__zd_bytes_of_chunk__continue_n
push edi
call fcn.004f18d0
add esp, 0xc
jmp 0x51f805
xor eax, eax
mov dword [ebp - 0x14], eax
test ecx, ecx
jle 0x51f805
mov edx, dword [ebp - 0x20]
inc ebx
cmp byte [edx], 0xa
jne 0x51f689
cmp byte [edi + 0x2d8], 0
je 0x51f4d6
push dword [ebp + 8]
push ebx
push esi
push 1
push edi
call fcn.004f1750
add esp, 0x14
xor eax, eax
cmp byte [edi + 0x2cd], al
push ebx
setne al
push esi
add eax, 2
push eax
push dword [ebp + 8]
call fcn.004f1720
add dword [edi + 0x86e8], ebx
add esp, 0x10
add dword [edi + 0x80], ebx
test eax, eax
jne 0x51fa38
mov al, byte [esi]
cmp al, 0xd
je 0x51f69e
cmp al, 0xa
je 0x51f69e
mov cl, byte [ebx + esi]
lea eax, [ebx + esi]
push 0x11
push esi
push str.WWW_Authenticate:
mov dword [ebp - 0x30], eax
mov byte [ebp - 3], cl
mov byte [eax], 0
call fcn.004f1530
add esp, 0xc
test eax, eax
je 0x51f549
mov ebx, dword [edi + 0xc8]
cmp ebx, 0x191
je 0x51f56b
push 0x13
push esi
push str.Proxy_authenticate:
call fcn.004f1530
add esp, 0xc
test eax, eax
je 0x51f5b1
mov ebx, dword [edi + 0xc8]
cmp ebx, 0x197
jne 0x51f5b1
push esi
call fcn.00508ba0
mov esi, eax
add esp, 4
test esi, esi
je 0x51f8e5
cmp ebx, 0x197
push esi
sete al
movzx eax, al
push eax
push dword [ebp + 8]
call fcn.00508e40
push esi
mov ebx, eax
call dword [0x8054c4]
add esp, 0x10
test ebx, ebx
je 0x51f673
pop edi
pop esi
mov eax, ebx
pop ebx
mov esp, ebp
pop ebp
ret
push 0xf
push esi
push str.Content_Length:
call fcn.004f1530
add esp, 0xc
test eax, eax
je 0x51f5e0
push 0xa
push 0
add esi, 0xf
push esi
call fcn.004cc2d8
add esp, 0xc
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x1c], edx
jmp 0x51f673
push str.close
push str.Connection:
push esi
call fcn.00508ad0
add esp, 0xc
test al, al
je 0x51f5fd
mov byte [ebp - 1], 1
jmp 0x51f673
push str.chunked
push str.Transfer_Encoding:
push esi
call fcn.00508ad0
add esp, 0xc
test al, al
je 0x51f630
push str.CONNECT_responded_chunked_n
push edi
call fcn.004f18d0
push dword [ebp + 8]
mov byte [ebp - 2], 1
call fcn.00520290
add esp, 0xc
jmp 0x51f673
push str.close
push str.Proxy_Connection:
push esi
call fcn.00508ad0
add esp, 0xc
test al, al
je 0x51f64d
mov byte [ebp - 1], 1
jmp 0x51f673
lea ebx, [edi + 0xc8]
push ebx
lea eax, [ebp - 0x38]
push eax
push str.HTTP_1._d__d
push esi
call fcn.0041e410
add esp, 0x10
cmp eax, 2
jne 0x51f673
mov eax, dword [ebx]
mov dword [edi + 0x86d8], eax
mov eax, dword [ebp - 0x30]
xor ebx, ebx
mov edx, dword [ebp - 0x20]
mov cl, byte [ebp - 3]
mov byte [eax], cl
mov ecx, dword [ebp - 0x10]
lea esi, [edx + 1]
mov eax, dword [ebp - 0x14]
inc eax
inc edx
mov dword [ebp - 0x20], edx
mov dword [ebp - 0x14], eax
cmp eax, ecx
jl 0x51f4b3
jmp 0x51f805
cmp dword [edi + 0xc8], 0x197
lea eax, [edi + 0x584]
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x20], eax
jne 0x51f7ba
cmp byte [edi + 0x8628], 0
jne 0x51f7ba
mov ecx, dword [ebp - 0x18]
mov eax, ecx
mov edx, dword [ebp - 0x1c]
or eax, edx
mov dword [ebp - 0xc], 2
je 0x51f72c
push edx
push ecx
push str.Ignore__I64d_bytes_of_response_body_n
push edi
call fcn.004f18d0
mov eax, dword [ebp - 0x10]
add esp, 0x10
sub eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x18]
cdq
sub ecx, eax
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x18], ecx
sbb eax, edx
mov dword [ebp - 0x1c], eax
test eax, eax
jg 0x51f7e5
jl 0x51f717
test ecx, ecx
jne 0x51f7e5
mov eax, dword [ebp - 8]
mov dword [ebp - 0xc], 0
mov dword [eax], 2
jmp 0x51f805
mov al, byte [ebp - 2]
test al, al
je 0x51f717
mov eax, dword [ebp - 0x10]
sub eax, dword [ebp - 0x14]
push eax
push str._zd_bytes_of_chunk_left_n
push edi
mov byte [edi + 0xfd], 1
call fcn.004f18d0
add esp, 0xc
cmp byte [esi + 1], 0xa
jne 0x51f759
inc esi
inc dword [ebp - 0x14]
lea eax, [ebp - 0x10]
push eax
mov eax, dword [ebp - 0x10]
sub eax, dword [ebp - 0x14]
push eax
lea eax, [esi + 1]
push eax
push dword [ebp + 8]
call fcn.005202b0
add esp, 0x10
cmp eax, 0xffffffff
jne 0x51f79e
push str.chunk_reading_DONE_n
push edi
call fcn.004f18d0
mov eax, dword [ebp - 8]
add esp, 8
mov dword [ebp - 0xc], 0
mov dword [eax], 2
mov dword [eax], 2
jmp 0x51f805
push dword [ebp - 0x10]
push str.Read__zd_bytes_of_chunk__continue_n
push edi
call fcn.004f18d0
mov eax, dword [ebp - 8]
add esp, 0xc
mov dword [eax], 2
jmp 0x51f805
xor eax, eax
cmp dword [edi + 0x86d8], 0xc8
mov dword [ebp - 0xc], eax
jne 0x51f7e5
mov eax, dword [ebp - 0x10]
sub eax, dword [ebp - 0x14]
add eax, 0xffffffff
je 0x51f7e5
push eax
push str.Proxy_CONNECT_followed_by__zd_bytes_of_opaque_data._Data_ignored__known_bug_39_
push edi
call fcn.004f1830
add esp, 0xc
mov eax, dword [ebp - 8]
mov dword [eax], 2
jmp 0x51f805
push str.Proxy_CONNECT_aborted_due_to_select_poll_error
push edi
mov dword [ebp - 0x28], 1
call fcn.004f1830
add esp, 8
push dword [ebp + 8]
call fcn.00505390
add esp, 4
test eax, eax
jne 0x51f8f1
cmp dword [ebp - 0x24], 0x4000
mov ecx, dword [ebp - 0xc]
jb 0x51f332
cmp dword [ebp - 0x28], 0
jne 0x51f9ce
cmp dword [edi + 0x86d8], 0xc8
mov esi, dword [ebp + 8]
je 0x51f861
push esi
call fcn.00508c70
add esp, 4
test eax, eax
jne 0x51fa38
cmp byte [esi + 0x219], al
je 0x51f861
mov bl, 1
mov byte [ebp - 1], bl
jmp 0x51f868
mov bl, byte [ebp - 1]
test bl, bl
je 0x51f875
cmp dword [edi + 0x104], 0
jne 0x51f917
cmp dword [edi + 0x104], 0
mov ecx, dword [ebp - 8]
je 0x51f938
cmp dword [ecx], 2
jne 0x51f8a3
push 0
push str.TUNNEL_STATE_switched_to:__d_n
push edi
mov dword [ecx], 0
call fcn.004f18d0
mov ecx, dword [ebp - 8]
add esp, 0xc
cmp dword [edi + 0x104], 0
jne 0x51f0a3
jmp 0x51f938
push dword [ebp - 0x24]
call dword [0x8054c4]
push ebx
call fcn.00508480
add esp, 8
mov eax, 0x1b
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push ebx
call fcn.00508480
add esp, 4
pop edi
pop esi
mov eax, 0x1b
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
mov eax, 0x2a
pop ebx
mov esp, ebp
pop ebp
ret
push str.Proxy_CONNECT_aborted_due_to_timeout
push edi
call fcn.004f1830
add esp, 8
mov eax, 0x38
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 0xc]
push dword [esi + eax*4 + 0x168]
push esi
call fcn.005002c0
mov eax, dword [ebp + 0xc]
add esp, 8
mov dword [esi + eax*4 + 0x168], 0xffffffff
cmp dword [edi + 0xc8], 0xc8
je 0x51f9da
test bl, bl
je 0x51f96c
cmp dword [edi + 0x104], 0
je 0x51f96c
push str.Connect_me_again_please_n
push edi
mov byte [esi + 0x230], 1
call fcn.004f18d0
add esp, 8
jmp 0x51f9a8
push dword [edi + 0x104]
call dword [0x8054c4]
push 2
push esi
mov dword [edi + 0x104], 0
call fcn.00500320
mov ebx, dword [ebp + 0xc]
push dword [esi + ebx*4 + 0x168]
push esi
call fcn.005002c0
add esp, 0x14
mov dword [esi + ebx*4 + 0x168], 0xffffffff
mov eax, dword [ebp - 8]
mov dword [eax], 0
cmp byte [esi + 0x230], 0
jne 0x51fa1c
push dword [edi + 0xc8]
push str.Received_HTTP_code__d_from_proxy_after_CONNECT
push edi
call fcn.004f1830
add esp, 0xc
pop edi
pop esi
mov eax, 0x38
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 8]
mov dword [eax], 2
push dword [esi + 0x25c]
call dword [0x8054c4]
push str.Proxy_replied_OK_to_CONNECT_request_n
mov dword [esi + 0x25c], 0
push edi
mov byte [edi + 0x8624], 1
call fcn.004f18d0
mov byte [edi + 0xfd], 0
add esp, 0xc
mov byte [esi + 0x22a], 0
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
push str.Proxy_CONNECT_aborted_due_to_timeout
push edi
call fcn.004f1830
mov eax, 0x38
add esp, 8
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret