dailydose

Include/Game.h

Jul 30th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #pragma once
  2. #ifndef GAME_H
  3. #define GAME_H
  4.  
  5. #include <Config.h>
  6.  
  7. class Game
  8. {
  9. public:
  10.     enum POINTS_TYPE { POINTS_MONEY, POINTS_EXPERIENCE };
  11.     enum CHEATS_TYPE { CHEAT_ONEHITKILL, CHEAT_GODMODE, CHEAT_NORELOAD };
  12.     struct cheats
  13.     {
  14.         bool active;
  15.         size_t cheatSize, offset;
  16.         DWORD_PTR instructionAddress, returnAddress;
  17.         PBYTE original, inject, jump;
  18.         union ret { DWORD_PTR i; byte b[4]; } toOriginal, toInject;
  19.         cheats() : active(false) {}
  20.     } ohk, nr;
  21.     Config* cfg;
  22.     Game(Config* cfg, int pId);
  23.     ~Game();
  24.  
  25.     bool PlayerIsDead();
  26.     void ToggleCheat(CHEATS_TYPE type);
  27.     void UpdateData1();
  28.     void UpdateData2();
  29.     void AddCurrency(POINTS_TYPE type);
  30.  
  31. private:
  32.     union types { int i; float f; } health, money, experience;
  33.     struct pointers { DWORD_PTR health, data1n2, money, experience, data2n1, data2n2, data2n3, temp; } ptr;
  34.     struct previous { DWORD_PTR health, data1n2, data2n1, data2n2, data2n3; } prevPtr;
  35.     struct maximals { int health, data1n2, data2n1, data2n2, data2n3; } max;
  36.  
  37.     HANDLE hProc;
  38.     int pId, currentValue;
  39.     short dwSize;
  40.     size_t injectOffset;
  41.     void* injectMemory;
  42.  
  43.     void InitCheats();
  44.     void _InitCheat(cheats& cheat, Config::cheats& cfg);
  45.     void _WriteCheat(cheats& cheat);
  46.     void _ToggleCheat(cheats& cheat, size_t sz);
  47.     void _ComputeBytes(cheats& cheat);
  48.     void AddData(types& value, Config::amount& amount, Config::entrys& e, DWORD_PTR& ptr);
  49.     void RewriteData(DWORD_PTR& prevPtr, DWORD_PTR ptr, int& freezedValue, short sz);
  50.     DWORD_PTR GetPointer(Config::entrys& e);
  51.     DWORD_PTR GetModule(std::string lpModuleName);
  52.     BOOL IsWow64();
  53. };
  54.  
  55. #endif
Add Comment
Please, Sign In to add comment