Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // =============================================================
- // For Precompiled Headers
- #include <pch_Hack.h>
- // For Hooking operations
- #include "Hooking.h"
- // For Hardcoded Functions
- #include "ExeFunctions.h"
- // For Accessing Base Addresses
- #include "BaseAddresses.h"
- // For Accessing Hacks
- #include "MemoryHacks.h"
- // =============================================================
- namespace MemoryHacks {
- namespace {
- // using Directives
- using namespace Multiverse::Hook; // For Hooking operations
- using namespace Multiverse::Api::Utils; // For Generic Utils
- using namespace Multiverse::Api::Memory::Utils; // For Generic Memory Utils
- using namespace MemoryHacks; // For Accessing Memory Hacks
- using libMBIN::NMS::GameComponents::GcAudioWwiseEvents; // For AkEventEnum
- // --------------------------------
- // Description & Credits goes here:
- void GenerateCreditsFile() {
- // Generate file once
- if (static OneShot generateOnce; generateOnce) {
- /// Generate description & credits file
- std::string filepath{ "..\\RaYRoD's Multiverse\\Hack Credits\\Add Currency.txt" };
- std::string description{ "A 'Template' for creating No Man's Sky game hacks with the Multiverse API. \n\n"
- "- Press Ctrl + Numpad Plus to add 1000 currency to your inventory." };
- std::string author{ "RaYRoD TV#7679" };
- Dependencies::CreateTxtAbout(filepath, description, author);
- }
- }
- // Your code goes here:
- void ExecuteHack() {
- // Define Base Address & Relative Offsets
- auto baseAddr{ BaseAddr::PlayerStateData };
- auto Units{ baseAddr + 0x1DC };
- auto Nanites{ baseAddr + 0x1E0 };
- auto QuickSilver{ baseAddr + 0x1E4 };
- // --------------------------------
- // Adds 1000 currency when user presses hotkey
- if (GetAsyncKeyState(VK_CONTROL) && GetAsyncKeyState(VK_ADD) & 1) {
- if (Units)
- *(int*)Units += 1000;
- if (Nanites)
- *(int*)Nanites += 1000;
- if (QuickSilver)
- *(int*)QuickSilver += 1000;
- // Trigger Audio Event
- ExeFunc::AudioWwiseEvent((int)GcAudioWwiseEvents::AkEventEnum::UI_UNITS_RECEIVED);
- ExeFunc::AudioWwiseEvent((int)GcAudioWwiseEvents::AkEventEnum::NOTIFY_UNITS_RECEIVED);
- // Prints To Console:
- printf("1000 Units have been added! \n");
- printf("1000 Nanites have been added! \n");
- printf("1000 Quicksilver have been added! \n");
- }
- }
- }
- void MemoryHacks::AddCurrency() {
- // Generate Credits File
- GenerateCreditsFile();
- // Execute Hack if condition(s) are met
- if (MVHookConditions::isProfileSelected && BaseAddr::PlayerStateData) {
- ExecuteHack();
- }
- }
- // =============================================================
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement