Advertisement
Guest User

Untitled

a guest
May 27th, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.34 KB | None | 0 0
  1. #include "stdafx.h"
  2. #pragma once
  3.  
  4. struct W2SMatrix_t
  5. {
  6. float Matrixf[4][4];
  7. };
  8.  
  9. //vec3 game coord storage type for bone positions to w2s; byte padding for single rpm
  10. struct BonePos3_t
  11. {
  12. float x;
  13.  
  14. byte pad1[12];
  15.  
  16. float y;
  17.  
  18. byte pad2[12];
  19.  
  20. float z;
  21.  
  22. byte pad3[12];
  23.  
  24. };
  25.  
  26. //storage for all bones; byte padding for single rpm
  27. struct BoneMatrix_t
  28. {
  29. byte pad1[12];
  30. BonePos3_t AllBones[128];
  31. };
  32.  
  33.  
  34. // 3 float storage structure(game coords)
  35. struct Vec3_t
  36. {
  37.  
  38. float x;
  39.  
  40. float y;
  41.  
  42. float z;
  43.  
  44. };
  45.  
  46. // 2 float storage structure(screen coords)
  47. struct Vec2_t
  48. {
  49.  
  50. float x;
  51.  
  52. float y;
  53.  
  54. };
  55.  
  56. //structure for storing screen coords and a boolean value that represents the enemies being on-screen or not
  57. struct W2Sstruct_t
  58. {
  59.  
  60. Vec2_t Coords;
  61.  
  62. bool OnScreen;
  63.  
  64. };
  65.  
  66. //limb containing 4 bones(arms and legs)
  67. struct Limb4_t
  68. {
  69.  
  70. //game coords
  71. Vec3_t bonepos3[4];
  72.  
  73. //screen coords
  74. Vec2_t bonepos2[4];
  75.  
  76. };
  77.  
  78. //limb containing 7 bones(spine)
  79. struct Limb7_t
  80. {
  81.  
  82. //game coords
  83. Vec3_t bonepos3[7];
  84.  
  85. //screen coords
  86. Vec2_t bonepos2[7];
  87.  
  88. };
  89.  
  90. //storage for limbs and a boolean that represents whether or not the skeleton is able to be drawn
  91. struct Skeleton_t
  92. {
  93. //Left leg
  94. Limb4_t Lleg;
  95.  
  96. //Right leg
  97. Limb4_t Rleg;
  98.  
  99. //Spine
  100. Limb7_t Spine;
  101.  
  102. //Left arm
  103. Limb4_t Larm;
  104.  
  105. //Right arm
  106. Limb4_t Rarm;
  107.  
  108. bool Broken;
  109.  
  110. };
  111.  
  112. //storage for entity information
  113. struct Entity_t
  114. {
  115. DWORD BaseAddr;
  116.  
  117. bool IsDead;
  118.  
  119. Vec3_t VecOrigin;
  120.  
  121. int Team;
  122.  
  123. int Health;
  124.  
  125. Skeleton_t Skeleton;
  126.  
  127. bool Valid;
  128. };
  129.  
  130.  
  131. //storage for entities
  132. struct EnityInfo_t
  133. {
  134. Entity_t Entity[64];
  135. };
  136.  
  137. //storage for local player info
  138. struct Player_t
  139. {
  140. DWORD BaseAddr;
  141.  
  142. int Team;
  143.  
  144. Vec3_t VecOrigin;
  145.  
  146. bool Valid;
  147.  
  148. Vec3_t PunchAngs;
  149.  
  150. W2SMatrix_t W2SM;
  151.  
  152. };
  153.  
  154. //storage for local player entity
  155. struct PlayerInfo_t
  156. {
  157. Player_t Player;
  158. };
  159.  
  160. //all functions relating to process interaction
  161. struct ProcessFunctions
  162. {
  163.  
  164. void EnableDebugPriv();
  165.  
  166. DWORD GetModuleHandleByName(wchar_t* ModuleName, DWORD ProcID);
  167.  
  168. HANDLE GetProcessHandleByName(wchar_t* ProcessName);
  169.  
  170. bool ReadSettingsFile(std::string* data);
  171.  
  172. void ParseSettings(std::string* data);
  173.  
  174. bool ReadSettings();
  175.  
  176. };
  177.  
  178. //RPM wrapper
  179. struct MemoryFunctions
  180. {
  181.  
  182. template <typename ReadType> ReadType Read(DWORD Address);
  183.  
  184. };
  185.  
  186. //storage for W2SM
  187. struct MiscInfo_t
  188. {
  189.  
  190. W2SMatrix_t W2SM;
  191.  
  192. };
  193.  
  194. //functions that don't fit other categories
  195. struct MiscFunctions
  196. {
  197.  
  198. float get3ddist(Vec3_t myCoords, Vec3_t enemyCoords);
  199.  
  200. W2SMatrix_t GetW2SM();
  201.  
  202. W2Sstruct_t w2s(Vec3_t from, W2SMatrix_t w2sm);
  203.  
  204. };
  205.  
  206.  
  207. //all functions relating to entity interaction
  208. struct EntityFunctions
  209. {
  210.  
  211. DWORD GetBaseEntity(int PlayerNumber);
  212.  
  213. bool ValidateBones(Entity_t Ent);
  214.  
  215. bool IsDead(DWORD BaseAddr);
  216.  
  217. Vec3_t GetVecOrigin(DWORD BaseAddr);
  218.  
  219. Vec3_t GetVecViewOrigin(DWORD BaseAddr);
  220.  
  221. int GetTeam(DWORD BaseAddr);
  222.  
  223. int GetHealth(DWORD BaseAddr);
  224.  
  225. DWORD GetBoneMatrixAddr(DWORD BaseAddr);
  226.  
  227. BoneMatrix_t GetBoneMatrix(DWORD BoneMatrixAddr);
  228.  
  229. Vec3_t GetBonePos(BoneMatrix_t Bmatrix, int TargetBone);
  230.  
  231. Vec3_t BoneToVec3(BonePos3_t);
  232.  
  233. Skeleton_t GetSkeleton(DWORD BaseAddr, W2SMatrix_t W2SM);
  234.  
  235. Entity_t GetEntity(int PlayerNumber, W2SMatrix_t W2SM);
  236.  
  237. };
  238.  
  239. //all functions that relate to local-player interaction
  240. struct PlayerFunctions
  241. {
  242.  
  243. DWORD GetPlayerBase();
  244.  
  245. int GetTeam(DWORD BaseAddr);
  246.  
  247. Vec3_t GetPosition(DWORD BaseAddr);
  248.  
  249. Player_t GetLocalPlayer();
  250.  
  251. Vec3_t GetPunchAngs(DWORD BaseAddr);
  252.  
  253. };
  254.  
  255. //declaration for objects used by multiple .cpp files
  256. extern float SWidth;
  257. extern float SHeight;
  258. extern RECT WindowRect;
  259. extern RECT ClientRect;
  260. extern HANDLE TargetProcess;
  261. extern DWORD DwClient;
  262. extern ProcessFunctions ProcessToolbox;
  263. extern MemoryFunctions MemoryToolbox;
  264. extern EntityFunctions EntityToolbox;
  265. extern PlayerFunctions PlayerToolbox;
  266. extern MiscFunctions MiscToolbox;
  267. extern EnityInfo_t EnityList;
  268. extern PlayerInfo_t PlayerInfo;
  269. extern MiscInfo_t MiscInfo;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement