Advertisement
Guest User

Untitled

a guest
Oct 20th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.46 KB | None | 0 0
  1. #pragma once
  2.  
  3. #include "../UTILS/offsets.h"
  4. #include "../UTILS/interfaces.h"
  5.  
  6.  
  7. namespace SDK
  8. {
  9. class CSWeaponInfo
  10. {
  11. public:
  12. virtual ~CSWeaponInfo() {};
  13. char* consoleName; // 0x0004
  14. char pad_0008[12]; // 0x0008
  15. int iMaxClip1; // 0x0014
  16. int iMaxClip2; // 0x0018
  17. int iDefaultClip1; // 0x001C
  18. int iDefaultClip2; // 0x0020
  19. char pad_0024[8]; // 0x0024
  20. char* szWorldModel; // 0x002C
  21. char* szViewModel; // 0x0030
  22. char* szDroppedModel; // 0x0034
  23. char pad_0038[4]; // 0x0038
  24. char* N0000023E; // 0x003C
  25. char pad_0040[56]; // 0x0040
  26. char* szEmptySound; // 0x0078
  27. char pad_007C[4]; // 0x007C
  28. char* szBulletType; // 0x0080
  29. char pad_0084[4]; // 0x0084
  30. char* szHudName; // 0x0088
  31. char* szWeaponName; // 0x008C
  32. char pad_0090[56]; // 0x0090
  33. int WeaponType; // 0x00C8
  34. int iWeaponPrice; // 0x00CC
  35. int iKillAward; // 0x00D0
  36. char* szAnimationPrefix; // 0x00D4
  37. float flCycleTime; // 0x00D8
  38. float flCycleTimeAlt; // 0x00DC
  39. float flTimeToIdle; // 0x00E0
  40. float flIdleInterval; // 0x00E4
  41. bool bFullAuto; // 0x00E8
  42. char pad_0x00E5[3]; // 0x00E9
  43. int iDamage; // 0x00EC
  44. float flArmorRatio; // 0x00F0
  45. int iBullets; // 0x00F4
  46. float flPenetration; // 0x00F8
  47. float flFlinchVelocityModifierLarge; // 0x00FC
  48. float flFlinchVelocityModifierSmall; // 0x0100
  49. float flRange; // 0x0104
  50. float flRangeModifier; // 0x0108
  51. float flThrowVelocity; // 0x010C
  52. char pad_0x010C[12]; // 0x0110
  53. bool bHasSilencer; // 0x011C
  54. char pad_0x0119[3]; // 0x011D
  55. char* pSilencerModel; // 0x0120
  56. int iCrosshairMinDistance; // 0x0124
  57. int iCrosshairDeltaDistance;// 0x0128 - iTeam?
  58. float flMaxPlayerSpeed; // 0x012C
  59. float flMaxPlayerSpeedAlt; // 0x0130
  60. float flSpread; // 0x0134
  61. float flSpreadAlt; // 0x0138
  62. float flInaccuracyCrouch; // 0x013C
  63. float flInaccuracyCrouchAlt; // 0x0140
  64. float flInaccuracyStand; // 0x0144
  65. float flInaccuracyStandAlt; // 0x0148
  66. float flInaccuracyJumpInitial;// 0x014C
  67. float flInaccuracyJump; // 0x0150
  68. float flInaccuracyJumpAlt; // 0x0154
  69. float flInaccuracyLand; // 0x0158
  70. float flInaccuracyLandAlt; // 0x015C
  71. float flInaccuracyLadder; // 0x0160
  72. float flInaccuracyLadderAlt; // 0x0164
  73. float flInaccuracyFire; // 0x0168
  74. float flInaccuracyFireAlt; // 0x016C
  75. float flInaccuracyMove; // 0x0170
  76. float flInaccuracyMoveAlt; // 0x0174
  77. float flInaccuracyReload; // 0x0178
  78. int iRecoilSeed; // 0x017C
  79. float flRecoilAngle; // 0x0180
  80. float flRecoilAngleAlt; // 0x0184
  81. float flRecoilAngleVariance; // 0x0188
  82. float flRecoilAngleVarianceAlt; // 0x018C
  83. float flRecoilMagnitude; // 0x0190
  84. float flRecoilMagnitudeAlt; // 0x0194
  85. float flRecoilMagnitudeVariance; // 0x0198
  86. float flRecoilMagnitudeVarianceAlt; // 0x019C
  87. float flRecoveryTimeCrouch; // 0x01A0
  88. float flRecoveryTimeStand; // 0x01A4
  89. float flRecoveryTimeCrouchFinal; // 0x01A8
  90. float flRecoveryTimeStandFinal; // 0x01AC
  91. int iRecoveryTransitionStartBullet;// 0x01B0
  92. int iRecoveryTransitionEndBullet; // 0x01B4
  93. bool bUnzoomAfterShot; // 0x01B8
  94. bool bHideViewModelZoomed; // 0x01B9
  95. char pad_0x01B5[2]; // 0x01BA
  96. char iZoomLevels[3]; // 0x01BC
  97. int iZoomFOV[2]; // 0x01C0
  98. float fZoomTime[3]; // 0x01C4
  99. char* szWeaponClass; // 0x01D4
  100. float flAddonScale; // 0x01D8
  101. char pad_0x01DC[4]; // 0x01DC
  102. char* szEjectBrassEffect; // 0x01E0
  103. char* szTracerEffect; // 0x01E4
  104. int iTracerFrequency; // 0x01E8
  105. int iTracerFrequencyAlt; // 0x01EC
  106. char* szMuzzleFlashEffect_1stPerson; // 0x01F0
  107. char pad_0x01F4[4]; // 0x01F4
  108. char* szMuzzleFlashEffect_3rdPerson; // 0x01F8
  109. char pad_0x01FC[4]; // 0x01FC
  110. char* szMuzzleSmokeEffect; // 0x0200
  111. float flHeatPerShot; // 0x0204
  112. char* szZoomInSound; // 0x0208
  113. char* szZoomOutSound; // 0x020C
  114. float flInaccuracyPitchShift; // 0x0210
  115. float flInaccuracySoundThreshold; // 0x0214
  116. float flBotAudibleRange; // 0x0218
  117. char pad_0x0218[8]; // 0x0220
  118. char* pWrongTeamMsg; // 0x0224
  119. bool bHasBurstMode; // 0x0228
  120. char pad_0x0225[3]; // 0x0229
  121. bool bIsRevolver; // 0x022C
  122. bool bCannotShootUnderwater; // 0x0230
  123. };
  124.  
  125. struct Weapon_Info
  126. {
  127. virtual ~Weapon_Info() {};
  128. char* consoleName; // 0x0004
  129. char pad_0008[12]; // 0x0008
  130. int iMaxClip1; // 0x0014
  131. int iMaxClip2; // 0x0018
  132. int iDefaultClip1; // 0x001C
  133. int iDefaultClip2; // 0x0020
  134. char pad_0024[8]; // 0x0024
  135. char* szWorldModel; // 0x002C
  136. char* szViewModel; // 0x0030
  137. char* szDroppedModel; // 0x0034
  138. char pad_0038[4]; // 0x0038
  139. char* N0000023E; // 0x003C
  140. char pad_0040[56]; // 0x0040
  141. char* szEmptySound; // 0x0078
  142. char pad_007C[4]; // 0x007C
  143. char* szBulletType; // 0x0080
  144. char pad_0084[4]; // 0x0084
  145. char* szHudName; // 0x0088
  146. char* szWeaponName; // 0x008C
  147. char pad_0090[56]; // 0x0090
  148. int WeaponType; // 0x00C8
  149. int iWeaponPrice; // 0x00CC
  150. int iKillAward; // 0x00D0
  151. char* szAnimationPrefix; // 0x00D4
  152. float flCycleTime; // 0x00D8
  153. float flCycleTimeAlt; // 0x00DC
  154. float flTimeToIdle; // 0x00E0
  155. float flIdleInterval; // 0x00E4
  156. bool bFullAuto; // 0x00E8
  157. char pad_0x00E5[3]; // 0x00E9
  158. int iDamage; // 0x00EC
  159. float flArmorRatio; // 0x00F0
  160. int iBullets; // 0x00F4
  161. float flPenetration; // 0x00F8
  162. float flFlinchVelocityModifierLarge; // 0x00FC
  163. float flFlinchVelocityModifierSmall; // 0x0100
  164. float flRange; // 0x0104
  165. float flRangeModifier; // 0x0108
  166. float flThrowVelocity; // 0x010C
  167. char pad_0x010C[12]; // 0x0110
  168. bool bHasSilencer; // 0x011C
  169. char pad_0x0119[3]; // 0x011D
  170. char* pSilencerModel; // 0x0120
  171. int iCrosshairMinDistance; // 0x0124
  172. int iCrosshairDeltaDistance;// 0x0128 - iTeam?
  173. float flMaxPlayerSpeed; // 0x012C
  174. float flMaxPlayerSpeedAlt; // 0x0130
  175. float flSpread; // 0x0134
  176. float flSpreadAlt; // 0x0138
  177. float flInaccuracyCrouch; // 0x013C
  178. float flInaccuracyCrouchAlt; // 0x0140
  179. float flInaccuracyStand; // 0x0144
  180. float flInaccuracyStandAlt; // 0x0148
  181. float flInaccuracyJumpInitial;// 0x014C
  182. float flInaccuracyJump; // 0x0150
  183. float flInaccuracyJumpAlt; // 0x0154
  184. float flInaccuracyLand; // 0x0158
  185. float flInaccuracyLandAlt; // 0x015C
  186. float flInaccuracyLadder; // 0x0160
  187. float flInaccuracyLadderAlt; // 0x0164
  188. float flInaccuracyFire; // 0x0168
  189. float flInaccuracyFireAlt; // 0x016C
  190. float flInaccuracyMove; // 0x0170
  191. float flInaccuracyMoveAlt; // 0x0174
  192. float flInaccuracyReload; // 0x0178
  193. int iRecoilSeed; // 0x017C
  194. float flRecoilAngle; // 0x0180
  195. float flRecoilAngleAlt; // 0x0184
  196. float flRecoilAngleVariance; // 0x0188
  197. float flRecoilAngleVarianceAlt; // 0x018C
  198. float flRecoilMagnitude; // 0x0190
  199. float flRecoilMagnitudeAlt; // 0x0194
  200. float flRecoilMagnitudeVariance; // 0x0198
  201. float flRecoilMagnitudeVarianceAlt; // 0x019C
  202. float flRecoveryTimeCrouch; // 0x01A0
  203. float flRecoveryTimeStand; // 0x01A4
  204. float flRecoveryTimeCrouchFinal; // 0x01A8
  205. float flRecoveryTimeStandFinal; // 0x01AC
  206. int iRecoveryTransitionStartBullet;// 0x01B0
  207. int iRecoveryTransitionEndBullet; // 0x01B4
  208. bool bUnzoomAfterShot; // 0x01B8
  209. bool bHideViewModelZoomed; // 0x01B9
  210. char pad_0x01B5[2]; // 0x01BA
  211. char iZoomLevels[3]; // 0x01BC
  212. int iZoomFOV[2]; // 0x01C0
  213. float fZoomTime[3]; // 0x01C4
  214. char* szWeaponClass; // 0x01D4
  215. float flAddonScale; // 0x01D8
  216. char pad_0x01DC[4]; // 0x01DC
  217. char* szEjectBrassEffect; // 0x01E0
  218. char* szTracerEffect; // 0x01E4
  219. int iTracerFrequency; // 0x01E8
  220. int iTracerFrequencyAlt; // 0x01EC
  221. char* szMuzzleFlashEffect_1stPerson; // 0x01F0
  222. char pad_0x01F4[4]; // 0x01F4
  223. char* szMuzzleFlashEffect_3rdPerson; // 0x01F8
  224. char pad_0x01FC[4]; // 0x01FC
  225. char* szMuzzleSmokeEffect; // 0x0200
  226. float flHeatPerShot; // 0x0204
  227. char* szZoomInSound; // 0x0208
  228. char* szZoomOutSound; // 0x020C
  229. float flInaccuracyPitchShift; // 0x0210
  230. float flInaccuracySoundThreshold; // 0x0214
  231. float flBotAudibleRange; // 0x0218
  232. char pad_0x0218[8]; // 0x0220
  233. char* pWrongTeamMsg; // 0x0224
  234. bool bHasBurstMode; // 0x0228
  235. char pad_0x0225[3]; // 0x0229
  236. bool bIsRevolver; // 0x022C
  237. bool bCannotShootUnderwater; // 0x0230
  238. };
  239.  
  240. /*enum class ItemDefinitionIndex : int
  241. {
  242. INVALID = -1,
  243. WEAPON_DEAGLE = 1,
  244. WEAPON_ELITE = 2,
  245. WEAPON_FIVESEVEN = 3,
  246. WEAPON_GLOCK = 4,
  247. WEAPON_AK47 = 7,
  248. WEAPON_AUG = 8,
  249. WEAPON_AWP = 9,
  250. WEAPON_FAMAS = 10,
  251. WEAPON_G3SG1 = 11,
  252. WEAPON_GALILAR = 13,
  253. WEAPON_M249 = 14,
  254. WEAPON_M4A1 = 16,
  255. WEAPON_MAC10 = 17,
  256. WEAPON_P90 = 19,
  257. WEAPON_UMP45 = 24,
  258. WEAPON_XM1014 = 25,
  259. WEAPON_BIZON = 26,
  260. WEAPON_MAG7 = 27,
  261. WEAPON_NEGEV = 28,
  262. WEAPON_SAWEDOFF = 29,
  263. WEAPON_TEC9 = 30,
  264. WEAPON_TASER = 31,
  265. WEAPON_HKP2000 = 32,
  266. WEAPON_MP7 = 33,
  267. WEAPON_MP9 = 34,
  268. WEAPON_NOVA = 35,
  269. WEAPON_P250 = 36,
  270. WEAPON_SCAR20 = 38,
  271. WEAPON_SG556 = 39,
  272. WEAPON_SSG08 = 40,
  273. WEAPON_KNIFE = 42,
  274. WEAPON_FLASHBANG = 43,
  275. WEAPON_HEGRENADE = 44,
  276. WEAPON_SMOKEGRENADE = 45,
  277. WEAPON_MOLOTOV = 46,
  278. WEAPON_DECOY = 47,
  279. WEAPON_INCGRENADE = 48,
  280. WEAPON_C4 = 49,
  281. WEAPON_KNIFE_T = 59,
  282. WEAPON_M4A1_SILENCER = 60,
  283. WEAPON_USP_SILENCER = 61,
  284. WEAPON_CZ75A = 63,
  285. WEAPON_REVOLVER = 64,
  286. WEAPON_KNIFE_BAYONET = 500,
  287. WEAPON_KNIFE_FLIP = 505,
  288. WEAPON_KNIFE_GUT = 506,
  289. WEAPON_KNIFE_KARAMBIT = 507,
  290. WEAPON_KNIFE_M9_BAYONET = 508,
  291. WEAPON_KNIFE_TACTICAL = 509,
  292. WEAPON_KNIFE_FALCHION = 512,
  293. WEAPON_KNIFE_SURVIVAL_BOWIE = 514,
  294. WEAPON_KNIFE_BUTTERFLY = 515,
  295. WEAPON_KNIFE_PUSH = 516,
  296. GLOVE_STUDDED_BLOODHOUND = 5027,
  297. GLOVE_T_SIDE = 5028,
  298. GLOVE_CT_SIDE = 5029,
  299. GLOVE_SPORTY = 5030,
  300. GLOVE_SLICK = 5031,
  301. GLOVE_LEATHER_WRAP = 5032,
  302. GLOVE_MOTORCYCLE = 5033,
  303. GLOVE_SPECIALIST = 5034,
  304. MAX_ITEMDEFINITIONINDEX
  305. };*/
  306.  
  307.  
  308. class CBaseWeapon
  309. {
  310. public:
  311. float GetNextPrimaryAttack()
  312. {
  313. return *reinterpret_cast<float*>(uintptr_t(this) + OFFSETS::m_flNextPrimaryAttack);
  314. }
  315. int GetItemDefenitionIndex()
  316. {
  317. return *reinterpret_cast<int*>(uintptr_t(this) + OFFSETS::m_iItemDefinitionIndex);
  318. }
  319. float GetPostponeFireReadyTime()
  320. {
  321. return *reinterpret_cast<float*>(uintptr_t(this) + OFFSETS::m_flPostponeFireReadyTime);
  322. }
  323. float GetSpreadCone()
  324. {
  325. typedef float(__thiscall* Fn)(void*);
  326. return VMT::VMTHookManager::GetFunction<Fn>(this, 436)(this);
  327. }
  328. float GetInaccuracy()
  329. {
  330. typedef float(__thiscall* Fn)(void*);
  331. return VMT::VMTHookManager::GetFunction<Fn>(this, 467)(this); //469
  332. }
  333. HANDLE GetOwnerHandle()
  334. {
  335. return *(HANDLE*)((uintptr_t)this + 0x000031D0);
  336. }
  337. Vector GetOrigin()
  338. {
  339. return *(Vector*)((uintptr_t)this + 0x00000134);
  340. }
  341. bool is_revolver()
  342. {
  343. if (!this)
  344. return false;
  345.  
  346. int iWeaponID = this->GetItemDefenitionIndex();
  347. return (iWeaponID == 64);
  348. }
  349.  
  350. bool is_knife()
  351. {
  352. if (!this)
  353. return false;
  354.  
  355. int iWeaponID = this->GetItemDefenitionIndex();
  356. return (iWeaponID == 42 || iWeaponID == 59
  357. || iWeaponID == 59 || iWeaponID == 41
  358. || iWeaponID == 500 || iWeaponID == 505 || iWeaponID == 506
  359. || iWeaponID == 507 || iWeaponID == 508 || iWeaponID == 509
  360. || iWeaponID == 515);
  361. }
  362.  
  363. bool is_grenade()
  364. {
  365. if (!this)
  366. return false;
  367.  
  368. int WeaponId = this->GetItemDefenitionIndex();
  369.  
  370. if (!WeaponId)
  371. return false;
  372.  
  373. if (WeaponId == 43 || WeaponId == 44 || WeaponId == 45 || WeaponId == 46 || WeaponId == 47 || WeaponId == 48)
  374. {
  375. return true;
  376. }
  377. else
  378. {
  379. return false;
  380. }
  381. }
  382.  
  383. int GetLoadedAmmo()
  384. {
  385. return *reinterpret_cast<int*>(uintptr_t(this) + OFFSETS::m_iClip1);
  386. }
  387. void UpdateAccuracyPenalty()
  388. {
  389. typedef void(__thiscall* Fn)(void*);
  390. return VMT::VMTHookManager::GetFunction<Fn>(this, 468)(this); //470
  391. }
  392. Weapon_Info* GetWeaponInfo()
  393. {
  394. if (!this) return nullptr;
  395. typedef Weapon_Info*(__thiscall* Fn)(void*);
  396. return VMT::VMTHookManager::GetFunction<Fn>(this, 444)(this);
  397. }
  398. CSWeaponInfo* get_full_info()
  399. {
  400. //if (!this) return nullptr;
  401. /*typedef CSWeaponInfo*(__thiscall* Fn)(void*);
  402. return VMT::VMTHookManager::GetFunction<Fn>(this, 446)(this);*/
  403. using Fn = CSWeaponInfo * (__thiscall*)(void*);
  404.  
  405. static auto fn = reinterpret_cast<Fn>(UTILS::FindSignature("client_panorama.dll", "55 8B EC 81 EC ? ? ? ? 53 8B D9 56 57 8D 8B"));
  406. return fn(this);
  407. }
  408. };
  409.  
  410. class CCSBomb
  411. {
  412. public:
  413. HANDLE GetOwnerHandle()
  414. {
  415. return *(HANDLE*)((uintptr_t)this + 0x000031D0);
  416. }
  417.  
  418. float GetC4BlowTime()
  419. {
  420. return *(float*)((uintptr_t)this + 0x0000297C);
  421. }
  422.  
  423. float GetC4DefuseCountDown()
  424. {
  425. return *(float*)((uintptr_t)this + 0x00002994);
  426. }
  427.  
  428. int GetBombDefuser()
  429. {
  430. return *(int*)((uintptr_t)this + 0x000017B8);
  431. }
  432.  
  433. bool IsBombDefused()
  434. {
  435. return *(bool*)((uintptr_t)this + 0x00002998);
  436. }
  437. };
  438.  
  439. class CBaseCSGrenade : CBaseWeapon
  440. {
  441. public:
  442. float pin_pulled()
  443. {
  444. return *reinterpret_cast<float*>(uintptr_t(this) + OFFSETS::m_bPinPulled);
  445. }
  446.  
  447. float throw_time()
  448. {
  449. return *reinterpret_cast<float*>(uintptr_t(this) + OFFSETS::m_fThrowTime);
  450. }
  451. };
  452. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement