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**
snprintf: https://github.com/mpaland/printf
@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)
/*
base64.cpp and base64.h
base64 encoding and decoding with C++.
More information at
https://renenyffenegger.ch/notes/development/Base64/Encoding-and-decoding-base-64-with-cpp
Version: 2.rc.04 (release candidate)
Copyright (C) 2004-2017, 2020 René Nyffenegger
function var_dump(v)
function table_dump(val,num)
local space = "";
if num == nil then
num = 0;
else
for i = 0, num - 1 do
space = space .. " ";
end
#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 ) );