I'm trying to call a function in a game that makes my character sending a message.
I already called a few functions in this game but this one has a tricky parameter.
The function signature should be similar to this:
void Game::talkChannel(Otc::MessageMode mode, int channelId, const std::string& message)
This is how I define it:
typedef DWORD(__thiscall* _talkChannel)(DWORD localplayer, uintptr_t mode, uintptr_t channelId, const std::string& message);
_talkChannel talkChannel;
talkChannel = (_talkChannel)(moduleBase + 0x79340);
This is how I call it:
talkChannel(LocalPlayer, 1, 0, "test");
Here's how the function looks normally:
And this is how it looks if I call it from my dll:
As you can see it doesn't looks the same, and the result in game is my character sending this message:
`ï¶test
So as I can see it will fill the message until 8 characters, and if I send more than 8 characters it won't send any message.
Trying to send as a const char *
made me explode my brain because it looks exactly the same as the original function call:
But nothing happens ingame, no message is sent, even the call looks identical to me in debugger...
How should I call that function with this tricky parameter?
EDIT:
Calling as const wchar_t* didn't work, but it's fun to see how it differs in debugger: