Skip to content

Instantly share code, notes, and snippets.

@Lynxaa
Lynxaa / idadefs.h
Created August 7, 2022 18:13 — forked from es3n1n/idadefs.h
latest definitions for hexrays decompiler output
/*
This file contains definitions used in the Hex-Rays decompiler output.
It has type definitions and convenience macros to make the
output more readable.
Copyright (c) 2007-2022 Hex-Rays
*/
@Lynxaa
Lynxaa / sieve_memory_optimization_example.cpp
Last active February 12, 2024 17:13
A quick example of how you can improve the space efficiency of Sieve of Eratosthenes
#include <iostream> // std::cout, std::endl
#include <cstring> // std::memset
#include <cstddef>
#include <memory>
// This code isn't good, just written quickly as a PoC, uses c-style casts and such, etc etc, avoid using this in it's current state.
// This is heavily untested and wrote for the purpose of this example.
// In this context, a "block" references to a region of bits, this could be 8, 16, 32, 64 bits, whatever datatype you want.
class DynamicBitset {