Surprise! We've been running on hardware provided by BuyVM for a few months and wanted to show them a little appreciation.
Running a paste site comes with unique challenges, ones that aren't always obvious and hard to control. As such, BuyVM offered us a home where we could worry less about the hosting side of things and focus on maintaining a clean and useful service! Go check them out and show them some love!
Submitted on February 15, 2017 at 09:28 AM

dllmain.cpp (C++)

#include <Windows.h>
#include <CommCtrl.h>

#pragma comment(lib, "Comctl32.lib")

typedef struct {
	DWORD mVersion;
	HWND mHwnd;
	BOOL mKeep;
	BOOL mUnicode;
} LOADINFO;


HWND hChanWnd = 0;

UINT_PTR ChannelWndProcId = 1;


enum MIRC_EXIT_CODE {
	MIRC_HALT = 0, // 0 means that mIRC should /halt processing
	MIRC_CONTINUE, // 1 means that mIRC should continue processing
	MIRC_EXEC_CMD, // 2 means that it has filled the data variable with a command which it wants mIRC to perform, and has filled parms with the parameters to use, if any, when performing the command.
	MIRC_RET_ID3 // means that the DLL has filled the data variable with the result that $dll() as an identifier should return.
};


LRESULT CALLBACK HookProc(HWND hWnd, UINT uMsg, WPARAM wParam,
	LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData) {
	return DefSubclassProc(hWnd, uMsg, wParam, lParam);
}


void __stdcall LoadDll(LOADINFO *info) {
}


int __stdcall UnloadDll(int mTimeout) {
	RemoveWindowSubclass(hChanWnd, HookProc, ChannelWndProcId);
	return 0;
}


BOOL APIENTRY DllMain(HANDLE hDllHandle, DWORD dwReason, LPVOID lpReserved) {
	return TRUE;
}


int __stdcall Start(HWND mWnd, HWND aWnd, char *data, char *parms, BOOL show, BOOL nopause) {
	hChanWnd = aWnd;
	SetWindowSubclass(hChanWnd, HookProc, ChannelWndProcId, 0);
	return MIRC_CONTINUE;
}