Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. #include <Windows.h>
  2. #include <stdint.h>
  3. typedef void(__thiscall* tPrintChatMessage)(uint32_t, LPCSTR, LPCSTR, uint8_t, bool, bool, uint8_t);
  4.  
  5. tPrintChatMessage oPrintChatMessage;
  6.  
  7. class CChat
  8. {
  9. public:
  10. enum Type : uint8_t
  11. {
  12. NORMAL = 0,
  13. HELP = 1,
  14. WHISPER = 2,
  15. TEAM = 5,
  16. INFO = 10,
  17. GM = 11,
  18. TIP = 12
  19. };
  20.  
  21. enum Color : uint8_t
  22. {
  23. NONE = 0,
  24. PINK = 1,
  25. YELLOW = 2,
  26. GREEN = 4
  27. };
  28.  
  29. static void __stdcall CChat::PrintChatMessage(LPCSTR lpText, LPCSTR lpName, uint8_t uiType, bool bShow, bool bRegGameMode, uint8_t uiColor);
  30.  
  31. };
  32.  
  33. void __stdcall CChat::PrintChatMessage(LPCSTR lpText, LPCSTR lpName, uint8_t uiType, bool bShow, bool bRegGameMode, uint8_t uiColor)
  34. {
  35. uint32_t getinstance = *reinterpret_cast<uint32_t*>(0x005A6220);
  36. uint32_t _this = *reinterpret_cast<uint32_t*>(0x011B95A8);
  37. uint32_t thisptr;
  38. _asm
  39. {
  40. mov ecx, _this
  41. mov eax, getinstance
  42. call eax
  43. mov thisptr, eax
  44. }
  45.  
  46. //uint32_t thisptr = *reinterpret_cast<uint32_t*>(0x011B95A8 + 0x108); //This can also be used, see GetInstance function to see what I mean
  47. return oPrintChatMessage(thisptr, lpText, lpName, uiType, bShow, bRegGameMode, uiColor);
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement