Function at 0x18021e670
Capabilities:
Check http status code

Disassembly:
mov rax, rsp
mov word [rax + 0x20], r9w
mov qword [rax + 0x18], r8
mov dword [rax + 0x10], edx
mov qword [rax + 8], rcx
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x98
mov r15, qword [rcx]
mov dword [rax - 0x58], 0
mov esi, 0x36ee80
mov eax, dword [r15 + 0x278]
mov rbp, r8
mov r12, rcx
test eax, eax
cmovne esi, eax
xor r8d, r8d
movsxd rax, edx
mov rdi, qword [rcx + rax*8 + 0x120]
xor bl, bl
xor al, al
mov dword [rsp + 0x60], esi
mov qword [rsp + 0x70], r8
mov dword [rsp + 0x64], r8d
mov qword [rsp + 0x78], rdi
mov byte [rsp + 0x50], bl
mov byte [rsp + 0x51], al
mov byte [rcx + 0x1bd], al
nop word [rax + rax]
cmp byte [r12 + 0x1b5], 0
jne 0x18021e95c
movzx r13d, r9w
lea rdx, str.Establish_HTTP_proxy_tunnel_to__s:_d_n
mov r8, rbp
mov r9d, r13d
mov rcx, r15
call fcn.180203670
mov rcx, qword [r15 + 0x168]
test rcx, rcx
je 0x18021e735
call qword [0x1803d58f8]
mov qword [r15 + 0x168], 0
mov edx, 1
lea ecx, [rdx + 0x17]
call qword [case.0x18020c598.3]
mov rdi, rax
test rax, rax
je 0x18021ef1b
lea rcx, str._s:_d
mov r8d, r13d
mov rdx, rbp
call fcn.180212e70
mov r14, rax
test rax, rax
je 0x18021ef12
lea rdx, str.CONNECT
mov r9b, 1
mov r8, rax
mov rcx, r12
call fcn.18021c3e0
mov ebx, eax
test eax, eax
jne 0x18021e930
mov rbx, qword [r15 + 0x2b0]
lea rax, [0x180235cc3]
lea r12, [0x1803509c8]
mov rsi, rax
mov rbp, rax
mov rax, qword [rsp + 0xe0]
cmp dword [rax + 0x108], 1
lea rax, [0x18023690c]
cmove r12, rax
test rbx, rbx
je 0x18021e7fa
nop word [rax + rax]
mov rcx, qword [rbx]
lea rdx, str.Host:
mov r8d, 5
call fcn.180221670
test eax, eax
jne 0x18021e7f4
mov rbx, qword [rbx + 8]
test rbx, rbx
jne 0x18021e7d0
jmp 0x18021e7fa
cmp qword [rbx], 0
jne 0x18021e815
lea rcx, str.Host:__s_r_n
mov rdx, r14
call fcn.180212e70
mov rsi, rax
test rax, rax
je 0x18021eeef
lea rdx, str.Proxy_Connection:
mov rcx, r15
call fcn.18021be40
lea rbx, str.Proxy_Connection:_Keep_Alive_r_n
lea rdx, str.User_Agent:
test rax, rax
lea rax, [0x180235cc3]
mov rcx, r15
cmovne rbx, rax
call fcn.18021be40
test rax, rax
mov rax, qword [rsp + 0xe0]
jne 0x18021e866
cmp qword [r15 + 0x4e0], 0
je 0x18021e866
mov rbp, qword [rax + 0x1e0]
mov rax, qword [rax + 0x1d8]
mov r8, qword [rsp + 0xf0]
mov qword [rsp + 0x40], rbx
mov qword [rsp + 0x38], rbp
test rax, rax
lea rcx, [0x180235cc3]
cmovne rcx, rax
lea rdx, str.CONNECT__s:_d_HTTP__s_r_n_s_s_s_s
mov r9d, r13d
mov qword [rsp + 0x30], rcx
mov rcx, rdi
mov qword [rsp + 0x28], rsi
mov qword [rsp + 0x20], r12
call fcn.18021cff0
mov ebx, eax
test rsi, rsi
je 0x18021e8c3
cmp byte [rsi], 0
je 0x18021e8c3
mov rcx, rsi
call qword [0x1803d58f8]
mov r12, qword [rsp + 0xe0]
test ebx, ebx
jne 0x18021e917
mov rdx, rdi
mov rcx, r12
call fcn.18021d150
mov ebx, eax
test eax, eax
jne 0x18021e917
lea rdx, [0x18034fd28]
mov rcx, rdi
call fcn.18021cff0
mov ebx, eax
test eax, eax
jne 0x18021e917
mov eax, dword [rsp + 0xe8]
lea r8, [r15 + 0x8848]
xor r9d, r9d
mov rdx, r12
mov rcx, rdi
mov dword [rsp + 0x20], eax
call fcn.18021c890
mov ebx, eax
xor edi, edi
test ebx, ebx
je 0x18021e92c
lea rdx, str.Failed_sending_CONNECT_to_proxy
mov rcx, r15
call fcn.180203720
mov esi, dword [rsp + 0x60]
mov rcx, r14
call qword [0x1803d58f8]
mov rcx, rdi
call fcn.180204200
test ebx, ebx
jne 0x18021ef0b
movzx ebx, byte [rsp + 0x50]
mov rdi, qword [rsp + 0x78]
mov byte [r12 + 0x1b5], 1
call fcn.1802208b0
mov rdx, qword [r12 + 0x110]
mov rcx, rax
call fcn.1802208f0
mov ecx, esi
sub ecx, eax
test ecx, ecx
jle 0x18021ef6f
cmp dword [r15 + 0x668], 2
jne 0x18021e99e
xor r8d, r8d
or rdx, 0xffffffffffffffff
mov rcx, rdi
call fcn.18021f6a0
test eax, eax
je 0x18021eff3
mov esi, 1
xor ebp, ebp
xor ebx, ebx
mov byte [r12 + 0x1b5], 0
lea r13, [r15 + 0x698]
lea rdi, [r15 + 0x698]
mov dword [rsp + 0x54], esi
xor r14d, r14d
test esi, esi
je 0x18021ed4d
cmp dword [rsp + 0x64], 0
jne 0x18021efb4
call fcn.1802208b0
mov rdx, qword [r12 + 0x110]
mov rcx, rax
call fcn.1802208f0
mov ecx, dword [rsp + 0x60]
sub ecx, eax
test ecx, ecx
jle 0x18021ef2f
mov r8d, 0x3e8
cmp ecx, r8d
cmovl r8d, ecx
mov rcx, qword [rsp + 0x78]
or rdx, 0xffffffffffffffff
call fcn.18021f6a0
cmp eax, 0xffffffff
je 0x18021ee8f
test eax, eax
je 0x18021ed30
mov rdx, qword [rsp + 0x78]
lea rax, [rsp + 0x68]
mov r9d, 0x4000
sub r9, rbp
mov r8, r13
mov rcx, r12
mov qword [rsp + 0x20], rax
call fcn.1802032e0
test eax, eax
js 0x18021ed40
je 0x18021ea5f
xor esi, esi
mov dword [rsp + 0x54], esi
jmp 0x18021ed30
mov rcx, qword [rsp + 0x68]
test rcx, rcx
jg 0x18021eaab
xor esi, esi
mov dword [rsp + 0x54], esi
cmp dword [r15 + 0x1c8], esi
je 0x18021ea8f
cmp dword [r15 + 0x8790], esi
je 0x18021ea8f
mov byte [r12 + 0x1bd], 1
jmp 0x18021ed30
lea rdx, str.Proxy_CONNECT_aborted
mov rcx, r15
mov dword [rsp + 0x64], 1
call fcn.180203720
jmp 0x18021ed30
add rbp, rcx
mov qword [rsp + 0x58], rbp
cmp esi, 1
jle 0x18021eb34
mov rax, qword [rsp + 0x70]
xor ebp, ebp
lea r13, [r15 + 0x698]
test rax, rax
je 0x18021eae7
sub rax, rcx
mov qword [rsp + 0x70], rax
test rax, rax
jg 0x18021ed30
xor esi, esi
mov dword [rsp + 0x54], esi
jmp 0x18021ed30
mov r8, rcx
lea r9, [rsp + 0x58]
mov rdx, r13
mov rcx, r12
mov qword [rsp + 0x58], rbp
call fcn.1802235d0
mov rcx, r15
cmp eax, 0xffffffff
jne 0x18021eb1e
lea rdx, str.chunk_reading_DONE_n
call fcn.180203670
xor esi, esi
mov dword [rsp + 0x54], esi
jmp 0x18021ed30
mov r8, qword [rsp + 0x58]
lea rdx, str.Read__d_bytes_of_chunk__continue_n
call fcn.180203670
jmp 0x18021ed30
xor ebp, ebp
test rcx, rcx
jle 0x18021ed2b
nop
inc ebx
inc r14
cmp byte [r13], 0xa
jne 0x18021ed16
cmp byte [r15 + 0x3d8], 0
je 0x18021eb72
movsxd r9, ebx
mov r8, rdi
mov edx, 1
mov rcx, r15
mov qword [rsp + 0x20], r12
call fcn.180203510
cmp byte [r15 + 0x3cb], 0
mov edx, 2
mov eax, 3
movsxd r9, ebx
mov r8, rdi
mov rcx, r12
cmovne edx, eax
call fcn.180203910
test eax, eax
jne 0x18021eff5
movzx eax, byte [rdi]
cmp al, 0xd
je 0x18021ed92
cmp al, 0xa
je 0x18021ed92
movzx esi, byte [r14 + rdi]
lea rcx, str.WWW_Authenticate:
mov r8d, reloc.WS2_32.dll_recvfrom
mov rdx, rdi
mov byte [r14 + rdi], 0
call fcn.180221670
test eax, eax
je 0x18021ebe2
mov edx, dword [r15 + 0xc0]
cmp edx, 0x191
je 0x18021ec0a
lea rcx, str.Proxy_authenticate:
mov r8d, reloc.WS2_32.dll_send
mov rdx, rdi
call fcn.180221670
test eax, eax
je 0x18021ec22
mov edx, dword [r15 + 0xc0]
cmp edx, 0x197
jne 0x18021ec22
mov r8, rdi
mov rcx, r12
call fcn.18021c5f0
test eax, eax
jne 0x18021eff5
jmp 0x18021ed04
lea rcx, str.Content_Length:
mov r8d, reloc.WS2_32.dll_ntohs
mov rdx, rdi
call fcn.180221670
test eax, eax
je 0x18021ec55
xor edx, edx
lea rcx, [rdi + 0xf]
lea r8d, [rdx + 0xa]
call qword [sym.imp.MSVCR100.dll__strtoi64]
mov qword [rsp + 0x70], rax
jmp 0x18021ed04
lea r8, str.close
lea rdx, str.Connection:
mov rcx, rdi
call fcn.18021cb80
test al, al
je 0x18021ec79
mov byte [rsp + 0x50], 1
jmp 0x18021ed04
lea r8, str.chunked
lea rdx, str.Transfer_Encoding:
mov rcx, rdi
call fcn.18021cb80
test al, al
je 0x18021ecb1
lea rdx, str.CONNECT_responded_chunked_n
mov rcx, r15
call fcn.180203670
mov rcx, r12
mov byte [rsp + 0x51], 1
call fcn.1802235b0
jmp 0x18021ed04
lea r8, str.close
lea rdx, str.Proxy_Connection:
mov rcx, rdi
call fcn.18021cb80
test al, al
je 0x18021ecd2
mov byte [rsp + 0x50], 1
jmp 0x18021ed04
lea r9, [r15 + 0xc0]
lea r8, [rsp + 0x80]
lea rdx, str.HTTP_1._d__d
mov rcx, rdi
call qword [sym.imp.MSVCR100.dll_sscanf]
cmp eax, 2
jne 0x18021ed04
mov eax, dword [r15 + 0xc0]
mov dword [r15 + 0x8834], eax
mov rcx, qword [rsp + 0x68]
mov byte [r14 + rdi], sil
xor ebx, ebx
xor r14d, r14d
lea rdi, [r13 + 1]
inc ebp
inc r13
movsxd rax, ebp
cmp rax, rcx
jl 0x18021eb40
mov esi, dword [rsp + 0x54]
mov rbp, qword [rsp + 0x58]
mov rcx, r12
call fcn.180220e50
test eax, eax
jne 0x18021ef25
cmp rbp, 0x4000
jb 0x18021e9c5
cmp dword [rsp + 0x64], 0
jne 0x18021efb4
cmp dword [r15 + 0x8834], 0xc8
je 0x18021eeab
mov rcx, r12
call fcn.18021ce00
test eax, eax
jne 0x18021eff5
cmp byte [r12 + 0x1a8], al
je 0x18021eeab
mov bl, 1
mov byte [rsp + 0x50], bl
jmp 0x18021eeb4
cmp dword [r15 + 0xc0], 0x197
mov qword [rsp + 0x58], 0
lea r13, [r15 + 0x698]
jne 0x18021edf9
cmp byte [r15 + 0x8798], 0
jne 0x18021edf9
mov r8, qword [rsp + 0x70]
mov esi, 2
mov dword [rsp + 0x54], esi
test r8, r8
je 0x18021ee06
lea rdx, str.Ignore__lld_bytes_of_response_body_n
mov rcx, r15
call fcn.180203670
mov rax, qword [rsp + 0x70]
movsxd r11, ebp
sub r11, qword [rsp + 0x68]
add rax, r11
mov qword [rsp + 0x70], rax
test rax, rax
jg 0x18021ed2b
xor esi, esi
mov dword [rsp + 0x54], esi
mov ebp, esi
jmp 0x18021ed30
movzx eax, byte [rsp + 0x51]
test al, al
je 0x18021edf9
mov r8, qword [rsp + 0x68]
movsxd rax, ebp
lea rdx, str._d_bytes_of_chunk_left_n
mov rcx, r15
sub r8, rax
mov byte [r15 + 0x15d], 1
call fcn.180203670
cmp byte [rdi + 1], 0xa
jne 0x18021ee3c
inc rdi
inc ebp
mov r8, qword [rsp + 0x68]
movsxd rax, ebp
lea rdx, [rdi + 1]
lea r9, [rsp + 0x68]
mov rcx, r12
sub r8, rax
call fcn.1802235d0
mov rcx, r15
cmp eax, 0xffffffff
jne 0x18021ee79
lea rdx, str.chunk_reading_DONE_n
call fcn.180203670
xor esi, esi
mov dword [rsp + 0x54], esi
mov ebp, esi
jmp 0x18021ed30
mov r8, qword [rsp + 0x68]
lea rdx, str.Read__d_bytes_of_chunk__continue_n
call fcn.180203670
jmp 0x18021ed2b
lea rdx, str.Proxy_CONNECT_aborted_due_to_select_poll_error
mov rcx, r15
mov dword [rsp + 0x64], 1
call fcn.180203720
jmp 0x18021ed30
movzx ebx, byte [rsp + 0x50]
test bl, bl
je 0x18021eec2
cmp qword [r15 + 0x168], 0
jne 0x18021ef48
cmp qword [r15 + 0x168], 0
je 0x18021ef7e
mov rdi, qword [rsp + 0x78]
mov esi, dword [rsp + 0x60]
mov rbp, qword [rsp + 0xf0]
movzx r9d, word [rsp + 0xf8]
jmp 0x18021e6f0
mov rcx, rdi
call qword [0x1803d58f8]
mov rcx, r14
call qword [0x1803d58f8]
mov eax, 0x1b
jmp 0x18021eff5
mov eax, ebx
jmp 0x18021eff5
mov rcx, rdi
call qword [0x1803d58f8]
mov eax, 0x1b
jmp 0x18021eff5
mov eax, 0x2a
jmp 0x18021eff5
lea rdx, str.Proxy_CONNECT_aborted_due_to_timeout
mov rcx, r15
call fcn.180203720
mov eax, 0x38
jmp 0x18021eff5
movsxd rax, dword [rsp + 0xe8]
mov rdi, rax
mov rcx, qword [r12 + rax*8 + 0x120]
call qword [sym.imp.WS2_32.dll_closesocket]
mov qword [r12 + rdi*8 + 0x120], 0xffffffffffffffff
jmp 0x18021ef7e
lea rdx, str.Proxy_CONNECT_aborted_due_to_timeout
mov rcx, r15
call fcn.180203720
mov r8d, dword [r15 + 0xc0]
cmp r8d, 0xc8
je 0x18021efbb
lea rdx, str.Received_HTTP_code__d_from_proxy_after_CONNECT
mov rcx, r15
call fcn.180203720
test bl, bl
je 0x18021efb4
cmp qword [r15 + 0x168], 0
je 0x18021efb4
mov byte [r12 + 0x1bd], 1
mov eax, 0x38
jmp 0x18021eff5
mov rcx, qword [r12 + 0x1d8]
call fcn.180204200
mov qword [r12 + 0x1d8], 0
lea rdx, str.Proxy_replied_OK_to_CONNECT_request_n
mov rcx, r15
mov byte [r15 + 0x8794], 1
call fcn.180203670
mov byte [r15 + 0x15d], 0
xor eax, eax
add rsp, 0x98
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret