setting default process to put in MHS

Need More API Functions? Request Language Additions Here

Moderators: g3nuin3, SpeedWing, WhiteHat, mezzo

setting default process to put in MHS

Postby tik_ss » Thu May 28, 2009 9:32 pm

I found some process is hide, although I selected the restrict mode option. So if we can set the default process, once this process was run, the MHS open it. Then we can enjoy for hack. :D
tik_ss
I Have A Few Questions
 
Posts: 2
Joined: Thu May 28, 2009 8:22 pm

Postby L. Spiro » Fri May 29, 2009 7:08 am

Code: Select all
VOID On_ProcessIsOpening( LPVOID lpvEproc, DWORD dwParentId, DWORD dwProcId ) {
    CHAR szBuffer[MAX_PATH];
    if ( !GetProcessNameById( szBuffer, dwProcId ) ) { return; }
    if ( StrICmp( szBuffer, "ENTERTHE_EXE_NAMEOFYOURGAMEHERE.exe" ) == 0 ) {
        LoadProcess( dwProcId );
    }
}


BOOL GetProcessNameById( CHAR * pcOutputName, DWORD dwId ) {
    // Exactly the same as the Win32 API.
    PROCESSENTRY32 pe32;
    ZeroMemory( &pe32, sizeof( PROCESSENTRY32 ) );
    pe32.dwSize = sizeof( PROCESSENTRY32 );

    HANDLE hSnap = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
    if ( hSnap == INVALID_HANDLE_VALUE ) {          // If the snap fails, error.
        return false;
    }
    else {
        BOOL bRet = false;
        if ( Process32First( hSnap, &pe32 ) ) {
            do {
                if ( pe32.th32ProcessID == dwId ) {
                    bRet = true;                    // We have a match!  Break immediately.
                    StrCpy( pcOutputName, pe32.szExeFile );
                    break;
                }
            } while ( Process32Next( hSnap, &pe32 ) );
        }
        // As with the Win32 API, we must close our handles.
        // Technically we do not need to do this because the
        //  script will do it for us when this script thread exits,
        //  but that is bad coding practice.
        CloseHandle( hSnap );

        return bRet;
    }
}


LoadProcess() does not open in restricted mode, however. I will add this option in the next version.


L. Spiro
Our songs remind you of songs you’ve never heard.
User avatar
L. Spiro
L. Spiro
 
Posts: 3129
Joined: Mon Jul 17, 2006 10:14 pm
Location: Tokyo, Japan


Return to Feature Request

Who is online

Users browsing this forum: No registered users and 1 guest

cron