Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <time.h>
- #include <cstdlib>
- #include <iostream>
- #include <windows.h>
- #include <WinInet.h>
- #include <stdio.h>
- #include <string.h>
- #include <fstream>
- #include <string>
- //0x373F14F6
- #define ADDR_SprBullets 0x373F14F6
- #define ADDR_GAMESTATUS 0x3779DF64
- //373F14F6 . 0F94C0 SETE AL
- void Memoria( void* pvAddress, const void* pvBuffer, size_t stLen )
- {
- MEMORY_BASIC_INFORMATION mbi;
- VirtualQuery( ( void* )pvAddress, &mbi, sizeof( mbi ) );
- VirtualProtect( mbi.BaseAddress, mbi.RegionSize, PAGE_EXECUTE_READWRITE, &mbi.Protect );
- memcpy( ( void* )pvAddress, ( void* )pvBuffer, stLen );
- VirtualProtect( mbi.BaseAddress, mbi.RegionSize, mbi.Protect, &mbi.Protect );
- FlushInstructionCache( GetCurrentProcess( ), ( void* )pvAddress, stLen );
- }
- bool IsGameReadyForHook(void)//now this is needed, it checks if Game has started or not.
- {
- if( GetModuleHandleA( "d3d9.dll" ) != NULL && GetModuleHandleA( "ClientFX.fxd" ) != NULL && GetModuleHandleA( "EhSvc.dll" ) != NULL && GetModuleHandleA( "CShell.dll" ) != NULL )
- return true;
- return false;
- }
- bool cIsIngame()
- {
- if(*(INT*)ADDR_GAMESTATUS==1){
- return true;
- }else{
- return false;
- }
- }
- bool firsthack;
- void MainStuff()
- {
- while(1)
- {
- if(GetAsyncKeyState(VK_NUMPAD1) &1)
- {
- firsthack = !firsthack;
- }
- if(cIsIngame() && firsthack)
- {
- Memoria((void*) ADDR_SprBullets, "\x33\xC0\x90", 3);
- }else{
- Memoria((void*) ADDR_SprBullets, "\x0F\x94\xC0", 3);
- }
- }
- }
- DWORD WINAPI HackThread()
- {
- while(!IsGameReadyForHook())
- {
- Sleep(100);
- }
- CreateThread(NULL,NULL,(LPTHREAD_START_ROUTINE)MainStuff, NULL, NULL, NULL);
- return 1;
- }
- BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved )
- {
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- CreateThread(NULL,NULL,(LPTHREAD_START_ROUTINE)HackThread, NULL, NULL, NULL);
- break;
- }
- return TRUE;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement