(ASM) Nostale Send Function

11/09/2013 19:09 EasyTale#16
Dude, a const string (not the string from the std library) is passed in edx.
But if you just pass an char pointer, the client doesn't know the size, so the client is going to fu*k up.
Look at the dump how the string is structured and rebuild the structure.
11/09/2013 19:47 Sm•ke#17
Oh guys ! now work !!

Code:
class NTString
{
public:
	DWORD length;
	char command[256];
	
	NTString(char *string)
	{
		length = strlen(string);
		memcpy(command, string, length);
		command[length] = 0;
	}
};
Send Function

Code:
void SEND_TO_SERVER(char *packet)
{
	__asm
	{
		MOV EAX, DWORD PTR DS:[SEND_EAX]
		MOV EAX, DWORD PTR DS:[EAX]
		MOV EAX, DWORD PTR DS:[EAX]
		MOV EDX, packet
		CALL SEND_ADDR
	}
}
how to use:

Code:
NTString str("c_skill");
SEND_TO_SERVER(str.command);
Thanks to all even if i solved alone ! :)