Skip to content

Instantly share code, notes, and snippets.

View 3llena's full-sized avatar
💤
Sleeping

3llena

💤
Sleeping
View GitHub Profile
@3llena
3llena / peb.hpp
Created April 5, 2024 14:09
peb skeleton utils and usage of _field
#pragma once
template< class type_t > constexpr bool is_pointer = false;
template< class type_t > constexpr bool is_pointer< type_t* > = true;
#define _field( rva, type, name )\
auto name( )\
{\
if constexpr ( is_pointer< type > )\
{\
@3llena
3llena / fnv1.hpp
Created April 5, 2024 13:53
fnv1 hash utilities
#pragma once
namespace uti
{
static constexpr std::uint32_t fnv1_basis = 0x811c9dc5;
static constexpr std::uint32_t fnv1_prime = 0x01000193;
[[ nodiscard ]]
constexpr std::uint32_t fnv1_hash_ct( const char* string, const std::uint32_t basis = fnv1_basis )
{
@3llena
3llena / ia32e.hpp
Last active April 26, 2024 03:08
complete IA-32e paging for vtop
#pragma once
//
// https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-vol-3a-part-1-manual.pdf
//
namespace os
{
union virtual_address_t
{
@3llena
3llena / pe64.hpp
Last active April 5, 2024 13:53
portable PE64 header utils
#pragma once
namespace os
{
enum e_image_signature: const std::uint16_t
{
dos_magic = 0x5a4d, // 'MZ'
nts_magic = 0x4550, // 'PE00'
opt_magic = 0x020b
};
@3llena
3llena / cpuid_rdtsc.hpp
Created September 18, 2021 12:44
vm cpu detection via cpuid and rdtsc
#include <iostream>
#include <thread>
constexpr std::uint32_t
dynamic_cycles = 10,
standard_sleep = 500,
vm_cycle_ratio = 100,
cycle_ratio = 75;
// -- rdtsc --
@3llena
3llena / injv_lib.v
Last active September 9, 2021 12:08
vlang win32 injector
import cli
import os
const (
query_information = 0x0400
page_readwrite = 0x0004
create_thread = 0x0002
vm_operation = 0x0008
mem_reserve = 0x2000
mem_commit = 0x1000