Skip to content

Instantly share code, notes, and snippets.

View MostParsingVex's full-sized avatar

MostParsingVex

View GitHub Profile
@MostParsingVex
MostParsingVex / aesnidetect.c
Created August 21, 2017 08:43
XMM register preserving SIGILL probe for AES-NI instructions on x86 and AMD64. Should work on Linux, BSD, OSX, Windows
#include<stdio.h>
#include<setjmp.h>
#include<signal.h>
jmp_buf state;
void sigill_handler( int i ) {
signal( SIGILL, SIG_DFL );
longjmp( state, 1 );
}