Skip to content

Commit f3cd810

Browse files
authored
Added new anti-emulation trick
Added a method that detects emulation by comparing the values "InterruptTime" and "SystemTime" after 1 second of getting their original values. since the OS updates them regularly, if they are not updated after this 1 second then the values are static which means that we are in an emulator.
1 parent c5cb631 commit f3cd810

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

AntiCrack-DotNet/AntiVirtualization.cs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using Microsoft.Win32;
99
using static AntiCrack_DotNet.Utils;
1010
using static AntiCrack_DotNet.Delegates;
11+
using System.Linq;
1112

1213
namespace AntiCrack_DotNet
1314
{
@@ -525,6 +526,35 @@ public static bool FlagsManipulationInstructions()
525526
return false;
526527
}
527528
}
529+
530+
/// <summary>
531+
/// Checks for the KUSER_SHARED_DATA "InterruptTime" and "SystemTime" values which many emulators don't update regularly.
532+
/// </summary>
533+
/// <returns>returns true if the values are static which indicates an emulator, otherwise false.</returns>
534+
public static bool IsKUserSharedDataTimeStatic()
535+
{
536+
byte[] Old = new byte[8];
537+
byte[] Current = new byte[8];
538+
IntPtr InterruptTime = new IntPtr(0x7FFE0008);
539+
IntPtr SystemTime = new IntPtr(0x7FFE0014);
540+
Utils.CopyMem(Old, InterruptTime, false);
541+
Thread.Sleep(1000);
542+
Utils.CopyMem(Current, InterruptTime, false);
543+
if(Old.SequenceEqual(Current))
544+
{
545+
return true;
546+
}
547+
548+
Utils.CopyMem(Old, SystemTime, false);
549+
Thread.Sleep(1000);
550+
Utils.CopyMem(Current, SystemTime, false);
551+
552+
if (Old.SequenceEqual(Current))
553+
{
554+
return true;
555+
}
556+
return false;
557+
}
528558
}
529559
}
530560
}

0 commit comments

Comments
 (0)