When compiling a project, I get the following error in ProcMem.h :

64 34 ... \ ProcMem.h [Error] no matching function for call to 'ProcMem :: iSizeOfArray (char * &)'

In the line int iSize = iSizeOfArray(Offset) - 1; with the following notes:

[Note] candidate is:
In file included from ProcMem.cpp

[Note] int ProcMem :: iSizeOfArray (int *)

[Note] no char * 'to' int * '

 #pragma region TEMPLATE MEMORY FUNCTIONS //REMOVE READ/WRITE PROTECTION template <class cData> void Protection(DWORD dwAddress) { if (!bProt) VirtualProtectEx(hProcess, (LPVOID)dwAddress, sizeof(cData), PAGE_EXECUTE_READWRITE, &dwProtection); //Remove Read/Write Protection By Giving It New Permissions else VirtualProtectEx(hProcess, (LPVOID)dwAddress, sizeof(cData), dwProtection, &dwProtection); //Restore The Old Permissions After You Have Red The dwAddress bProt = !bProt; } //READ MEMORY template <class cData> cData Read(DWORD dwAddress) { cData cRead; //Generic Variable To Store Data ReadProcessMemory(hProcess, (LPVOID)dwAddress, &cRead, sizeof(cData), NULL); //Win API - Reads Data At Specified Location return cRead; //Returns Value At Specified dwAddress } //READ MEMORY - Pointer template <class cData> cData Read(DWORD dwAddress, char *Offset, BOOL Type) { //Variables int iSize = iSizeOfArray(Offset) - 1; //Size Of *Array Of Offsets dwAddress = Read<DWORD>(dwAddress); //HEX VAL //Loop Through Each Offset & Store Hex Value (Address) for (int i = 0; i < iSize; i++) dwAddress = Read<DWORD>(dwAddress + Offset[i]); if (!Type) return dwAddress + Offset[iSize]; //FALSE - Return Address else return Read<cData>(dwAddress + Offset[iSize]); //TRUE - Return Value } // WRITE MEMORY template <class cData> void Write(DWORD dwAddress, cData Value) { WriteProcessMemory(hProcess, (LPVOID)dwAddress, &Value, sizeof(cData), NULL); } // WRITE MEMORY - Pointer template <class cData> void Write(DWORD dwAddress, char *Offset, cData Value) { Write<cData>(Read<cData>(dwAddress, Offset, false), Value); } // Base read template <typename TYPE> TYPE RPM(LPVOID lpBaseAddress, SIZE_T nSize) { TYPE data = TYPE(); ReadProcessMemory(hProcess, lpBaseAddress, &data, nSize, NULL); return data; } // Base write void WPM(LPVOID lpBaseAddress, LPCVOID lpBuffer, SIZE_T nSize) { WriteProcessMemory(hProcess, lpBaseAddress, lpBuffer, nSize, NULL); } // MEMORY FUNCTION PROTOTYPES virtual bool Process(char* ProcessName); // Return Handle To The Process virtual void Patch(DWORD dwAddress, char *chPatch_Bts, char *chDefault_Bts); // Write Bytes To Specified Address virtual void Inject(DWORD dwAddress, char *chInj_Bts, char *chDef_Bts, BOOL Type); // Jump To A Codecave And Write Memory virtual DWORD AOB_Scan(DWORD dwAddress, DWORD dwEnd, char *chPattern); // Find A Byte Pattern virtual bool Module(LPSTR ModuleName, DWORD &output); // Return Module Base Address 

How to be?

    1 answer 1

    The error message is clear enough.

    You have declared an iSizeOfArray function in a class or ProcMem namespace as

     int iSizeOfArray(int*); ^^^^^ 

    That is, its parameter is of type int * . However, you are trying to call it in a sentence

     int iSize = iSizeOfArray(Offset) - 1; ^^^^^^ 

    passing an object of type char * as an argument. See the declaration of the Read function.

     cData Read(DWORD dwAddress, char *Offset, BOOL Type) ^^^^^^^^^^^^ 

    There is no implicit conversion from type char * to type int * .

    You already understand the announcements of your functions. :)

    • char offset change to int offset? - Order_By
    • @Order_By you know better, because I don’t know what these functions do or how they are defined. :) - Vlad from Moscow
    • @Order_By If you have difficulty defining these functions, then you can ask a new question, for example, how to determine the iSizeOfArray function that should do this and that. :) Because with this question, that is, with a compiler error , we figured it out. - Vlad from Moscow
    • Replacing char Offset with int Offset led to a new error: [Error] 'nullptr' in return for nullptr; Change nullptr to NULL, and errors in ProcMem.h disappear. From the fire and into the fire, a new error appears but in another header — functions.h [Error] ld returned 1 exit status in the line enum Bones: int - Order_By
    • The error is NOT in the line enum Bones: int, it is not in the line at all. Error ... \ collect2.exe [Error] ld returned 1 exit status. What kind of beast collect2 is not clear, it is not there and should not be - Order_By