Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[RELEASE]Process Killer C++ v1.0

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Tue May 13, 2008 3:45 pm    Post subject: [RELEASE]Process Killer C++ v1.0 Reply with quote

I finished my Process Killer. It's all Win32 API coding, no visual. It's open sourced. And it's in C++ (^^). It was made in MSVC++ so if you have it you can open the project or solution. If not you can view the code in main.cpp, resource.rc, and resource.h. I also plan on releasing a v2.0 pretty soon.

Credits:
Me creating and coding

Lurc for helping with process killing function API understanding as well as the skeleton code for the function

blankrider for helping with the resources

Wiccaan for helping by making sure I didn't use more access rights I needed.



The Extension 'rar' was deactivated by an board admin, therefore this Attachment is not displayed.


_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Tue May 13, 2008 4:15 pm    Post subject: Reply with quote

One thing i noticed

I added some error handling

IF the function is a bool i would call it using error handling

Changed the PK and GetIndexName

Now if you kill a unkillable process, it will handle and not delete the string



The Extension 'rar' was deactivated by an board admin, therefore this Attachment is not displayed.


_________________
Back to top
View user's profile Send private message
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Tue May 13, 2008 4:48 pm    Post subject: Reply with quote

Now you can kill system critical process. Smile

Code:
//main.h: AdjustTokenToDebug function
BOOL AdjustTokenToDebug()
{
    //Define variables.
    LUID tLUID; HANDLE hToken; TOKEN_PRIVILEGES tTP, tTPOld;
    DWORD lengthReturned; BOOL ret = TRUE;

    //Fill the tLUID struct with our privilage info.
    if(LookupPrivilegeValue(NULL,SE_DEBUG_NAME,&tLUID)) {
        //Open the token up.
        if(OpenProcessToken(GetCurrentProcess(),TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY,&hToken)) {
            //Modify it so we become teh debuggzors.
            tTP.PrivilegeCount=1;
            tTP.Privileges->Attributes=SE_PRIVILEGE_ENABLED;
            tTP.Privileges->Luid.HighPart=tLUID.HighPart;
            tTP.Privileges->Luid.LowPart=tLUID.LowPart;
            //Make the changes and check for errors.
            if(!AdjustTokenPrivileges(hToken,0,&tTP,sizeof(tTP),&tTPOld,&lengthReturned))
                ret = FALSE; //Bad
            CloseHandle(hToken);
        } else ret = FALSE; //Bad
    } else ret = FALSE; //Bad
    return ret;
}
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Tue May 13, 2008 7:18 pm    Post subject: Reply with quote

I mentioned this in his other thread. But who wants to kill the critical system processes Razz

I myself will pass

_________________
Back to top
View user's profile Send private message
ShurikeN
Advanced Cheater
Reputation: 0

Joined: 09 Jan 2008
Posts: 84

PostPosted: Sat May 24, 2008 6:45 am    Post subject: Reply with quote

Flyte wrote:
Now you can kill system critical process. Smile

Code:
//main.h: AdjustTokenToDebug function
BOOL AdjustTokenToDebug()
{
    //Define variables.
    LUID tLUID; HANDLE hToken; TOKEN_PRIVILEGES tTP, tTPOld;
    DWORD lengthReturned; BOOL ret = TRUE;

    //Fill the tLUID struct with our privilage info.
    if(LookupPrivilegeValue(NULL,SE_DEBUG_NAME,&tLUID)) {
        //Open the token up.
        if(OpenProcessToken(GetCurrentProcess(),TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY,&hToken)) {
            //Modify it so we become teh debuggzors.
            tTP.PrivilegeCount=1;
            tTP.Privileges->Attributes=SE_PRIVILEGE_ENABLED;
            tTP.Privileges->Luid.HighPart=tLUID.HighPart;
            tTP.Privileges->Luid.LowPart=tLUID.LowPart;
            //Make the changes and check for errors.
            if(!AdjustTokenPrivileges(hToken,0,&tTP,sizeof(tTP),&tTPOld,&lengthReturned))
                ret = FALSE; //Bad
            CloseHandle(hToken);
        } else ret = FALSE; //Bad
    } else ret = FALSE; //Bad
    return ret;
}


i tried your code but seems no effect. i tried it to kill "services.exe" but i can't OpenProcess() it with access flag TERMINATE_PROCESS. I can only Open it with PROCESS_QUERY_INFORMATION | PROCESS_VM_READ.

Code:

#include <iostream>
#include <windows.h>
#include <tlhelp32.h>
using namespace std;

PROCESSENTRY32 pe32;
HANDLE hProcess = NULL;

bool GetProcessInfo( PROCESSENTRY32* pe, char szExeFile[] )
    {
        PROCESSENTRY32 proc32;
        proc32.dwSize = sizeof( PROCESSENTRY32 );
        HANDLE hSnapshot = NULL;
        hSnapshot = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
        if( Process32First( hSnapshot, &proc32 ))
            {
                do{
                    if( strcmp( proc32.szExeFile, szExeFile ) == 0 )
                        {
                            CloseHandle( hSnapshot );
                            memcpy( pe, &proc32, sizeof( PROCESSENTRY32 ));
                            return true;
                        }
                }while( Process32Next( hSnapshot, &proc32 ));
            }
        CloseHandle( hSnapshot );
        return false;
    }

BOOL AdjustTokenToDebug()
{
    LUID tLUID; HANDLE hToken; TOKEN_PRIVILEGES tTP, tTPOld;
    DWORD lengthReturned; BOOL ret = TRUE;

    if(LookupPrivilegeValue(NULL,SE_DEBUG_NAME,&tLUID)) {
        if(OpenProcessToken(GetCurrentProcess(),TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY,&hToken)) {
            tTP.PrivilegeCount=1;
            tTP.Privileges->Attributes=SE_PRIVILEGE_ENABLED;
            tTP.Privileges->Luid.HighPart=tLUID.HighPart;
            tTP.Privileges->Luid.LowPart=tLUID.LowPart;
            if(!AdjustTokenPrivileges(hToken, 0,&tTP,sizeof(tTP),&tTPOld,&lengthReturned))
                ret = FALSE;
            CloseHandle(hToken);
        } else ret = FALSE;
    } else ret = FALSE;
    return ret;
}

int main()
{
    if( !AdjustTokenToDebug() )
        cout << "Failed!\n";
    if( !GetProcessInfo( &pe32, "services.exe" ))
        cout << "Not found!\n";
    hProcess = OpenProcess( PROCESS_TERMINATE, 0, pe32.th32ProcessID );
    if( TerminateProcess( hProcess, 0 ))
        cout << "Process Terminated!\n";
    else
        cout << "Failed to terminate\n";
    if( hProcess != NULL )
        CloseHandle( hProcess );
    cin.sync();
    cin.ignore();
    return 0;
}


_________________
Code:
XXXXXX      XXXXXX
   XXXXX  XXXXX
     XXXXXXXX
    D I R E C T
     XXXXXXXX
   XXXXX  XXXXX
XXXXXX      XXXXXX
      GameDev
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites