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
#include <iostream> | |
#include <vector> | |
#include <cinttypes> | |
#pragma pack(1) | |
class ParentRegister | |
{ | |
public: | |
struct InitializationTrick | |
{ |
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
#pragma once | |
namespace Framework | |
{ | |
#pragma pack(push, 1) | |
// TODO: Float16, not really.... needed | |
// https://github.com/facebookincubator/gloo/blob/master/gloo/types.h |
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
#pragma once | |
#include "platform.h" | |
#pragma pack(push, 1) | |
// TODO: Float16, not really.... needed | |
// https://github.com/facebookincubator/gloo/blob/master/gloo/types.h | |
enum class IEEEClass |
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
// | |
void print_bytes(void *p, size_t size) | |
{ | |
unsigned char *c = (unsigned char *)p; | |
printf("B [0x%X] { ", size); | |
for (size_t i = 0; i < size; i++) | |
{ | |
if (i == (size - 1)) | |
{ |
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
#pragma once | |
template<typename T> | |
class SafeBuffer | |
{ | |
public: | |
SafeBuffer(size_t size) : m_size(size) { | |
m_buffer = new T[size]; | |
if (!m_buffer) | |
throw; |
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
#include <iostream> | |
#include <string> | |
#include <math.h> | |
unsigned char chrtob(char c) { | |
if (c >= 'A' && c <= 'F') return c - 55; | |
else if (c >= 'a' && c <= 'f') return c - 87; | |
else if (c >= '0' && c <= '9') return c - 0x30; | |
return 0; | |
} |
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
#include "stdafx.h" | |
#include <conio.h> | |
#include <TlHelp32.h> | |
typedef NTSTATUS(WINAPI *NtQueryInformationThread_t)(HANDLE ThreadHandle, THREADINFOCLASS ThreadInformationClass, PVOID ThreadInformation, ULONG ThreadInformationLength, PULONG ReturnLength); | |
NtQueryInformationThread_t pNtQueryInformationThread = NULL; | |
BOOL GetMainThreadId(DWORD *pdwThreadId) | |
{ |
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
#pragma once | |
namespace ConstRandom | |
{ | |
// It's T time | |
template<typename T> constexpr T time() { | |
return (T) | |
( | |
(__TIME__[7] - '0') * 0x0001 + (__TIME__[6] - '0') * 0x000A + | |
(__TIME__[4] - '0') * 0x003C + (__TIME__[3] - '0') * 0x0258 + |