sendcmd v sendsay

BBB

Active member
Joined
Apr 5, 2013
Messages
62
Reaction score
1
hi,
I'm trying to figure out how to take this sobeit function into my project
its 0.3x r1 but it doesnt matter because I just want to learn that

Code:
#define FUNC_SAY		0x4DD0
#define FUNC_SENDCMD	0x7AA50
void addSayToChatWindow ( char *msg )
{
	if ( g_SAMP == NULL )
		return;

	if ( msg == NULL )
		return;
	if ( isBadPtr_readAny(msg, 128) )
		return;
	traceLastFunc( "addSayToChatWindow()" );

	if ( msg[0] == '/' )
	{
		uint32_t	func = g_dwSAMP_Addr + FUNC_SENDCMD;
		__asm push msg
		__asm call func
	}
	else
	{
		uint32_t	func = g_dwSAMP_Addr + FUNC_SAY;
		void		*lpPtr = g_Players->pLocalPlayer;
		__asm mov ebx, dword ptr[lpPtr]
		__asm push msg
		__asm call func
		__asm pop ebx
	}
}

the function addressess are easy to find but I dont know how to deal with this "g_Players->pLocalPlayer"  :bawww:
 

0x_

Wtf I'm not new....
Administrator
Joined
Feb 18, 2013
Messages
1,116
Reaction score
167
Output the g_Players & g_Players->pLocalPlayer Address.
Take them and make a Pointer Scan in CE.
 

BBB

Active member
Joined
Apr 5, 2013
Messages
62
Reaction score
1
I've found an address the messege shows up but I get some stack error -wtf
I had once a similar error when c&p from sobeit then I did this
Code:
		__asm mov ebx, dword ptr[lpPtr]
		__asm push msg
		__asm call func
		//__asm pop ebx

and now it works :surprised:
 

0x_

Wtf I'm not new....
Administrator
Joined
Feb 18, 2013
Messages
1,116
Reaction score
167
BBB link said:
I've found an address the messege shows up but I get some stack error -wtf
I had once a similar error when c&p from sobeit then I did this
Code:
		__asm mov ebx, dword ptr[lpPtr]
		__asm push msg
		__asm call func
		//__asm pop ebx

and now it works :surprised:

Then theres something bad P:
Your current Code can cause an stack- corruption trough the whole Code.

But also, you should know that there are more funcs to "say" something in the chat you dont need to use this specific one.
 
Top