Skip to content

Instantly share code, notes, and snippets.

#ifndef _HSR_H_
#define _HSR_H_
#pragma once
#define HSRA(x) __hsr_a("\0" x)
#define HSRW(x) __hsr_w(L"\0" x)
#ifdef __cplusplus
extern "C" {
#endif
#include "bin2c.hpp"
#include <sstream>
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <math.h>
void bin2c(std::string& out, const std::string& name, uint8_t* buffer, size_t size, size_t align) {
if (align % 2 != 0)
align = 1;
#pragma once
#ifndef XS_H
#define XS_H
#include <stdint.h>
#include <intrin.h>
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#pragma once
typedef union _variant {
bool b;
const bool cb;
bool* pb;
const bool* pcb;
char c;
char* pc;
@Autoplay1999
Autoplay1999 / PRNG
Created April 16, 2024 11:31
Pseudo Random Number Generator
- splitmix64
- xoshiro256+
- xoshiro256++
- xoshiro256**
@Autoplay1999
Autoplay1999 / hwbp.cpp
Last active September 5, 2023 16:38
Hardware Breakpoint
#include "hwbp.h"
#include <deque>
#include <set>
#include <assert.h>
#include <TlHelp32.h>
#define DEBUG_GET_LOCAL_ENABLE(i,dr7) ((dr7 >> (i * 2)) & 0x1)
#define DEBUG_GET_CONDITION(i,dr7) ((dr7 >> (16 + i * 4)) & 0x3)
#define DEBUG_GET_LENGTH(i,dr7) ((dr7 >> (18 + i * 4)) & 0x3)
local function isNaN(value)
return type(value) == "number" and value ~= value
end
local function isInf(value)
return type(value) == "number" and (value == math.huge or value == -math.huge)
end
local function escapeUTF8(str)
local function charToHex(c)
#include <Windows.h>
#include <iostream>
int main()
{
MEMORY_BASIC_INFORMATION memBasicInfo;
DWORD64 curAddress = 0;
HANDLE hConsole = GetStdHandle( STD_OUTPUT_HANDLE );
RtlSecureZeroMemory( &memBasicInfo, sizeof( MEMORY_BASIC_INFORMATION ) );