WanKapef Posted July 25, 2012 Report Share Posted July 25, 2012 #include <stdio.h> #include <windows.h> #include <string.h> #include <stdlib.h> #pragma comment(lib, "user32.lib") int main() { HWND hWindow; DWORD dwPID; HANDLE hProcess; LPVOID lpAddress = (LPVOID)0xA6CF9C; //Pointer LPVOID lpBufferAddress = (LPVOID)0X0; //Address do pointer LPVOID lpNewAddress = (LPVOID)0x0; //Address+offset = address verdadeiro LPVOID Offset = (LPVOID)0x3F6; //Offset //Lê o address contido no pointer hWindow = FindWindow(0,"Point Blank"); GetWindowThreadProcessId(hWindow, &dwPID); hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwPID); ReadProcessMemory(hProcess, lpAddress, &lpBufferAddress, sizeof(lpBufferAddress), NULL); //Acha o novo address lpNewAddress = lpBufferAddress + Offset; //lpBufferAddress + 3F6 system("pause"); return 0; }Como fazer para somar o conteudo de lpBufferAddress com o offset? alguma solução? Quote Link to comment Share on other sites More sharing options...
0 Marcelo Utikawa da Fonseca Posted July 26, 2012 Report Share Posted July 26, 2012 Um endereço é um número. Porém não é possível fazer a soma diretamente pois não é suportado por LPVOID.Assim, basta converter para um valor numérico, fazer a soma e converter novamente para LPVOID:lpNewAddress = (LPVOID)((unsigned int)lpBufferAddress + (unsigned int)Offset); Quote Link to comment Share on other sites More sharing options...
Question
WanKapef
Como fazer para somar o conteudo de lpBufferAddress com o offset? alguma solução?
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.