Calling function by typecast

Grab

Member
Joined
Feb 25, 2015
Messages
17
Reaction score
1
Hey guys,

failing to call the sendchat function with typecast.
Someone got a solution?
Code:
typedef int(_cdecl * AddChatMessage_t)(DWORD dwColor, char * szText, ...);
AddChatMessage_t AddMsg;

DWORD Address = Function.ModuleAddr[0] + 0x61FC0;
AddMsg = (AddChatMessage_t)Address;


AddMsg(0xffffff, "Test");
 

T3KTONIT

Well-known member
Joined
Sep 2, 2013
Messages
308
Reaction score
5
are you sure that the function's calling convention is __cdecl and not __stdcall or others... ?

also i think the parameters are wrong... (DWORD dwColor, char * szText, ...);
 

Grab

Member
Joined
Feb 25, 2015
Messages
17
Reaction score
1
Ye, i'd took a look with ida and it is cdecl.

Also changed the typecast params.

http://gyazo.com/a75d8b005a27a6b4657e3dd869bcad80

still not working, but as you see the function is called.
 
Top