This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" standalone="yes"?> | |
<InstrumentationManifest> | |
<Instrumentation> | |
<Regions> | |
<RegionRoot Guid="{EFA7A927-BAE3-48F6-92E1-000000000000}" Name="WMI-Regions"> | |
<Region Guid="{45EEAD74-5B56-4B38-8CEC-CF66312D6F9B}" Name="WMI-Operations"> | |
<Start> | |
<Event Provider="{1418ef04-b0b4-4623-bf7e-d74ab47bbdaa}" Id="11" Version="0" /> | |
</Start> | |
<Stop> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
def usage(): | |
print("Usage: readfolder.py [folder]") | |
def doread(dir): | |
for root, dirs, files in os.walk(dir): | |
for file in files: | |
fpath = os.path.join(root, file) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef _WIN32 | |
using nchar = wchar_t; | |
using nstring = std::wstring; | |
#define NSTRLITERAL(str) L##str | |
#define nfopen _wfopen | |
/* ... */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version='1.0' encoding='UTF-8' standalone='yes'?> | |
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3"> | |
<asmv3:application> | |
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2011/WindowsSettings"> | |
<printerDriverIsolation>true</printerDriverIsolation> | |
</asmv3:windowsSettings> | |
</asmv3:application> | |
</assembly> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <windows.h> | |
#include <wingdi.h> | |
int main () | |
{ | |
PRINTDLGW dialogResult = {}; | |
dialogResult.lStructSize = sizeof dialogResult; | |
dialogResult.Flags = PD_RETURNDEFAULT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Compile with MSVC, *Release* configuration | |
#include <iostream> | |
#include <new> | |
#include <windows.h> | |
LONG WINAPI MyVEH (PEXCEPTION_POINTERS pExp) | |
{ | |
if (pExp->ExceptionRecord->ExceptionCode == STATUS_HEAP_CORRUPTION) { | |
std::cout << "Heap corruption detected!" << std::endl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Compile with MSVC, *Release* configuration | |
#include <iostream> | |
#include <new> | |
#include <windows.h> | |
LONG WINAPI MyUEF (PEXCEPTION_POINTERS pExp) | |
{ | |
if (pExp->ExceptionRecord->ExceptionCode == STATUS_HEAP_CORRUPTION) { | |
std::cout << "Heap corruption detected!" << std::endl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ... */ | |
PEXCEPTION_RECORDS pExc = __rax; | |
if (pExc->ExceptionCode == EXCEPTION_STACK_OVERFLOW || | |
(pExc->ExceptionCode == EXCEPTION_ACCESS_VIOLATION && | |
pExc.ExceptionInformation[0] == EXCEPTION_EXECUTE_FAULT)) | |
{ | |
return E_NOTIMPL; | |
} | |
/* ... */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size_t __chkstk (size_t stackSpaceSize) | |
{ | |
// Calculate what the stack pointer would be, if the caller of | |
// __chkstk simply made its stack allocation instead of | |
// calling __chkstk. | |
// | |
// 0x18: 0x10 for 2 saved registers (used by __chkstk), plus | |
// 0x8 for the saved return address (__chkstk was call'd) | |
uintptr_t adjustedSP = __rsp + 0x18 - stackSpaceSize; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Compile with MSVC. | |
#include <windows.h> | |
#include <winnt.h> | |
#include <cstdio> | |
#pragma warning(disable:4717) | |
LONG WINAPI StackOverflowHandler (PEXCEPTION_POINTERS pExp) | |
{ |
NewerOlder