#include <windows.h>
#include "detours.h"
#pragma comment(lib, "detours.lib")
// use a naked function so that there is no prolog or epilog and you can right pure asm
DWORD back = 0x5BF94FD4;
__declspec (naked) void Hack()
{
__asm
{
inc [esi]
pop edi
mov eax,esi
jmp back
}
}
void thread()
{
DetourFunction((BYTE*)(0x5BF94FCF), (BYTE*)Hack); //This is to basically detour the function that makes your smg count go down.
}
BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpReserved )
{
if( dwReason == DLL_PROCESS_ATTACH )
{
CreateThread( NULL, NULL, (LPTHREAD_START_ROUTINE)thread, NULL, NULL, NULL);
}
return TRUE;
}
DWORD server_dll = (DWORD)(GetModuleHandle("server.dll"));
DWORD address = server_dll + 0x2AF1F;
#include <windows.h>
#include "detours.h"
#pragma comment(lib, "detours.lib")
DWORD address;
DWORD back;
// use a naked function so that there is no prolog or epilog and you can right pure asm
__declspec (naked) void main()
{
__asm
{
nop
mov eax,edi //im replacing the bytes lost because of the detour
pop edi
jmp back //return to the address after the detour jump
}
}
void thread()
{
DWORD server_dll = (DWORD)(GetModuleHandle("server.dll"));
address = server_dll + 0x2AF1F;
back = address + 5; //5 because the detour takes up 5 bytes
DetourFunction((BYTE*)address, (BYTE*)main); //This is to basically detour the function that makes your smg count go down.
}
BOOL WINAPI DllMain( HINSTANCE hDLL, DWORD dwReason, LPVOID lpReserved )
{
if( dwReason == DLL_PROCESS_ATTACH )
{
CreateThread( NULL, NULL, (LPTHREAD_START_ROUTINE)thread, NULL, NULL, NULL);
}
return TRUE;
}