Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.73 KB | None | 0 0
  1. bool GWCA::SetCharacterName(string name)
  2. {  
  3.     char buf[256];
  4.     sprintf_s(charactername,255, "%s", name.c_str());
  5.     sprintf_s(buf,255, "GameRevision.com - %s", charactername);
  6.     this->gwHWND = FindWindowA(0, buf);
  7.     if((DWORD)this->gwHWND < 1)
  8.     {
  9.         return false;
  10.     }
  11.     char _PIPE_NAME[256];
  12.     GetWindowThreadProcessId(this->gwHWND,&this->PID);
  13.     this->hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, this->PID);
  14.     sprintf_s((char*)_PIPE_NAME, 40, "\\\\.\\pipe\\_%lu", this->PID);
  15.     this->hPIPE = CreateFileA(_PIPE_NAME, GENERIC_WRITE|GENERIC_READ ,0, 0, OPEN_EXISTING,0, 0);
  16.     return true;
  17. }
  18.  
  19. ///////////////////
  20.  
  21. #include "Main.h"
  22.  
  23. GWCA* api = new GWCA();
  24.  
  25. int main() {
  26.     api->SetCharacterName("Eden The Pure Soul");
  27.     api->MoveEx(0, 0);
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement