// InterferenceDLL.cpp : Defines the exported functions for the DLL application.
//

#include "stdafx.h"
#include <stdlib.h>	// for exit()

// Export a symbol with a name that hashes to a collision with WinExec. We do 
// this by finding a string that hashes to 0, and then prefixing it to any
// string which we want to cause a hash collision, in this case "WinExec".
//extern "C" { int __declspec(dllexport) NVRXPWSUSXWinExec = 0; }

// If you'd rather display a warning to the user:
extern "C" int __declspec(dllexport) NVRXPWSUSXWinExec(LPCSTR lpCmdLine, UINT uCmdShow)
{
	MessageBox(NULL, L"Shellcode halted. Program will exit now.", L"Shellcode execution attempt!", MB_OK);

	exit(EXIT_FAILURE);	// Because you don't want to return execution to the shellcode.

	return 1; 	// Never actually called.
}

// We would just export "WinExec" but then this DLL itself won't compile
// because it too relies on kernel32.dll and the Windows headers.
// We could write this DLL in assembly and/or use some other low-level method
// of avoiding implicit dependency on kernel32.dll, but as long as this DLL 
// relies on linking with the DLL we are interfering with, it's easier to use 
// a hash collision version of the exported name.
//extern "C" { int __declspec(dllexport) WinExec = 0; }

