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

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x18]
sub rsp, 0x118
mov rax, qword [0x140232230]
xor rax, rsp
mov qword [rbp], rax
mov r15, qword [rcx]
xor r13d, r13d
mov r12d, 0x36ee80
mov dword [rbp - 0x40], r13d
mov eax, dword [r15 + 0x270]
mov ebx, r13d
test eax, eax
mov word [rbp - 0x7c], r9w
mov rsi, r8
cmovne r12d, eax
movsxd rax, edx
mov qword [rbp - 0x38], r8
add rax, 0x31
mov dword [rbp - 0x50], edx
mov r14, rcx
mov rdi, qword [rcx + rax*8]
lea rax, [rcx + rax*8]
mov qword [rsp + 0x60], rcx
mov qword [rsp + 0x78], r15
mov dword [rbp - 0x80], r12d
mov qword [rbp - 0x28], rax
mov qword [rbp - 0x70], rdi
mov qword [rbp - 0x60], r13
mov dword [rsp + 0x68], r13d
mov dword [rbp - 0x68], r13d
mov dword [rsp + 0x50], ebx
mov dword [rcx + 0x28c], r13d
nop word [rax + rax]
cmp dword [r14 + 0x268], 0
jne 0x140140625
movzx r13d, r9w
lea rdx, str.Establish_HTTP_proxy_tunnel_to__s:_hu_n
or al, byte [rax]
mov r8, rsi
mov r9d, r13d
mov rcx, r15
call fcn.140125a80
mov rcx, qword [r15 + 0x118]
test rcx, rcx
je 0x140140401
call fcn.1401673d0
xor eax, eax
mov qword [r15 + 0x118], rax
mov edx, 0x18
lea ecx, [rdx - 0x17]
call qword [fcn.14016f76c]
mov rdi, rax
test rax, rax
je 0x140140e98
lea rcx, str._s:_hu
mov r8d, r13d
mov rdx, rsi
call fcn.1401321e0
mov r14, rax
test rax, rax
je 0x140140e90
mov rcx, qword [rsp + 0x60]
mov esi, 1
lea rdx, str.CONNECT
mov r9d, esi
mov r8, rax
call fcn.14012b9e0
mov ebx, eax
test eax, eax
jne 0x1401405ef
mov rbx, qword [rsp + 0x78]
lea rax, [0x1401b68a0]
lea r15, [0x1401e6a18]
mov rsi, rax
mov r12, rax
mov rax, qword [rsp + 0x60]
cmp dword [rax + 0x168], 1
lea rax, [0x1401b80f0]
lea rdx, str.Host:
mov rcx, rbx
cmove r15, rax
call fcn.14012b1e0
test rax, rax
jne 0x1401404be
lea rcx, str.Host:__s_r_n
mov rdx, r14
call fcn.1401321e0
mov rsi, rax
test rax, rax
je 0x140140e6f
lea rdx, str.Proxy_Connection:
mov rcx, rbx
call fcn.14012b1e0
mov rcx, qword [rsp + 0x78]
lea rbx, str.Proxy_Connection:_Keep_Alive_r_n
test rax, rax
lea rax, [0x1401b68a0]
lea rdx, str.User_Agent:
cmovne rbx, rax
call fcn.14012b1e0
test rax, rax
jne 0x140140515
mov rax, qword [rsp + 0x78]
cmp qword [rax + 0x540], 0
mov rax, qword [rsp + 0x60]
je 0x14014051a
mov r12, qword [rax + 0x2d8]
jmp 0x14014051a
mov rax, qword [rsp + 0x60]
mov rax, qword [rax + 0x2d0]
mov r8, qword [rbp - 0x38]
mov qword [rsp + 0x40], rbx
mov qword [rsp + 0x38], r12
test rax, rax
lea rcx, [0x1401b68a0]
cmovne rcx, rax
lea rdx, str.CONNECT__s:_hu_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], r15
call fcn.14012c0a0
mov ebx, eax
test rsi, rsi
je 0x140140572
cmp byte [rsi], 0
je 0x140140572
mov rcx, rsi
call fcn.1401673d0
test ebx, ebx
jne 0x1401405c6
mov rsi, qword [rsp + 0x60]
mov rdx, rdi
mov rcx, rsi
call fcn.14012c640
mov ebx, eax
test eax, eax
jne 0x1401405c6
lea rdx, [0x1401e5c74]
mov rcx, rdi
call fcn.14012c0a0
mov r15, qword [rsp + 0x78]
mov ebx, eax
test eax, eax
jne 0x1401405cb
mov eax, dword [rbp - 0x50]
lea r8, [r15 + 0x8980]
xor r9d, r9d
mov rdx, rsi
mov rcx, rdi
mov dword [rsp + 0x20], eax
call fcn.14012be80
mov ebx, eax
jmp 0x1401405cb
mov r15, qword [rsp + 0x78]
xor r13d, r13d
mov edi, r13d
test ebx, ebx
je 0x1401405e4
lea rdx, str.Failed_sending_CONNECT_to_proxy
mov rcx, r15
call fcn.140125b60
mov r12d, dword [rbp - 0x80]
mov esi, 1
jmp 0x1401405f2
xor r13d, r13d
mov rcx, r14
call fcn.1401673d0
test rdi, rdi
je 0x140140607
mov rcx, rdi
call fcn.1401673d0
test ebx, ebx
jne 0x140140e89
mov r14, qword [rsp + 0x60]
mov ebx, dword [rsp + 0x50]
mov rdi, qword [rbp - 0x70]
mov dword [r14 + 0x268], esi
jmp 0x14014062a
mov esi, 1
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov rcx, qword [r14 + 0x174]
mov r8d, eax
mov eax, 0x10624dd3
mul r8d
mov r9d, edx
shr r9d, 6
mov eax, r9d
imul eax, eax, 0x3e8
sub r8d, eax
mov rax, rcx
sub ecx, r9d
shr rax, 0x20
imul ecx, ecx, 0x3e8
imul r8d, r8d, 0x3e8
sub r8d, eax
mov eax, 0x10624dd3
imul r8d
sar edx, 6
mov eax, edx
shr eax, 0x1f
add edx, eax
sub ecx, edx
add ecx, r12d
test ecx, ecx
jle 0x140140f45
cmp dword [r15 + 0x728], 2
jne 0x140140706
cmp rdi, 0xffffffffffffffff
je 0x140140f41
mov qword [rbp - 0x20], rdi
mov dword [rbp - 0x18], 0x300
nop dword [rax]
lea rcx, [rbp - 0x20]
xor r8d, r8d
mov edx, esi
call qword [sym.imp.WS2_32.dll_WSAPoll]
cmp eax, 0xffffffff
jne 0x1401406d7
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
test eax, eax
je 0x1401406b0
cmp eax, 0x2714
je 0x1401406b0
jmp 0x140140706
test eax, eax
js 0x140140706
je 0x140140f41
mov ecx, 0x303
mov edx, 0x204
test word [rbp - 0x16], cx
mov ecx, r13d
cmovne ecx, esi
test word [rbp - 0x16], dx
je 0x1401406fe
or ecx, 4
test ecx, ecx
je 0x140140f41
lea rax, [r15 + 0x758]
mov dword [r14 + 0x268], r13d
mov qword [rsp + 0x58], r13
mov qword [rbp - 0x78], rax
mov rsi, rax
xor eax, eax
mov qword [rbp - 0x48], rax
mov eax, 1
mov dword [rsp + 0x54], eax
jmp 0x140140735
mov ebx, dword [rsp + 0x50]
test eax, eax
je 0x140140dfb
test ebx, ebx
jne 0x140140f54
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov rcx, qword [r14 + 0x174]
mov r8d, eax
mov eax, 0x10624dd3
mul r8d
mov r9d, edx
shr r9d, 6
mov eax, r9d
imul eax, eax, 0x3e8
sub r8d, eax
mov rax, rcx
sub ecx, r9d
shr rax, 0x20
imul ecx, ecx, 0x3e8
imul r8d, r8d, 0x3e8
sub r8d, eax
mov eax, 0x10624dd3
imul r8d
sar edx, 6
mov eax, edx
shr eax, 0x1f
add edx, eax
sub ecx, edx
add ecx, r12d
test ecx, ecx
jle 0x140140f45
mov rax, qword [rbp - 0x70]
mov edi, 0x3e8
cmp ecx, edi
cmovl edi, ecx
xor ecx, ecx
mov r14d, ecx
mov r12d, ecx
mov ebx, ecx
cmp rax, 0xffffffffffffffff
jne 0x1401407f4
test edi, edi
je 0x14014090d
jns 0x1401407e4
mov ecx, 0x2726
call qword [sym.imp.WS2_32.dll_WSASetLastError]
or eax, 0xffffffff
jmp 0x14014090f
mov ecx, edi
call qword [sym.imp.KERNEL32.dll_Sleep]
mov eax, r12d
jmp 0x14014090f
test edi, edi
jle 0x140140837
mov ebx, edi
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, eax
mov eax, 0x10624dd3
mul ecx
shr edx, 6
mov dword [rbp - 0x30], edx
imul edx, edx, 0x3e8
sub ecx, edx
imul ecx, ecx, 0x3e8
mov dword [rbp - 0x2c], ecx
mov rax, qword [rbp - 0x30]
xor ecx, ecx
mov qword [rsp + 0x70], rax
mov r12d, dword [rsp + 0x74]
mov r14d, eax
mov rax, qword [rbp - 0x70]
mov qword [rbp - 0x20], rax
mov dword [rbp - 0x18], 0x300
test edi, edi
jns 0x14014084b
or ebx, 0xffffffff
jmp 0x14014084e
cmove ebx, ecx
lea rcx, [rbp - 0x20]
mov r8d, ebx
mov edx, 1
call qword [sym.imp.WS2_32.dll_WSAPoll]
cmp eax, 0xffffffff
jne 0x1401408d7
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
test eax, eax
je 0x14014087a
cmp eax, 0x2714
jne 0x140140da8
mov ecx, 0
test edi, edi
jle 0x140140844
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov ebx, r14d
mov ecx, eax
mov eax, 0x10624dd3
mul ecx
shr edx, 6
sub ebx, edx
mov eax, edx
imul eax, eax, 0x3e8
imul ebx, ebx, 0x3e8
sub ecx, eax
mov eax, 0x10624dd3
imul ecx, ecx, 0x3e8
sub ecx, r12d
imul ecx
sar edx, 6
mov eax, edx
shr eax, 0x1f
add edx, eax
sub ebx, edx
add ebx, edi
test ebx, ebx
jle 0x140140da8
xor ecx, ecx
jmp 0x140140842
test eax, eax
js 0x140140da8
je 0x140140dd1
mov ecx, 0x303
mov edx, 1
mov r12d, 0
test word [rbp - 0x16], cx
mov ecx, r12d
cmovne ecx, edx
mov edx, 0x204
test word [rbp - 0x16], dx
je 0x14014090d
or ecx, 4
mov eax, ecx
cmp eax, 0xffffffff
je 0x140140da8
mov rdi, qword [rsp + 0x58]
mov r14, qword [rsp + 0x60]
test eax, eax
je 0x140140a34
mov r8, qword [rbp - 0x78]
mov rdx, qword [rbp - 0x70]
lea rax, [rbp - 0x58]
mov r9d, 0x4000
mov rcx, r14
mov qword [rsp + 0x20], rax
sub r9, rdi
call fcn.140126120
cmp eax, 0x51
je 0x140140de0
test eax, eax
je 0x140140963
mov dword [rsp + 0x54], r12d
jmp 0x140140a34
mov rbx, qword [rbp - 0x58]
mov qword [rsp + 0x70], rbx
test rbx, rbx
jg 0x1401409b7
cmp dword [r15 + 0x188], 0
mov dword [rsp + 0x54], r12d
je 0x14014099b
cmp dword [r15 + 0x8858], 0
je 0x14014099b
mov eax, 1
mov dword [r14 + 0x28c], eax
jmp 0x140140a34
lea rdx, str.Proxy_CONNECT_aborted
mov rcx, r15
mov dword [rsp + 0x50], 1
call fcn.140125b60
jmp 0x140140a34
add rdi, rbx
cmp dword [rsp + 0x54], 1
mov qword [rsp + 0x58], rdi
jle 0x140140a65
lea rax, [r15 + 0x758]
mov qword [rsp + 0x58], r12
mov rdi, rax
mov qword [rbp - 0x78], rax
mov rax, qword [rbp - 0x60]
test rax, rax
je 0x140140a00
sub rax, rbx
mov ebx, dword [rsp + 0x50]
mov rdi, r12
mov qword [rbp - 0x60], rax
test rax, rax
jg 0x140140a38
mov dword [rsp + 0x54], r12d
jmp 0x140140a38
lea r9, [rsp + 0x70]
mov r8, rbx
mov rdx, rdi
mov rcx, r14
mov qword [rsp + 0x70], r12
call fcn.14013f6b0
mov rcx, r15
cmp eax, 0xffffffff
jne 0x140140a52
lea rdx, str.chunk_reading_DONE_n
call fcn.140125a80
mov dword [rsp + 0x54], r12d
mov rdi, r12
mov ebx, dword [rsp + 0x50]
mov rcx, r14
call fcn.14012f3a0
test eax, eax
je 0x140140de4
mov eax, 0x2a
jmp 0x140140f59
mov r8, qword [rsp + 0x70]
lea rdx, str.Read__zd_bytes_of_chunk__continue_n
call fcn.140125a80
jmp 0x140140a31
test rbx, rbx
jle 0x140140a34
mov rdi, qword [rbp - 0x48]
nop
mov rax, qword [rbp - 0x78]
inc rdi
inc r13d
cmp byte [rax], 0xa
mov qword [rbp - 0x48], rdi
jne 0x140140c68
cmp dword [r15 + 0x41c], 0
je 0x140140aa9
movsxd r9, r13d
mov r8, rsi
mov edx, 1
mov rcx, r15
mov qword [rsp + 0x20], r14
call fcn.140126310
cmp dword [r15 + 0x400], 0
mov edx, 2
mov eax, 3
movsxd r9, r13d
mov r8, rsi
mov rcx, r14
cmovne edx, eax
call fcn.140125f80
test eax, eax
jne 0x140140f59
movzx eax, byte [rsi]
cmp al, 0xd
je 0x140140c88
cmp al, 0xa
je 0x140140c88
movzx r14d, byte [rdi + rsi]
lea rcx, str.WWW_Authenticate:
mov r8d, select
mov rdx, rsi
mov byte [rdi + rsi], 0
call fcn.14013cb70
test eax, eax
je 0x140140b18
mov edx, dword [r15 + 0xc0]
cmp edx, 0x191
je 0x140140b40
lea rcx, str.Proxy_authenticate:
mov r8d, reloc.WS2_32.dll_send
mov rdx, rsi
call fcn.14013cb70
test eax, eax
je 0x140140b5a
mov edx, dword [r15 + 0xc0]
cmp edx, 0x197
jne 0x140140b5a
mov rcx, qword [rsp + 0x60]
mov r8, rsi
call fcn.14012bbf0
test eax, eax
jne 0x140140f59
jmp 0x140140c4c
lea rcx, str.Content_Length:
mov r8d, reloc.WS2_32.dll_ntohs
mov rdx, rsi
call fcn.14013cb70
test eax, eax
je 0x140140b8b
xor edx, edx
lea rcx, [rsi + 0xf]
lea r8d, [rdx + 0xa]
call fcn.1401704f0
mov qword [rbp - 0x60], rax
jmp 0x140140c4c
lea r8, str.close
lea rdx, str.Connection:
mov rcx, rsi
call fcn.14012c240
test eax, eax
je 0x140140bb2
mov dword [rsp + 0x68], 1
jmp 0x140140c4c
lea r8, str.chunked
lea rdx, str.Transfer_Encoding:
mov rcx, rsi
call fcn.14012c240
test eax, eax
je 0x140140bf6
lea rdx, str.CONNECT_responded_chunked_n
mov rcx, r15
call fcn.140125a80
mov rax, qword [rsp + 0x60]
mov edx, 1
xor ecx, ecx
mov dword [rbp - 0x68], edx
mov dword [rax + 0x20], edx
mov dword [rax + 0x1c], ecx
mov qword [rax + 0x30], rcx
jmp 0x140140c4c
lea r8, str.close
lea rdx, str.Proxy_Connection:
mov rcx, rsi
call fcn.14012c240
test eax, eax
je 0x140140c1a
mov dword [rsp + 0x68], 1
jmp 0x140140c4c
lea r9, [r15 + 0xc0]
lea r8, [rbp - 0x40]
lea rdx, str.HTTP_1._d__d
mov rcx, rsi
call fcn.14016743c
mov rbx, qword [rsp + 0x70]
cmp eax, 2
jne 0x140140c4c
mov eax, dword [r15 + 0xc0]
mov dword [r15 + 0x896c], eax
xor eax, eax
mov byte [rdi + rsi], r14b
mov r14, qword [rsp + 0x60]
mov r13d, eax
mov edi, eax
mov qword [rbp - 0x48], rax
mov rax, qword [rbp - 0x78]
lea rsi, [rax + 1]
inc rax
inc r12d
mov qword [rbp - 0x78], rax
movsxd rax, r12d
cmp rax, rbx
jl 0x140140a70
mov rdi, qword [rsp + 0x58]
jmp 0x140140a34
xor ecx, ecx
cmp dword [r15 + 0xc0], 0x197
lea rax, [r15 + 0x758]
mov edi, ecx
mov qword [rsp + 0x58], rcx
mov qword [rbp - 0x78], rax
jne 0x140140d9f
cmp dword [r15 + 0x8868], ecx
jne 0x140140d9f
mov rdi, qword [rbp - 0x60]
mov dword [rsp + 0x54], 2
test rdi, rdi
je 0x140140d04
lea rdx, str.Ignore__lld_bytes_of_response_body_n
mov r8, rdi
mov rcx, r15
call fcn.140125a80
movsxd rax, r12d
sub rax, rbx
mov ebx, dword [rsp + 0x50]
add rdi, rax
mov qword [rbp - 0x60], rdi
test rdi, rdi
jg 0x140140dc7
xor eax, eax
mov dword [rsp + 0x54], eax
mov edi, eax
jmp 0x140140a38
mov eax, dword [rbp - 0x68]
test eax, eax
je 0x140140d93
mov eax, 1
mov r8, rbx
lea rdx, str._zd_bytes_of_chunk_left_n
mov dword [r15 + 0x108], eax
movsxd rax, r12d
mov rcx, r15
sub r8, rax
call fcn.140125a80
cmp byte [rsi + 1], 0xa
jne 0x140140d3f
inc rsi
inc r12d
movsxd rax, r12d
lea rdx, [rsi + 1]
lea r9, [rbp - 0x58]
sub rbx, rax
mov rcx, r14
mov r8, rbx
call fcn.14013f6b0
mov rcx, r15
cmp eax, 0xffffffff
jne 0x140140d79
lea rdx, str.chunk_reading_DONE_n
call fcn.140125a80
xor eax, eax
mov dword [rsp + 0x54], eax
mov edi, eax
jmp 0x140140a34
mov r8, qword [rbp - 0x58]
lea rdx, str.Read__zd_bytes_of_chunk__continue_n
call fcn.140125a80
mov rdi, qword [rsp + 0x58]
jmp 0x140140a34
mov dword [rsp + 0x54], ecx
mov rdi, rcx
jmp 0x140140a34
mov dword [rsp + 0x54], ecx
jmp 0x140140a34
mov eax, 1
lea rdx, str.Proxy_CONNECT_aborted_due_to_select_poll_error
mov rcx, r15
mov ebx, eax
mov dword [rsp + 0x50], eax
call fcn.140125b60
mov r14, qword [rsp + 0x60]
mov rdi, qword [rsp + 0x58]
jmp 0x140140a38
mov r14, qword [rsp + 0x60]
mov rdi, qword [rsp + 0x58]
jmp 0x140140a34
mov ebx, dword [rsp + 0x50]
mov eax, dword [rsp + 0x54]
mov r12d, dword [rbp - 0x80]
cmp rdi, 0x4000
jb 0x140140731
jmp 0x140140dff
mov ebx, dword [rsp + 0x50]
test ebx, ebx
jne 0x140140f54
cmp dword [r15 + 0x896c], 0xc8
je 0x140140e3a
mov rcx, r14
call fcn.14012b6c0
test eax, eax
jne 0x140140f59
cmp dword [r14 + 0x230], eax
je 0x140140e3a
mov eax, 1
mov ebx, eax
mov dword [rsp + 0x68], eax
jmp 0x140140e42
mov ebx, dword [rsp + 0x68]
test ebx, ebx
je 0x140140e4c
cmp qword [r15 + 0x118], 0
jne 0x140140ea2
cmp qword [r15 + 0x118], 0
je 0x140140eca
mov ebx, dword [rsp + 0x50]
mov rdi, qword [rbp - 0x70]
mov rsi, qword [rbp - 0x38]
movzx r9d, word [rbp - 0x7c]
xor r13d, r13d
jmp 0x1401403c0
mov rcx, rdi
call fcn.1401673d0
mov rcx, r14
call fcn.1401673d0
mov eax, 0x1b
jmp 0x140140f59
mov eax, ebx
jmp 0x140140f59
mov rcx, rdi
call fcn.1401673d0
mov eax, 0x1b
jmp 0x140140f59
mov rdi, qword [rbp - 0x28]
mov rax, qword [r14 + 0x38]
mov rcx, qword [rdi]
test rax, rax
je 0x140140ebd
mov rdx, rcx
mov rcx, qword [r14 + 0x40]
call rax
jmp 0x140140ec3
call qword [sym.imp.WS2_32.dll_closesocket]
mov qword [rdi], 0xffffffffffffffff
mov r8d, dword [r15 + 0xc0]
cmp r8d, 0xc8
je 0x140140f05
lea rdx, str.Received_HTTP_code__d_from_proxy_after_CONNECT
mov rcx, r15
call fcn.140125b60
test ebx, ebx
je 0x140140f54
cmp qword [r15 + 0x118], 0
je 0x140140f54
mov eax, 1
mov dword [r14 + 0x28c], eax
jmp 0x140140f54
mov rcx, qword [r14 + 0x2d0]
test rcx, rcx
je 0x140140f16
call fcn.1401673d0
xor ebx, ebx
mov eax, 1
lea rdx, str.Proxy_replied_OK_to_CONNECT_request_n
mov qword [r14 + 0x2d0], rbx
mov rcx, r15
mov dword [r15 + 0x885c], eax
call fcn.140125a80
mov dword [r15 + 0x108], ebx
xor eax, eax
jmp 0x140140f59
lea rdx, str.Proxy_CONNECT_aborted_due_to_timeout
mov rcx, r15
call fcn.140125b60
mov eax, gethostname
mov rcx, qword [rbp]
xor rcx, rsp
call fcn.140166980
add rsp, 0x118
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret