File tree 2 files changed +12
-0
lines changed
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ internal static class Opcode
11
11
12
12
public static bool Open ( )
13
13
{
14
+ if ( SocketOptions . DoNotUseRDTSC )
15
+ return false ;
14
16
#if NETSTANDARD1_1_OR_GREATER || NET471_OR_GREATER
15
17
if ( RuntimeInformation . ProcessArchitecture != Architecture . X86 &&
16
18
RuntimeInformation . ProcessArchitecture != Architecture . X64 )
Original file line number Diff line number Diff line change @@ -12,6 +12,16 @@ namespace NetMQ
12
12
/// </summary>
13
13
public class SocketOptions
14
14
{
15
+ /// <summary>
16
+ /// If set, the time stamp counter is not read directly through opcode injection,
17
+ /// rather <see cref="System.Diagnostics.Stopwatch.GetTimestamp"/> is used.
18
+ /// When false, the time stamp counter is read by allocating a few bytes on the heap with
19
+ /// read/write/execute privilege. OpCode is copied to this allocated memory and invoked to read
20
+ /// the time stamp counter, (which is a register available on most modern CPUs). While this is
21
+ /// an accurate way to read the time stamp counter, because it injects code onto the heap, this
22
+ /// can be detected as a malware technique by some anti-virus defenders.
23
+ /// </summary>
24
+ public static bool DoNotUseRDTSC ;
15
25
/// <summary>
16
26
/// The NetMQSocket that this SocketOptions is referencing.
17
27
/// </summary>
You can’t perform that action at this time.
0 commit comments