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:

enter image description here

And this is how it looks if I call it from my dll:

enter image description here

As you can see it doesn't looks the same, and the result in game is my character sending this message:


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:

enter image description here

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?


Calling as const wchar_t* didn't work, but it's fun to see how it differs in debugger:

enter image description here

1 Answer 1


At the end I just had to compile as Release.

Thanks to this information:


So it's just a compiler difference

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.