Show in-game notifications - by writing code

12/07/2017 12:28 florian0#1
Hello beloved, dead community,

i recently achieved something i want to share with you.

Video demonstration:
Behind the scenes: [Only registered and activated users can see links. Click Here To Register...]

Sending notifications by code

Code:
std::wstring mymessage(L"Hello World, epvp");

g_CGInterface->ShowMessage_GREEN(mymessage);
g_CGInterface->ShowMessage_BLUE(mymessage);
g_CGInterface->ShowMessage_PINK(mymessage);
The code behind the magic

Code:
// Header

class CGInterface {
	void ShowMessage_BLUE(std::wstring &msg);
	void ShowMessage_PINK(std::wstring &msg);
	void ShowMessage_GREEN(std::wstring &msg);
}

#define g_CGInterface (*(CGInterface**)0x0110F80C)

// Code

void CGInterface::ShowMessage_BLUE(std::wstring& msg)
{
	reinterpret_cast<void (__thiscall *)(CGInterface*, std::wstring *)>(0x0077B580)(this, &msg);
}

void CGInterface::ShowMessage_PINK(std::wstring& msg)
{
	reinterpret_cast<void (__thiscall *)(CGInterface*, std::wstring *)>(0x00777BF0)(this, &msg);
}

void CGInterface::ShowMessage_GREEN(std::wstring& msg)
{
	reinterpret_cast<void (__thiscall *)(CGInterface*, std::wstring *)>(0x0077B5B0)(this, &msg);
}

Community Challenge
Check out the addresses, reconstruct the types and achieve a functioning code like this ;)
Code:
void CGInterface::ShowMessage_GREEN(std::wstring& msg)
{
	if (msg.length())
	{
		CIFNotify *notify = reinterpret_cast<CIFNotify*>(this->m_IFRegion_36C.GetByID(GDR_UPDATE_QUEST_INFO, 1));

		notify->ShowMessage(&msg);
	}
}
Important notes, as always
Microsoft STL will try to TROLL you. Be aware of that. Silkroad was BUILD on VC80 aka. Visual Studio 2005. Any newer compiler CAN AND WILL BREAK this code. Compiling on DEBUG will BREAK your code, no matter what you expected it to do. Always compile on RELEASE or you will find yourself wasting your valuable lifetime tracing BUG that wasn't even your fault (not that that would have happened to me ...)
12/30/2017 16:57 yair3d#2
Nice little jobs, dont stop :)
04/25/2018 11:28 SubZero**#3
can you give us the source code?
04/25/2018 12:03 florian0#4
Quote:
Originally Posted by Zoro.Sro View Post
can you give us the source code?
Uhm ... i don't understand ... what else do you need ... ?
04/25/2018 12:24 Devsome#5
Quote:
Originally Posted by florian0 View Post
Uhm ... i don't understand ... what else do you need ... ?
Man please, do you have full source code of sro? Need it fast, but can't code, so sry when I write you to help me out how to compile.
09/16/2018 23:44 florian0#6
Quote:
Originally Posted by Mervy505 View Post
lol good

can give me please source code ?
:(
There is the source in the first post ...
09/17/2018 04:04 #HB#7
Quote:
Originally Posted by florian0 View Post
:(
There is the source in the first post ...
feelsbadman
09/17/2018 13:44 Ali Mohamed TS#8
anyone made a program for it ?
03/21/2019 06:11 hancook1st#9
why i got crash when call function ?
maybe addresses are different ! , how can get addresses from sro_client ?
03/21/2019 09:45 #HB#10
Quote:
Originally Posted by hancook1st View Post
why i got crash when call function ?
maybe addresses are different ! , how can get addresses from sro_client ?
Or your wstring structure doesn't fit.
03/21/2019 10:20 florian0#11
Quote:
Originally Posted by hancook1st View Post
why i got crash when call function ?
maybe addresses are different ! , how can get addresses from sro_client ?
The addresses are for vsro. Unless you are using MeGaMaX VSROMAX Clients, there is no way the addresses could have changed. If still in doubt, check the "behind the scenes" link. It explains how I made this.

And make sure that you haven't ignored this:

Important notes, as always
Microsoft STL will try to TROLL you. Be aware of that. Silkroad was BUILD on VC80 aka. Visual Studio 2005. Any newer compiler CAN AND WILL BREAK this code. Compiling on DEBUG will BREAK your code, no matter what you expected it to do. Always compile on RELEASE or you will find yourself wasting your valuable lifetime tracing BUG that wasn't even your fault (not that that would have happened to me ...)

I am dead serious about this and I'm getting increasingly annoyed by little know-it-alls trying other compilers without telling and then seeking help for problems they caused. /rant.
03/21/2019 15:19 hancook1st#12
Quote:
Originally Posted by florian0 View Post
The addresses are for vsro. Unless you are using MeGaMaX VSROMAX Clients, there is no way the addresses could have changed. If still in doubt, check the "behind the scenes" link. It explains how I made this.

And make sure that you haven't ignored this:

Important notes, as always
Microsoft STL will try to TROLL you. Be aware of that. Silkroad was BUILD on VC80 aka. Visual Studio 2005. Any newer compiler CAN AND WILL BREAK this code. Compiling on DEBUG will BREAK your code, no matter what you expected it to do. Always compile on RELEASE or you will find yourself wasting your valuable lifetime tracing BUG that wasn't even your fault (not that that would have happened to me ...)

I am dead serious about this and I'm getting increasingly annoyed by little know-it-alls trying other compilers without telling and then seeking help for problems they caused. /rant.
Sorry my bad.
I'm using vsro files
I compiled it on Release but by VS2010 and VS2015
Any solution to make code working on newer compiler ?
03/21/2019 17:10 florian0#13
Quote:
Originally Posted by hancook1st View Post
Sorry my bad.
I'm using vsro files
I compiled it on Release but by VS2010 and VS2015
Any solution to make code working on newer compiler ?
No. Trust me, I'm not an idiot. I wouldn't stick to that compiler if it would be avoidable. This project is meant to be binary compatible and therefore a newer compiler and stdlib will not be easy. The most promising solution is to just rewrite/reuse the old stdlib, but I'm not going to support that. It will probably create bigger problems than it solves.
03/21/2019 18:49 hancook1st#14
Quote:
Originally Posted by florian0 View Post
No. Trust me, I'm not an idiot. I wouldn't stick to that compiler if it would be avoidable. This project is meant to be binary compatible and therefore a newer compiler and stdlib will not be easy. The most promising solution is to just rewrite/reuse the old stdlib, but I'm not going to support that. It will probably create bigger problems than it solves.
Okey thanks alot
11/14/2019 11:21 Laag#82#15
Special thanks to: florian0

[Only registered and activated users can see links. Click Here To Register...]