This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
****** START compiling Test2:DoTest(int,int,ubyte):int (MethodHash=8bafdb7c) | |
Generating code for Windows x64 | |
OPTIONS: compCodeOpt = BLENDED_CODE | |
OPTIONS: compDbgCode = false | |
OPTIONS: compDbgInfo = true | |
OPTIONS: compDbgEnC = false | |
OPTIONS: compProcedureSplitting = false | |
OPTIONS: compProcedureSplittingEH = false | |
IL to import: | |
IL_0000 02 ldarg.0 |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
****** START compiling Test1:TestMethodAll(struct,ubyte,ubyte,ubyte,ubyte,ubyte) (MethodHash=f166d70a) | |
Generating code for Windows x64 | |
OPTIONS: compCodeOpt = BLENDED_CODE | |
OPTIONS: compDbgCode = false | |
OPTIONS: compDbgInfo = true | |
OPTIONS: compDbgEnC = false | |
OPTIONS: compProcedureSplitting = false | |
OPTIONS: compProcedureSplittingEH = false | |
IL to import: | |
IL_0000 12 00 ldloca.s 0x0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal static unsafe class Intrinsics | |
{ | |
private static ReadOnlySpan<byte> TrailingZeroCountDeBruijnTable => new byte[] | |
{ | |
00, 01, 28, 02, 29, 14, 24, 03, | |
30, 22, 20, 15, 25, 17, 04, 08, | |
31, 27, 13, 23, 21, 19, 16, 07, | |
26, 12, 18, 06, 11, 05, 10, 09 | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static class Program | |
{ | |
/// <summary> | |
/// The main entry point for the application. | |
/// </summary> | |
[STAThread] | |
static void Main() | |
{ | |
DoTest(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace ConsoleApp1 | |
{ | |
internal static class Program | |
{ | |
private static unsafe void Main(string[] args) | |
{ | |
var tp = new ThreadPrivateAccessor {Thread = Thread.CurrentThread}; | |
var currentThreadHandle = (void**)tp.ThreadExposer._DONT_USE_InternalThread; | |
var someProcFromCoreClr = *currentThreadHandle; | |
var coreClrImageBase = (byte*)someProcFromCoreClr - 0x3ec4c0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Runtime.InteropServices; | |
using System.Security; | |
using System.Threading; | |
namespace ConsoleApp1 | |
{ | |
internal static class Program | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static class Program | |
{ | |
[DllImport("kernel32.dll", SetLastError = true)] | |
public static extern IntPtr LoadLibrary(string dllToLoad); | |
[DllImport("kernel32.dll")] | |
public static extern IntPtr GetProcAddress(IntPtr hModule, string procedureName); | |
static void Main() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public unsafe struct PixelInfo | |
{ | |
public const int Shift = 8; | |
public const int Scale = 1 << Shift; | |
public const int Mask = Scale - 1; | |
public const int Msb = 1 << (Shift - 1); | |
public struct Cover | |
{ | |
public const int Shift = 8; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Reflection; | |
using System.Runtime.CompilerServices; | |
using System.Text; | |
namespace ConsoleApp1 | |
{ | |
unsafe class Program | |
{ | |
static void Main(string[] args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[StructLayout(LayoutKind.Sequential, Size = 256)] | |
public unsafe struct Bitset | |
{ | |
public void Set(int bitIndex) => ((int*) Unsafe.AsPointer(ref Unsafe.AsRef(this)))[(bitIndex & ~7) >> 5] |= 1 << (bitIndex & 7); | |
public void Unset(int bitIndex) => ((int*)Unsafe.AsPointer(ref Unsafe.AsRef(this)))[(bitIndex & ~7) >> 5] ^= 1 << (bitIndex & 7); | |
public void SetAll() => Unsafe.InitBlock(Unsafe.AsPointer(ref Unsafe.AsRef(this)), 0xff, (uint) Unsafe.SizeOf<Bitset>()); | |
public void UnsetAll() => Unsafe.InitBlock(Unsafe.AsPointer(ref Unsafe.AsRef(this)), 0x00, (uint) Unsafe.SizeOf<Bitset>()); | |
} |
OlderNewer