From a740706e64fb3900a9598c3e67016c0ecb05da0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asier=20Nu=C3=B1ez?= <45818936+Asiern@users.noreply.github.com> Date: Sun, 24 Jan 2021 17:30:24 +0100 Subject: [PATCH] Update README.md --- README.md | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 93 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8d35103..9fca2b7 100644 --- a/README.md +++ b/README.md @@ -1 +1,93 @@ -## NieR:Hook +# NieR:Automata Hook + +A C++ library to attach to the NieR:Automata process and read/write memory. + +[Using NieRHook](#using-nierhook)
+[NieRHook Reference](#nierhook-reference) + +## Using NieRHook + +``` +#include +#include +#include +#include +#include "NierHook.hpp" + +//Function used to exit the program +void ENDPressed(NieRHook* hook) { + while (true) { + if (GetKeyState(VK_END) & 0x8000) //END button pressed + { + //Disable cheats before exiting + hook->InfiniteDoubleJump(false); + hook->IgnoreUpgradeMaterials(false); + //Stop hook + hook->stop(); + return;//exit function + } + } +} + +/*This is a showcase program of the hook +* As NieR:Automata is a x64 program, you must compile this solution in x64. +*/ +int main() +{ + NieRHook hook; + //Hook to process + while (!hook.isHooked()) { + hook.start(); + } + + //Enable some cheats + hook.InfiniteDoubleJump(true); + hook.IgnoreUpgradeMaterials(true); + + //Create a thread to exit when the 'END' button is pressed + std::thread exitThread(ENDPressed, &hook); + + //Print some values + while (hook.isHooked()) { + hook.update();//update hook internal values (Position, Health, Level...) + std::cout << "X: " << hook.getXPosition() << " Y: " << hook.getYPosition() << " Z: " << hook.getYPosition() << std::endl; + std::cout << "Health: " << hook.getHealth() << std::endl; + std::cout << "Press END to exit..." << std::endl; + Sleep(500); + system("cls"); + } + + //Join thread and exit + exitThread.join(); + return (0); +} +``` + +--- + +## NieRHook Reference + +#### Methods + +- `Start` - attach the hook to `NieRAutomata.exe` process +- `Stop` - detach the hook from process +- `isHooked` - return true if hooked +- `hookStatus` - ensures the status of the hook, if processID changes stops +- `getProcessID` - returns process ID +- `update` - refresh hook & attributes +- `getLevel` - return player's level +- `getHealth` - returns player's health +- `getMaxHealth` - returns player's max health +- `getFunds` - returns player's Funds(G) +- `getEXP` - returns player's EXP +- `getXPosition` - returns player's X position +- `getYPosition` - returns player's Y position +- `getZPosition` - returns player's Z position +- `setPosition` - sets the position of the player +- `setHealth` - sets player health +- `NoClip` - enables or disables No Clip +- `NoCooldown` - enables or disables No Cooldown +- `InfiniteDoubleJump` - enables or disables Infinite Double Jump +- `InfiniteAirDash` - enables or disables Infinite Air Dash +- `IgnoreUpgradeMaterials` - enables or disables Ignore Upgrade Materials +- `setGameSpeed` - sets game speed