I've got problem while compilling my program:
prototype for int SROMemory::ReadString(unsigned int) does not match any in class SROMemory
Whats going on?
Here's 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;
};
the function signature (in the source file) doesn't match the signature of the prototype (declaration in header): change the following line in your source file:
int SROMemory::ReadString(unsigned int Pointer)
to
string SROMemory::ReadString(unsigned int Pointer)
another possibility according to Prototype... does not match any in Class... (error). g++ is, that your source file includes the wrong header file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With