A C++ library to attach to the NieR Replicant process and read/write memory.
Using ReplicantHook
Memory Reference
ReplicantHook Reference
#include <iostream>
#include "ReplicantHook.hpp"
#include <thread>
using namespace std;
//Function used to exit the program
void ENDPressed(ReplicantHook* hook) {
while (true) {
if (GetKeyState(VK_END) & 0x8000) //END button pressed
{
//Disable cheats before exiting
hook->InfiniteHealth(false);
hook->InfiniteMagic(false);
//Stop hook
hook->stop();
return; //exit function
}
}
}
/*This is a showcase program of the hook
* As NieR Replicant ver.1.22474487139 is a x64 program, you must compile this solution in x64.
*/
int main()
{
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); //Look for memory leaks
ReplicantHook hook = ReplicantHook(1); //Pass game version as parameter
cout << "Replicant Hook\n";
cout << "Hooking..." << endl;
//Hook to process
while (!hook.isHooked()) {
hook.start();
Sleep(500);
}
cout << "Hooked" << endl;
//Enable some cheats
hook.InfiniteHealth(true);
hook.InfiniteMagic(true);
//Create a thread to exit when the 'END' button is pressed
//thread exitThread(ENDPressed, &hook);
//Print some values
while (hook.isHooked()) {
hook.update();
cout << "Magic " << hook.getMagic() << endl;
cout << "Health " << hook.getHealth() << endl;
cout << "Gold " << hook.getGold() << endl;
cout << "Zone " << hook.getZone() << endl;
Sleep(500);
system("cls");
}
//Join thread and exit
//exitThread.join();
return 0;
}
You can find all the used IDs and offsets here
-
v1.0.0.0>0 -
v1.0.3.0>1
start- attach the hook toNieR Replicant ver.1.22474487139.exeprocessstop- detach the hook from processisHooked- return true if hookedgetProcessID- returns process IDupdate- refresh hook & attributesgetLevel- return player's LevelgetHealth- returns player's HealthgetMagic- returns player's MagicgetGold- returns player's GoldgetZone- returns world's ZonegetName- returns player's NamegetX- returns player's X positiongetY- returns player's Y positiongetZ- returns player's Z positiongetActorModel- returns current actor model namesetX- sets player's X positionsetY- sets player's Y positionsetZ- sets player's Z positionsetPosition- sets the position of the playersetHealth- sets player HealthsetMagic- sets player's MagicsetGold- sets player's GoldsetZone- sets world's ZonesetName- sets player's NamesetLevel- sets player's LevelsetActorModel- sets actor model (you need to trigger a loading zone to see the results)InfiniteHealth- enables or disables infinite HealthInfiniteMagic- enables or disables infinite MagicaddItem- adds items to inventoryremoveItem- removes items from inventorygetInventory- returns the game Inventory and respective memory offsets as a map
DeepGameResearch- model addresses finding