Only works for weapons that you use. So when you change weapons, you must restart. The reason is that "without loop" study. This is a very good idea!. Because, write only once in memory and shuts down. Thus, the probability of being detected by the PB is reduced. And you only need to copy and paste. That's all...
Offset new (01.03.2016) and only X64 (DWORD64)
OFFSET_ANGLES : 0x1425CCEB0
OFFSET_GAMECONTEXT : 0x14289F480
Code:
#include <iostream>
#include <Windows.h>
class Mem
{
private:
DWORD pid;
HANDLE Handle;
DWORD64 value;
public:
inline bool OpenTargetProcess(char * windowName)
{
HWND Hwnd = FindWindowA(NULL, windowName);
if (!Hwnd) return false;
GetWindowThreadProcessId(Hwnd, &pid);
Handle = OpenProcess(PROCESS_ALL_ACCESS, false, pid);
return Handle;
}
inline Mem *Read(DWORD64 address)
{
this->value = address;
return (this->r(0));
}
inline Mem *r(DWORD64 ofs)
{
if (!this || !value)
return 0;
if (!ReadProcessMemory(Handle, (void*)(value + ofs), &value, sizeof(DWORD64), 0))
return 0;
return this;
}
template <typename T>
inline bool Get(DWORD64 ofs, LPVOID buffer)
{
if (Handle == 0 || !value)
return false;
if (!ReadProcessMemory(Handle, (void*)(value + ofs), (LPVOID)(buffer), sizeof(T), 0))
return false;
return true;
}
template <typename T>
inline bool Write(DWORD64 ofs, T buffer)
{
if (Handle == 0 || !value)
return false;
if (!WriteProcessMemory(Handle, (void*)(value + ofs), &buffer, sizeof(T), 0))
return false;
return true;
}
};
int main()
{
Mem m;
if (!m.OpenTargetProcess("Battlefield Hardline"))
{
printf("Fail to open the process");
return 0;
}
else{
printf("OK BFH...\n");
}
if (m.Read(0x1425CCEB0)->r(0x49C8)->r(0x78)->r(0x8)) // OFFSET_ANGLES
{
m.Write<float>(0x0360, 0.0f); // NoRecoil
m.Write<float>(0x0364, 0.0f); // NoSpread
m.Write<float>(0x0368, 0.0f); // NoSpread
m.Write<float>(0x036C, 0.0f); // NoSpread
m.Write<float>(0x0374, 0.0f); // NoRecoil
m.Write<float>(0x0370, 100.0f);// NoRecoil
}
if (m.Read(0x14289F480)->r(0x60)->r(0x540)->r(0x1680)->r(0x0648)) // OFFSET_GAMECONTEXT
{
m.Write<float>(0x58, 0.0f); // No Breath
}
else
{
printf("Fail...");
}
Sleep(100);
return 0;
}
Aalternative just for NoRecoil
Delete this code:
C++:
Code:
m.Write<float>(0x0364, 0.0f); // NoSpread
m.Write<float>(0x0368, 0.0f); // NoSpread
m.Write<float>(0x036C, 0.0f); // NoSpread