[R\E] Accessing Outer Interface's Messages & Doing Mini-Sounds

01/19/2019 23:42 #HB#1
Hey folks,

I've started doing reverse engineering stuff a while ago, I've done some things that I can share with you.


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

A video if you want to hear the sound: [Only registered and activated users can see links. Click Here To Register...]

(sorry for that weird noise, also the sh** quality)


Let's start with the outer interface side.

CPSOuterInterface, Functions To Use:
Code:
class CPSOuterInterface
{
public:
	static CPSOuterInterface* GetOuterInterface();
	void WriteMessage(CPSOuterInterface* obj, const wchar_t* message, unsigned int color);
};
A single function does show the messages, with the 2 arguments that most of us only need, the message and the color.


CPSOuterInterface, Functions, Inner Code:

We can find these by tracing anything in-game messages that might represent to this function. I used the normal login message, "Requesting User Confirmation". After we find the function, we can see 2 arguments pushed which are the message and the color and "ECX" touched right before the call.

Since "this" memory address is dynamic, we have to find a pointer/function to get to it. There's already a pointer for it. And here comes the Cheat Engine. We found it, it's "0xEECEA4".

Now we can write a clean code:
Code:
CPSOuterInterface* CPSOuterInterface::GetOuterInterface()
{
	return *reinterpret_cast<CPSOuterInterface**>(0xEECEA4);
}

void CPSOuterInterface::WriteMessage(const wchar_t* message, unsigned int color)
{
	reinterpret_cast<void(__thiscall*)(CPSOuterInterface*, const wchar_t*, unsigned int)>(0x008613B0)(this, message, color);
}
That we can implement easily just like:
Code:
CPSOuterInterface::GetOuterInterface()->WriteMessage(L"Hello World!", D3DCOLOR_ARGB(255, 76, 255, 0));


Let's finish with the sound body.

CGEffSoundBody, Functions To Use:
Code:
class CGEffSoundBody
{
public:
	CGEffSoundBody* GetSoundBody();
	void DoSound(CGEffSoundBody* obj, const wchar_t* code);
};
A single function too does sounds, with the only 1 argument.

CGEffSoundBody, Functions, Inner Code:

Same thing as I said above since both functions are quite easy to find. Tracing, Debugging, Analyzing, Coding. "this" is dynamic, Cheat Engine, pointer found, coding time.
Code:
CGEffSoundBody* CGEffSoundBody::GetSoundBody()
{
	CGEffSoundBody* body = *reinterpret_cast<CGEffSoundBody**>(0x0110AAD8);
	return body;
}

void CGEffSoundBody::DoSound(const wchar_t* code)
{
	reinterpret_cast<void(__thiscall*)(CGEffSoundBody*, const wchar_t*)>(0x00A72D40)(this, code);
}
The function requires a sound code, you can see a bunch of codes with a debugger by tracing this function's calls. For example, "snd_quest" is the one that you hear when select your character. So, we can do this:
Code:
CGEffSoundBody::GetSoundBody()->DoSound(L"snd_quest");

License:
We're hacking and talking about license?!


Thanks:
  • florian0 :rolleyes: (unfortunately there's no love emojis here)

Finalization:
Hope you won't just copy paste this into your project files, try to understand how things go. Good luck.
01/20/2019 06:46 Zyeno#2
good work
01/20/2019 11:17 paradise1992#3
Why ?

[Only registered and activated users can see links. Click Here To Register...]
01/20/2019 14:00 #HB#4
Quote:
Originally Posted by paradise1992 View Post
Why ?

[Only registered and activated users can see links. Click Here To Register...]
Your image isn't working BTW.
10/24/2019 00:11 #HB#5
Quote:
Originally Posted by Frukio92 View Post
@[Only registered and activated users can see links. Click Here To Register...]

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

how i can fix it?

incomplete shared
Yeah, add this func in CPSOuterInterface, I forgot to add in the topic:
Code:
static CPSOuterInterface* GetOuterInterface();
10/24/2019 11:24 #HB#6
Quote:
Originally Posted by Frukio92 View Post
@[Only registered and activated users can see links. Click Here To Register...] Which trigger packet should it work for?

i was try this packet A106 but i dont see any green message

mini sound function = working

interface msg = not working

:D
First, you don't have to mention me each time you reply ;D

And about your topic, you can trigger it on login packet sending, just look for this string "UIO_MSG_ERROR_CITATION" and hook the beginning of the func that this string is existing at. You can also hook a couple of places in CPSTitle, like after creation.
11/09/2019 00:05 Laag#82#7
Hello #HB

You can add Functions change color to version and change messages

[Only registered and activated users can see links. Click Here To Register...]
11/09/2019 01:41 #HB#8
Quote:
Originally Posted by khaleed2010 View Post
Hello #HB

You can add Functions change color to version and change messages
Well, honestly I don't have much time lately, I'll see if I had some free time.

Afair, [Only registered and activated users can see links. Click Here To Register...] contains that though.