[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.c++

Game Blockage....

Marshmello

11/11/2008 2:35:00 AM

Hey there,

alright so I have been working on a project for awhile. I used a very easy scripting language to write a program that detected the full
screen window class and would close the window and lock keyboard and mouse stopping the user from game play... fast forward to now I now have the scipt much more efficient.
as of now it is still in AutoHotkey script and im hoping to port it to C++. How is works now is it checks the time and if approriate allows the games other wise it will run taskkill via command line and run a command simmilar to this "Taskkill /F /FI "Modules eq d3d9.dll" /FI "imagename ne Exception.exe" "
this kills all programs using the directx dll d3d9.dll with the exception of exception.exe. anyways what Im trying to do is have it check the time if the time isn't between say 12:20PM TO 1:05:PM it will run the command line provided mines a bit longer with more exceptions.. but if it is between those times have it do nothing... the last part im tryin
to do is put in this code I borrowed to make it unkillable...

#include <windows.h>
#include <stdio.h>

typedef VOID ( _stdcall *RtlSetProcessIsCritical ) (
IN BOOLEAN NewValue,
OUT PBOOLEAN OldValue, // (optional)
IN BOOLEAN IsWinlogon );

BOOL EnablePriv(LPCSTR lpszPriv) // by Napalm
{
HANDLE hToken;
LUID luid;
TOKEN_PRIVILEGES tkprivs;
ZeroMemory(&tkprivs, sizeof(tkprivs));

if(!OpenProcessToken(GetCurrentProcess(), (TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY), &hToken))
return FALSE;

if(!LookupPrivilegeValue(NULL, lpszPriv, &luid)){
CloseHandle(hToken); return FALSE;
}

tkprivs.PrivilegeCount = 1;
tkprivs.Privileges[0].Luid = luid;
tkprivs.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;

BOOL bRet = AdjustTokenPrivileges(hToken, FALSE, &tkprivs, sizeof(tkprivs), NULL, NULL);
CloseHandle(hToken);
return bRet;
}

BOOL ProtectProcess() // by _FIL73R_
{
HANDLE hDLL;
RtlSetProcessIsCritical fSetCritical;

hDLL = LoadLibraryA("ntdll.dll");
if ( hDLL != NULL )
{
EnablePriv(SE_DEBUG_NAME);
(fSetCritical) = (RtlSetProcessIsCritical) GetProcAddress( (HINSTANCE)hDLL, "RtlSetProcessIsCritical" );
if(!fSetCritical) return 0;
fSetCritical(1,0,0);
return 1;
} else
return 0;
}

int main (void)
{
ProtectProcess();
while(1)
{
// do your virus thingy
}
return 0;
}

I know im asking alot but any help would be amazing thanks in advance...
1 Answer

jt

11/11/2008 8:27:00 AM

0


> I know im asking alot but any help would be amazing thanks in advance...

There's not a single questionmark in your long post.