Skip to content

Instantly share code, notes, and snippets.

View Midi12's full-sized avatar
🏴‍☠️

Midi12

🏴‍☠️
View GitHub Profile
@Midi12
Midi12 / vector_metaprogramming_sample.cpp
Last active October 29, 2020 15:47
Geometry vector class example with metaprogramming
// Geometry vector class example with metaprogramming
#include <iostream>
#include <string>
#include <cmath>
namespace utils {
template <typename type>
class property {
@Midi12
Midi12 / superfetch_physical_memory_ranges_v2.hpp
Created May 27, 2020 14:57
NtQuerySystemInformation SystemSuperfetchInformation Version 2 (since windows 10.0.18362.1 at least)
// see more @ https://www.unknowncheats.me/forum/general-programming-and-reversing/397104-ntquerysysteminformation-systemsuperfetchinformation.html
#pragma once
#include <cstdint>
#include <vector>
#include "lazy_loader_light.hpp"
#include "ntstatus.hpp"
@Midi12
Midi12 / sse_pxor_string_encryption_decrypt_poc.py
Created March 19, 2020 09:47
sse pxor string encryption decrypt poc
'''
.text:0000000140007D8C 48 BE 2B 13 85 14 AE A7 C2 BB mov rsi, 0BBC2A7AE1485132Bh <- xmm2_op part 2
.text:0000000140007D96 48 89 74 24 50 mov qword ptr [rsp+170h+var_120], rsi
.text:0000000140007D9B 48 BF F0 F8 D3 3D 23 E3 F1 96 mov rdi, 96F1E3233DD3F8F0h <- xmm2_op part 1
.text:0000000140007DA5 48 89 7C 24 58 mov qword ptr [rsp+170h+var_120+8], rdi
.text:0000000140007DAA 48 B8 5E 60 E0 66 9D 95 EC DF mov rax, 0DFEC959D66E0605Eh <- xmm1_op part 2
.text:0000000140007DB4 48 89 44 24 40 mov qword ptr [rsp+170h+var_130], rax
.text:0000000140007DB9 48 BB 9C 94 D3 3D 23 E3 F1 96 mov rbx, 96F1E3233DD3949Ch <- xmm1_op part 1
.text:0000000140007DC3 48 89 5C 24 48 mov qword ptr [rsp+170h+var_130+8], rbx
.text:0000000140007DC8 66 0F 6F 44 24 40
@Midi12
Midi12 / ossec-aws-waf.sh
Last active February 27, 2020 16:25
OSSEC Active response to add an IP to an AWS WAF IPSet
#!/bin/sh
# Adds an IP to an existing IPSet in AWS Web Application Firewall
# Requirements: Linux with aws cli installed and configured (aws cli needs python)
# Expect: srcip
# Author: Midi12
# Last modified: Feb 25, 2020
# Change this values
IPSETID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # target ip set identifier
REGION="xx-xxxx-x" # target waf region
@Midi12
Midi12 / VMTHook.cpp
Last active October 29, 2018 10:09
Quick x64 virtual function hook class
#include "VMTHook.h"
namespace Detour {
/*
* Constructor
*/
VMTHook::VMTHook(std::uintptr_t** vtable, const std::uint16_t index, std::uintptr_t hook)
: _vtable(vtable), _index(index), _ptr(hook), _orig(0) {
assert(vtable != nullptr);