This file contains hidden or 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
// This is free and unencumbered software released into the public domain. | |
// Anyone is free to copy, modify, publish, use, compile, sell, or | |
// distribute this software, either in source code form or as a compiled | |
// binary, for any purpose, commercial or non-commercial, and by any | |
// means. | |
// In jurisdictions that recognize copyright laws, the author or authors | |
// of this software dedicate any and all copyright interest in the | |
// software to the public domain. We make this dedication for the benefit |
This file contains hidden or 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
// CLR Hosting, by [email protected] | |
// | |
// it's a new edition rewrite for .NET(4+) COM interface | |
// original from github.com/etormadiv/HostingCLR | |
// & blog.xpnsec.com/hiding-your-dotnet-etw | |
// | |
// this PoC supports the following .NET entry: | |
// >>>> static void Main(string[] args); | |
// | |
#include <stdio.h> |
This file contains hidden or 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
<!-- should be in templates/ --> | |
<html> | |
<head> | |
<style> | |
div.mermaid { | |
width:25%; | |
} | |
</style> | |
</head> | |
<body> |
This file contains hidden or 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
#include <stdio.h> | |
#include <Windows.h> | |
#include <MSCorEE.h> | |
#include <MetaHost.h> | |
#include <evntprov.h> | |
int main() | |
{ | |
ICLRMetaHost* metaHost = NULL; | |
IEnumUnknown* runtime = NULL; |
This file contains hidden or 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.IO; | |
using UnityEditor; | |
using UnityEngine; | |
[InitializeOnLoad] | |
public static class Screenshot | |
{ | |
static Screenshot() | |
{ | |
EditorApplication.delayCall += () => { |
This file contains hidden or 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 UnityEngine; | |
public static class TransformExtensions { | |
private static void GetTRS(this Matrix4x4 matrix, out Vector3 translation, out Quaternion rotation, out Vector3 scale) | |
{ | |
float det = matrix.GetDeterminant(); | |
// Scale | |
scale.x = matrix.MultiplyVector(new Vector3(1, 0, 0)).magnitude; |
This file contains hidden or 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; | |
using System.Collections.Concurrent; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using UnityEditor; | |
using UnityEngine; | |
using UnityEngine.Experimental.LowLevel; | |
#pragma warning disable CS1998 |
This file contains hidden or 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.Concurrent; | |
using System.Linq; | |
using UnityEngine; | |
using UnityEngine.Events; | |
[ExecuteInEditMode] | |
public sealed class MonoContext : MonoBehaviour { | |
public static UnityEvent OnUpdate; |
This file contains hidden or 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.Diagnostics; | |
public static class Profiling { | |
private static Dictionary<string, Stopwatch> stopwatches = new Dictionary<string, Stopwatch>(); | |
public static void Start(string key) { | |
if (!stopwatches.ContainsKey(key)) |
This file contains hidden or 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 UnityEngine; | |
public class ProjectReferences<T> : ScriptableObject where T : ScriptableObject | |
{ | |
private static T instance; | |
public static T Instance { | |
get { | |
if (instance == null) { | |
instance = Resources.Load<T>(typeof(T).Name); | |
if (instance == null) { |
NewerOlder