Hi,
Currently working on a C++ dll for wow. Right now I have a static class to call functions like click-to-move and want to know how to deal with calling doString from here.
My doString hook looks like this. Currently set 'NEXT_COMMAND' and 'ARGUMENT' to run macros/get cool downs. This works in main BUT I cant put it my functions class because its not static. (I cant get the function pointer of a non-static member to pass to msdetours to make the code run)
Code:
int __fastcall mainThreadFunction()
{
if (NEXT_COMMAND != EMPTY){
originalDoString(NEXT_COMMAND.c_str(), " ");
if (ARGUMENT != EMPTY){
getText(argument.c_str());
}
NEXT_COMMAND = EMPTY;
ARGUMENT = EMPTY;
}
return originalFunction;
}
Right now it works in main.cpp (where I set it up to test it) but it's obviously messy and going to cause problems later. If I want to have doString run outside of main I need to pass the location of NEXT_COMMAND and write directly to memory, is there an easier way to go about this?