Skip to content

Instantly share code, notes, and snippets.

View blaquee's full-sized avatar

genuine_ blaquee

View GitHub Profile
@blaquee
blaquee / thread_name.c
Created May 6, 2019 19:33 — forked from rossy/thread_name.c
MinGW-w64 set_thread_name
#include <windows.h>
#include <winnt.h>
#include <winternl.h>
#include <pshpack8.h>
typedef struct {
DWORD dwType;
LPCSTR szName;
DWORD dwThreadID;
DWORD dwFlags;
@blaquee
blaquee / main.c
Created September 1, 2017 05:24 — forked from hfiref0x/main.c
NtLoadEnclaveData Windows 10 RS3 DSE bypass
// Original source link https://twitter.com/hFireF0X/status/887930221466443776
// If you are here from any other link - do know that they just steal original info without giving any credit to source
// This bug has been fixed in 16273 public build.
#include "global.h"
HINSTANCE g_hInstance;
HANDLE g_ConOut = NULL;
BOOL g_ConsoleOutput = FALSE;
WCHAR g_BE = 0xFEFF;
@blaquee
blaquee / pub_sub_cpp.cpp
Created August 17, 2017 02:12 — forked from makomweb/pub_sub_cpp.cpp
Fun with C++: implementing a pub/sub scenario using std::bind and other standard facilities. The approach is pretty similar to the well known .NET event mechanism.
#include <iostream>
#include <map>
#include <algorithm>
#include <functional>
#include <memory>
using namespace std;
class EventArgs {
public:
@blaquee
blaquee / c_cpp_properties.json
Created July 10, 2017 18:13 — forked from chappjc/c_cpp_properties.json
VS Code C++ project properties for VS 2015 w/ Windows SDK 10.0
{
"configurations": [
{
"name": "Mac",
"includePath": ["/usr/include"],
"browse" : {
"limitSymbolsToIncludedHeaders" : true,
"databaseFilename" : ""
}
},
<#
.Synopsis
Scans a host or network for the MS17-010 vulnerability
.DESCRIPTION
This script will use a custom NMap NSE script to scan a destination host on
port 445 for the MS17-010 vulnerability. If the host is not online or is blocking
SMB, this script will report no vulnerabilities.
OVERVIEW: LLVM 'Clang' Compiler: http://clang.llvm.org
USAGE: clang -cc1 [options] <inputs>
OPTIONS:
-### Print the commands to run for this compilation
--analyze Run the static analyzer
--migrate Run the migrator
--relocatable-pch Build a relocatable precompiled header
--serialize-diagnostics <value>
@blaquee
blaquee / yara_fn.py
Created August 25, 2016 00:37 — forked from williballenthin/yara_fn.py
generate a yara rule that matches the basic blocks of the current function in IDA Pro
'''
IDAPython script that generates a YARA rule to match against the
basic blocks of the current function. It masks out relocation bytes
and ignores jump instructions (given that we're already trying to
match compiler-specific bytes, this is of arguable benefit).
If python-yara is installed, the IDAPython script also validates that
the generated rule matches at least one segment in the current file.
author: Willi Ballenthin <william.ballenthin@fireeye.com>
@blaquee
blaquee / main.cpp
Created February 9, 2016 12:29 — forked from mrexodia/main.cpp
ExceptionHandlerTest
#include <windows.h>
#include <stdio.h>
static LPTOP_LEVEL_EXCEPTION_FILTER OldFilter;
static char callOrder[10] = "";
int main()
{
OldFilter = SetUnhandledExceptionFilter([](PEXCEPTION_POINTERS ExceptionInfo) -> LONG
{
@blaquee
blaquee / crack.rb
Created September 22, 2013 22:30 — forked from LMolr/crack.rb
# use rubinius!
M = 0x100000000
RESULT = 0xEF2E3558
def poly(a)
ret = a.inject(1337) do |sum, c|
#! /usr/bin/env python
import redis
import random
import pylibmc
import sys
r = redis.Redis(host = 'localhost', port = 6389)
mc = pylibmc.Client(['localhost:11222'])