Skip to content

Instantly share code, notes, and snippets.

@lolisbest
lolisbest / tls-callback.cpp
Created December 11, 2019 04:28 — forked from dennisfischer/tls-callback.cpp
TLS callback for x86 & x64 windows OS.
// @source: http://www.unknowncheats.me/forum/c-and-c/84146-tls-callback-tutorial.html
#include "windows.h"
#include <stdio.h>
void NTAPI __stdcall TLSCallbacks(PVOID DllHandle, DWORD dwReason, PVOID Reserved);
//linker spec
#ifdef _M_IX86
#pragma comment (linker, "/INCLUDE:__tls_used")
#pragma comment (linker, "/INCLUDE:__tls_callback")
#else