Instantly share code, notes, and snippets.

View bnsdat.bt
//------------------------------------------------
//--- 010 Editor v8.0.1 Binary Template
//
// File: BNSDat.bt
// Authors: zeffy
// Version: 20180912
// Purpose: Parse BNSDAT archives.
// Category: Archives
// File Mask: *.dat
// ID Bytes: 55 4F 53 45 44 41 4C 42
View iathook.c
// PageProtectAdjustExecute; VirtualProtectSameExecute:
// Copyright (c) Microsoft Corporation
// License: MIT
// Source: https://github.com/Microsoft/Detours/blob/master/src/detours.cpp
// FindImportDescriptor; ImportAttach:
// Copyright 2016 Mark Jansen
// License: LGPL-2.1-or-later
// Source: https://github.com/reactos/reactos/blob/master/modules/rostests/apitests/appshim/dispmode.c
View dllmain_avoid_deadlock.c
typedef NTSTATUS(NTAPI *PFN_RTLLEAVECRITICALSECTION)(PRTL_CRITICAL_SECTION);
PFN_RTLLEAVECRITICALSECTION g_pfnRtlLeaveCriticalSection;
__forceinline void acquire_lock(long *lock)
{
while ( InterlockedCompareExchange(lock, 1, 0) )
YieldProcessor();
}
View hex_dump.c
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#ifdef _WIN64
#define ui3264toa_s _ui64toa_s
#else
#define ui3264toa_s _ultoa_s
#endif