Register for your free account! | Forgot your password?

Go Back   elitepvpers › Coders Den › C/C++
You last visited: Today at 15:33

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



help hook

Discussion on help hook within the C/C++ forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Dec 2007
Posts: 39
Received Thanks: 8
help hook

this is my code:
PHP Code:
#include<Windows.h>
#include<TlHelp32.h>
#include<iostream>

using namespace std;

DWORD getPid(LPWSTR procName);
int privileges();
static 
DWORD Stub_for_mgsbox();

int MyMessageBoxW(IN HWND hWnd, IN LPWSTR lpText, IN LPWSTR lpCaption, IN UINT uType)
{
        return 
true;
}

static 
DWORD Stub_for_mgsbox(){
    return 
0;
}


DWORD HookFunction(HANDLE Process, LPVOID lpFunction, unsigned char *lpBackup)
{
    
DWORD dwAddr = (DWORD)::GetProcAddress(::GetModuleHandleA("user32.dll"), "MessageBoxW");
    
BYTE jmp[5] = { 0xE9,0x00, 0x00, 0x00, 0x00 };

    
ReadProcessMemory(Process, (LPVOID)dwAddr, lpBackup, 6, 0);

    
DWORD dwCalc = ((DWORD)lpFunction - dwAddr - 5);

    
DWORD pPrevious = 0;

    
VirtualProtectEx(Process,(void*)dwAddr, 6, PAGE_EXECUTE_READWRITE, &pPrevious);

    
memcpy(&jmp[1], &dwCalc, 4);

    
WriteProcessMemory(Process, (LPVOID)dwAddr, jmp, 6, 0);

    
VirtualProtectEx(Process, (void*)dwAddr, 6, pPrevious, &pPrevious);
    return 
dwAddr;
}
__declspec(naked) int RMesage(IN HWND hWnd, IN LPWSTR lpText, IN LPWSTR lpCaption, IN UINT uType)
{
    
__asm
    
{
        
ret 0x10
    
}
}
int main()
{
    
DWORD Pid = getPid(L"test.exe");
    if (
Pid == 0) return 10;
    
HANDLE OpenProc = OpenProcess(PROCESS_ALL_ACCESS, false, Pid);
    if (
OpenProc == 0) return 20;
    
DWORD szHookFSize = (PBYTE)Stub_for_mgsbox - (PBYTE)RMesage;
    
LPVOID szHookFAddr = VirtualAllocEx(OpenProc, 0, szHookFSize, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);
    
WriteProcessMemory(OpenProc, szHookFAddr, (void*)RMesage, szHookFSize, 0);
    
BYTE hook[6];
    
HookFunction(OpenProc, szHookFAddr, hook);
    return 
ERROR_SUCCESS;
}

int privileges(){
    
HANDLE Token;
    
TOKEN_PRIVILEGES tp;
    if (
OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &Token))
    {
        
LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &tp.Privileges[0].Luid);
        
tp.PrivilegeCount = 1;
        
tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
        if (
AdjustTokenPrivileges(Token, 0, &tp, sizeof(tp), NULL, NULL) == 0){
            return 
1;
        }
        else{
            return 
0; 
        }
    }
    return 
1;
}

DWORD getPid(LPWSTR procName){
    
HANDLE hsnap;
    
PROCESSENTRY32 pt;
    
hsnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
    
pt.dwSize = sizeof(PROCESSENTRY32);
    do{
        if (!
lstrcmpW(pt.szExeFile, procName)){
            
DWORD pid = pt.th32ProcessID;
            
CloseHandle(hsnap);
            return 
pid;
        }
    } while (
Process32Next(hsnap, &pt));
    
CloseHandle(hsnap);
    return 
0;
} 
Why??, when i set click for call messagebox, this crash?

fenixelfenix is offline  
Reply


Similar Threads Similar Threads
[Selling] * FIFA HOOK 14 [PC] - ULTIMATE TEAM & PRO-CLUBS HOOK - AUTOBOT *
10/16/2014 - Fifa Trading - 112 Replies
currently not available - stay tuned!
WarLord Public Hook (Client Hook) 01.03 Rleased Official Epvp Release by pastalov.
03/03/2012 - WarRock Hacks, Bots, Cheats & Exploits - 4 Replies
hi. Endlich hat WarLord seinen Public Hack mal geupdated :handsdown: Hier habt ihr Ihn: http://img715.imageshack.us/img715/7504/frecky.pn g Der Download befindet sich im anhang! Virus Check: https://www.virustotal.com/file/3792beba0863829ec 3e2b53f3b0c17d20bfc09c7d76f5f24967a79f1a82a4ddb/an alysis/1330708386/
<26.06.11> Chico™ Public Hook, //Invisible//Chams /Stamina/Mini Hook/NO CRASH VERSION
07/08/2011 - WarRock Hacks, Bots, Cheats & Exploits - 46 Replies
26.06.11 Hack Released 26.06.11 SuperNoSpread Problem Fixxen Status= Not in Hack Hej Com, leider hab ich eine schlechte nachricht xP^^ aus egendeinen Grund verursacht bei mir SuperNoSpread einen Direkten Crash sobald man in game ist, deshalb habe ich es entfernt O,o der Hack ist tortzdem nett und wird euch gefallen, sobald ich mehr addys habe kommen mehrere funktionen noch dazu ;) http://img4.fotos-hochladen.net/uploads/public24e lfvtrw1u.png STOP! VOR DEM DOWNLOAD! Mit Dem...



All times are GMT +2. The time now is 15:33.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.