I have a problem building my program:
prototype for int SROMemory :: ReadString (unsigned int) does not match any SROMemory class
What's happening?
Here is a link to my Dev C ++ project: https://www.sendspace.com/file/uop8m8
#include "memory.h"
SROMemory::SROMemory()
{
GetWindowThreadProcessId(FindWindow(NULL, (LPCSTR)TEXT("Tibia")), &PROC_ID);
PROC_HANDLE = OpenProcess(0x10, false, PROC_ID);
}
int SROMemory::ReadString(unsigned int Pointer)
{
char cValue[24] = "\0";
ReadProcessMemory(PROC_HANDLE, (LPVOID)Pointer, &cValue, sizeof(cValue), NULL);
string Value = cValue;
return Value;
}
this is main.cpp:
#include <iostream>
#include "memory.h"
using namespace std;
int main(void)
{
bool exit = false;
SROMemory Memory;
string loginPass = Memory.ReadString(0x78F554);
cout << "LoginPass: " << loginPass << "\n";
do
{
}while(!exit);
}
and this is memory.cpp:
#include "memory.h"
SROMemory::SROMemory()
{
GetWindowThreadProcessId(FindWindow(NULL, (LPCSTR)TEXT("Tibia")), &PROC_ID);
PROC_HANDLE = OpenProcess(0x10, false, PROC_ID);
}
int SROMemory::ReadString(unsigned int Pointer)
{
char cValue[24] = "\0";
ReadProcessMemory(PROC_HANDLE, (LPVOID)Pointer, &cValue, sizeof(cValue), NULL);
string Value = cValue;
return Value;
}
Yup and I forgot about memory.h:
#include <iostream>
#include <string>
#include <stdio.h>
#include <stdlib.h>
#include <Windows.h>
using namespace std;
class SROMemory
{
public:
SROMemory();
int ReadPointer(unsigned int Pointer);
int ReadOffset(unsigned int Offset);
string ReadString(unsigned int Pointer);
private:
DWORD PROC_ID;
HANDLE PROC_HANDLE;
};
source
share