Advertisement
BaSs_HaXoR

xDevKit++ C++ Header

Nov 18th, 2014
648
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.58 KB | None | 0 0
  1. //xDevKit.h
  2. //Source: http://www.mediafire.com/view/dm7v1adl9ziy0n8/Memory%2B%2B.h
  3. //Credits: DArK x1337HaX - Post on S7sins, CraigChrist's Devkit++, and TeamGeckos KYZA for Converting to C++.
  4. /*
  5.  ################################
  6.  #         -----------          #
  7.  #           CREDITS            #
  8.  #         -----------          #
  9.  #       CraigChrist8239        #
  10.  #     Original C# Version      #
  11.  #    ---------------------     #
  12.  #            KYZA              #
  13.  #      Conversion To C++       #
  14.  #    ----------------------    #
  15.  #                              #
  16.  ################################
  17.  */
  18.  
  19. int DataType = 69;
  20.  
  21. void ChangeDataType(int Type) {
  22.     DataType = Type;
  23. }
  24.  
  25. int GetDataType() {
  26.     return DataType;
  27. }
  28.  
  29. bool ReadBool(int offset) {
  30.     return *(bool*)(bool)(offset);
  31. }
  32.  
  33. __int16 ReadInt16(int offset) {
  34.     return *(short*)(short)(offset);
  35. }
  36.  
  37. int ReadInt32(int offset) {
  38.     return *(int*)(int)(offset);
  39. }
  40.  
  41. _int64 ReadInt64(int offset) {
  42.     return *(long*)(long)(offset);
  43. }
  44.  
  45. byte ReadByte(int offset) {
  46.     return *(byte*)(byte)(offset);
  47. }
  48.  
  49. unsigned __int16 ReadUInt16(int offset) {
  50.     return *(unsigned short*)(unsigned short)(offset);
  51. }
  52.  
  53. unsigned int ReadUInt32(int offset) {
  54.     return *(unsigned int*)(unsigned int)(offset);
  55. }
  56.  
  57. unsigned __int64 ReadUInt64(int offset) {
  58.     return *(unsigned long*)(unsigned long)(offset);
  59. }
  60.  
  61. float ReadFloat(int offset) {
  62.     return *(float*)(float)(offset);
  63. }
  64.  
  65. double ReadDouble(int offset) {
  66.     return *(double*)(double)(offset);
  67. }
  68.  
  69. const char *ReadString(int offset) {
  70.     return *(const char*)(const char)(offset);
  71. }
  72.  
  73. void WriteBool(int offset, bool input) {
  74.     *(bool*)(offset) = (bool)input ? (byte)1 : (byte)0;
  75. }
  76.  
  77. void WriteInt16(int offset, short input) {
  78.     *(short*)(offset) = (short)input;
  79. }
  80.  
  81. void WriteInt32(int offset, int input) {
  82.     *(int*)(offset) = (int)input;
  83. }
  84.  
  85. void WriteInt64(int offset, long input) {
  86.     *(long*)(offset) = (long)input;
  87. }
  88.  
  89. void WriteByte(int offset, byte input) {
  90.     *(byte*)(offset) = (byte)input;
  91. }
  92.  
  93. void WriteUInt16(int offset, unsigned __int16 input) {
  94.     *(unsigned short*)(offset) = (unsigned short)input;
  95. }
  96.  
  97. void WriteUInt32(int offset, unsigned int input) {
  98.     *(unsigned int*)(offset) = (unsigned int)input;
  99. }
  100.  
  101. void WriteUInt64(int offset, unsigned __int64 input) {
  102.     *(unsigned long*)(offset) = (unsigned short)input;
  103. }
  104.  
  105. void WriteDouble(int offset, double input) {
  106.     *(double*)(offset) = (double)input;
  107. }
  108.  
  109. void WriteString(int offset, const char*input) {
  110.     strcpy((char*)(offset), input);
  111. }
  112.  
  113. void WriteFloat(int offset, float input) {
  114.     *(float*)(offset) = (float)input;
  115. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement