1
General Modding & Programming / Other Games / Re: Game/torrent over SOCKS 5
« on: August 14, 2009, 11:59:11 pm »
A+ post! Thanks for this article.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved)
{
switch( fdwReason )
{
case DLL_PROCESS_ATTACH:
{
g_hOle32Dll = LoadLibrary(_T("ole32.dll"));
pCoCreateInstance = (COCREATEINSTANCE)DetourFunc(
(BYTE*)GetProcAddress(g_hOle32Dll, "CoCreateInstance"),
(BYTE*)dtx_CoCreateInstance, 5);
hMyWindowHwnd = CreateDialog(hinstDLL, MAKEINTRESOURCE(IDD_MyWindow), NULL, MyWindowProc);
ShowWindow(hMyWindowHwnd, SW_SHOW);
break;
}
case DLL_PROCESS_DETACH:
{
RetourFunc((BYTE*)GetProcAddress(g_hOle32Dll, "CoCreateInstance"),
(BYTE*)pCoCreateInstance, 5);
DestroyWindow(hMyWindowHwnd);
break;
}
}
return TRUE;
}
HRESULT STDAPICALLTYPE my_CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter,
DWORD dwClsContext, REFIID riid, LPVOID* ppv)
{ /* ... function definition ... */ }