Postado Setembro 30, 2015 9 anos Já havia feito isso em pascal, agora que estou programando em c++ refiz o código, utilizei como estudo este link. Código: #include <windows.h> #include <iostream> #include <TlHelp32.h> using namespace std; void RM(uintptr_t *result, uintptr_t address); //Função para obter o valor do endereço base void RD(double *result, uintptr_t offset, uintptr_t base); //Função para obter os valores int main(){ //Variaveis uintptr_t baseaddress, offset, addr; double PlayerHP, PokemonHP, PlayerLevel, PlayerExp, PlayerMaxHP; addr = 0x006C53C0; //Endereço base RM(&baseaddress, addr); //Obtem o valor do endereço base para a soma RD(&PlayerHP, 0x348, baseaddress); //Define a HP do player RD(&PlayerMaxHP, 0x350, baseaddress); //Define a HP máxima do player RD(&PokemonHP, 0x380, baseaddress); //Define a HP do pokemon RD(&PlayerLevel, 0x370, baseaddress); //Define o Level do player RD(&PlayerExp, 0x368, baseaddress); //Define a exp atual do player //Escreve na tela os valores cout << "Player HP: " << PlayerHP << "/" << PlayerMaxHP << "\n"; cout << "Player Exp: " << PlayerExp << "\n"; cout << "Player Level: " << PlayerLevel << "\n"; cout << "Pokemon HP: " << PokemonHP << "\n"; system("pause"); return 0; } void RM(uintptr_t *result, uintptr_t address){ int y; HWND h = NULL; DWORD pid; cout << "Searching PXG Client..." << "\n"; while (h == NULL) { h = FindWindow(NULL, "PXG Client"); Sleep(1000); } cout << "PXG Client found!" << "\n"; GetWindowThreadProcessId(h, &pid); HANDLE proc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid); ReadProcessMemory(proc, (LPCVOID)address, &y, 8, NULL); *result = y; } void RD(double *result, uintptr_t offset, uintptr_t base){ uintptr_t address = base + offset; double y; HWND h = NULL; DWORD pid; while (h == NULL) { h = FindWindow(NULL, "PXG Client"); Sleep(100); } GetWindowThreadProcessId(h, &pid); HANDLE proc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid); ReadProcessMemory(proc, (LPCVOID)address, &y, 8, NULL); *result = y; } Qualquer dúvida só deixar nos comentarios. Fonte: Link Editado Setembro 30, 2015 9 anos por alfbru (veja o histórico de edições) http://balfprogramador.blogspot.comhttp://mynameisbalf.blogspot.com
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.