Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Windows.h>
- #include <stdint.h>
- typedef void(__thiscall* tPrintChatMessage)(uint32_t, LPCSTR, LPCSTR, uint8_t, bool, bool, uint8_t);
- tPrintChatMessage oPrintChatMessage;
- class CChat
- {
- public:
- enum Type : uint8_t
- {
- NORMAL = 0,
- HELP = 1,
- WHISPER = 2,
- TEAM = 5,
- INFO = 10,
- GM = 11,
- TIP = 12
- };
- enum Color : uint8_t
- {
- NONE = 0,
- PINK = 1,
- YELLOW = 2,
- GREEN = 4
- };
- static void __stdcall CChat::PrintChatMessage(LPCSTR lpText, LPCSTR lpName, uint8_t uiType, bool bShow, bool bRegGameMode, uint8_t uiColor);
- };
- void __stdcall CChat::PrintChatMessage(LPCSTR lpText, LPCSTR lpName, uint8_t uiType, bool bShow, bool bRegGameMode, uint8_t uiColor)
- {
- uint32_t getinstance = *reinterpret_cast<uint32_t*>(0x005A6220);
- uint32_t _this = *reinterpret_cast<uint32_t*>(0x011B95A8);
- uint32_t thisptr;
- _asm
- {
- mov ecx, _this
- mov eax, getinstance
- call eax
- mov thisptr, eax
- }
- //uint32_t thisptr = *reinterpret_cast<uint32_t*>(0x011B95A8 + 0x108); //This can also be used, see GetInstance function to see what I mean
- return oPrintChatMessage(thisptr, lpText, lpName, uiType, bShow, bRegGameMode, uiColor);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement