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
// TODO: work on filters, they are really needed, did optimize the memory storage quite a bit tho | |
class ImGuiSpdLogAdaptor | |
: public spdlog::sinks::base_sink<std::mutex> { | |
using sink_t = spdlog::sinks::base_sink<std::mutex>; | |
class SinkLineContent { | |
public: | |
spdlog::level::level_enum LogLevel; // If n_levels, the message pushed counts to the previous pushed line | |
int32_t BeginIndex; // Base offset into the text buffer |
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
// This thing is based on a stupid idea that came after a bet that i had with @LapysDev | |
#define _CRT_SECURE_NO_WARNINGS | |
#include <windows.h> | |
#include <cstdint> | |
constexpr uint32_t RoundUpToMulOfPow2( | |
_In_ uint32_t Number, | |
_In_ int32_t Multiplier | |
) { |
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 <Windows.h> | |
#include <winternl.h> | |
#include <cstdio> | |
#pragma comment(lib, "ntdllp.lib") | |
DWORD __stdcall TestThread( | |
_In_ void* reserved | |
) { | |
for (UINT64 i = 0; i < (UINT64)-1; i++) { | |
printf("TestThread\n"); |
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 rc4crypt( // Crypts a buffer with RC4 cipher (RC4 modification) | |
unsigned char* Input, // The input data to be crypted | |
size_t InputLength, // The length of the input in bytes | |
unsigned char* Key, // The key to be used in the encryption | |
unsigned short KeyLength, // The length of the key to use in bytes | |
unsigned char* Output // The output buffer to be filled (can be inplace) | |
) { | |
// Substitution-Box and State | |
unsigned char SBox[256]; | |
unsigned char i = 0, j = 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 <Windows.h> | |
class Benchmark { | |
public: | |
enum class Resolution { | |
SEC = 1, | |
MILLI = 1000, | |
MICRO = 1000000, | |
NANO = 1000000000 | |
}; |
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
class HexConv { | |
public: | |
HexConv() { | |
// Setup HexTable | |
for (char i = 0; i < 10; i++) | |
m_HexTable[i] = i + '0'; | |
for (char j = 0; j < 6; j++) { | |
m_HexTable[j + 10] = j + 'a'; | |
m_HexTable[j + ('a' - '0')] = j + ('0' + 10); |