All pastes #162002 Raw Edit

Something

public text v1 · immutable
·published 2006-09-06 00:45 UTC
rendered paste body
bool IsSandbox()
{
	BYTE bSandboxConnect[] = { 0xc8, 0x04, 0x00, 0x00 };

	bool bRet = true;
	BYTE *pConnect = (BYTE*)GetProcAddress(LoadLibrary("ws2_32.dll"), "connect");

	for(int i = 0; i < sizeof(bSandboxConnect); i++)
	{
		if(*(pConnect + i) != bSandboxConnect[i])
		{
			bRet = false;
		}
	}

	return bRet;
}

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
	if(IsSandbox())
	{
		return 0;
	}
....