Back to index

enigmail  1.4.3
Functions | Variables
crashinjectdll.cpp File Reference
#include <stdio.h>
#include <windows.h>

Go to the source code of this file.

Functions

DWORD WINAPI CrashingThread (LPVOID lpParameter)
BOOL WINAPI DllMain (HANDLE hinstDLL, DWORD dwReason, LPVOID lpvReserved)

Variables

DWORD tid = -1

Function Documentation

DWORD WINAPI CrashingThread ( LPVOID  lpParameter)

Definition at line 7 of file crashinjectdll.cpp.

{
  // not a very friendly DLL
  volatile int* x = (int *)0x0;
  *x = 1;
  return 0;
}

Here is the caller graph for this function:

BOOL WINAPI DllMain ( HANDLE  hinstDLL,
DWORD  dwReason,
LPVOID  lpvReserved 
)

Definition at line 17 of file crashinjectdll.cpp.

{
  if (tid == -1)
    // we have to crash on another thread because LoadLibrary() will
    // catch memory access errors and return failure to the calling process
    CreateThread(
                 NULL,                   // default security attributes
                 0,                      // use default stack size
                 CrashingThread  ,       // thread function name
                 NULL,                   // argument to thread function
                 0,                      // use default creation flags
                 &tid);                  // returns the thread identifier
  return TRUE;
}

Here is the call graph for this function:


Variable Documentation

DWORD tid = -1

Definition at line 5 of file crashinjectdll.cpp.