Change color name via Dll

03/24/2019 01:53 hancook1st#1
i'm trying to change color name via dll , but always client crash
any solution ?
i used this code in dll

PHP Code:
const DWORD dwWriteChatFN 0x009D026C;
void chathelp::ColorName(uint32_t color)
{
    
//equal to
    //mov ecx, dword ptr ds:[0x110f80c]
    
void_ecx memhelp::RefPtr<void*>(0x110F80C);
    
__asm
    
{
        
mov ecx_ecx;
        
push color;
        
call dwWriteChatFN;
    }

03/24/2019 11:11 florian0#2
[Only registered and activated users can see links. Click Here To Register...]
Well ... the location you are calling is ... "suboptimal".
  1. You calling inside another function. Functions are build to be executed as a whole, not partially.
  2. the value of ECX is immediatly overwritten by the code you are calling.
  3. UpdateColor, the function you see at my screen, is for entities. So even if ECX would work in this case, 0x110F80C is still the wrong address as it is the address of the main ui and an entity.
03/24/2019 11:58 #HB#3
flory already explained everything. But remember that you're using "__asm", so the function must be "naked".

However, if you implemented the function, that function is called like every 1 ~ 2 secs, it should be called with CICPlayer::OnRender, so if you edit the color for a sec, you will see it getting back to usual color again immediately after.

So, if you want to have a permanent color change, you can hook the function and edit the color before calling the main function or just look into that UpdateColor function and see what it does :D
03/24/2019 12:57 florian0#4
Quote:
Originally Posted by #HB View Post
remember that you're using "__asm", so the function must be "naked".
__asm and naked do not correlate. Naked just means that there will be no prolog and epilog generated. You can still use __asm in non-naked functions. His example should work fine without, if the addresses were correct.
03/24/2019 14:10 hancook1st#5
Quote:
Originally Posted by florian0 View Post
[Only registered and activated users can see links. Click Here To Register...]
Well ... the location you are calling is ... "suboptimal".
  1. You calling inside another function. Functions are build to be executed as a whole, not partially.
  2. the value of ECX is immediatly overwritten by the code you are calling.
  3. UpdateColor, the function you see at my screen, is for entities. So even if ECX would work in this case, 0x110F80C is still the wrong address as it is the address of the main ui and an entity.
Thanks for helping me.
i changed address but client always got crash .
PHP Code:
const DWORD UpdateColor 0x009D026E;
void chathelp::ColorName(uint32_t color)
{
    
void_ecx memhelp::RefPtr<void*>(0x009D026C);
    
__asm
    
{
        
mov ecx_ecx;
        
push 0x00FF00// new color
        
call UpdateColor;
    }

03/24/2019 19:08 florian0#6
Quote:
Originally Posted by hancook1st View Post
Thanks for helping me.
i changed address but client always got crash .
My post did not contain the solution. I only showed whats wrong. The whole call destination is wrong in the first place. You can only "call" to the first address of a function, not in between. You can call UpdateColor directly. It is meant to change the text color of the entity name. In order to call that, you need to get the address of the entity. For your own player, its 0x00EEF5EC. You need to find the addresses of other players if you want to change other player's color aswell. HB gave the hint to hook CICPlayer::OnRender, which is at 0x009D87C0.
03/25/2019 00:59 hancook1st#7
Quote:
Originally Posted by florian0 View Post
My post did not contain the solution. I only showed whats wrong. The whole call destination is wrong in the first place. You can only "call" to the first address of a function, not in between. You can call UpdateColor directly. It is meant to change the text color of the entity name. In order to call that, you need to get the address of the entity. For your own player, its 0x00EEF5EC. You need to find the addresses of other players if you want to change other player's color aswell. HB gave the hint to hook CICPlayer::OnRender, which is at 0x009D87C0.
OKey thanks for help
08/18/2019 14:22 T0o0P#8
need code dll file :/
08/18/2019 19:17 paradise1992#9
01/26/2020 00:44 Empire1453#10
Can job names be colored? would be interesting: D
01/26/2020 11:28 florian0#11
Quote:
Originally Posted by Empire1453 View Post
Can job names be colored? would be interesting: D
Should be possible. Isn't the opponent job already colored in red (Thief <-> Hunter, Trader)? You can probably use that location to insert more job specific colors.
01/31/2020 02:50 sarkoplata#12
Quote:
Originally Posted by florian0 View Post
Should be possible. Isn't the opponent job already colored in red (Thief <-> Hunter, Trader)? You can probably use that location to insert more job specific colors.
It is. The UpdateColor function is called from somewhere else if the user is in Job Mode.

Func43 @ CICPlayer return the Job Mode. 1/2/3 is trader/thief/hunter, 4 = no job.
07/01/2020 06:03 xTomasky#13
Quote:
Originally Posted by florian0 View Post
[Only registered and activated users can see links. Click Here To Register...]
Well ... the location you are calling is ... "suboptimal".
  1. You calling inside another function. Functions are build to be executed as a whole, not partially.
  2. the value of ECX is immediatly overwritten by the code you are calling.
  3. UpdateColor, the function you see at my screen, is for entities. So even if ECX would work in this case, 0x110F80C is still the wrong address as it is the address of the main ui and an entity.
thanks so much
07/01/2020 21:05 Faaruk#14
works perfectly thanks