Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Silkroad Online > SRO Coding Corner
You last visited: Today at 18:07

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



About Global Color after use get Confirm

Discussion on About Global Color after use get Confirm within the SRO Coding Corner forum part of the Silkroad Online category.

Reply
 
Old   #1
 
Exner.'s Avatar
 
elite*gold: 5
Join Date: Jul 2020
Posts: 183
Received Thanks: 54
About Global Color after use get Confirm

About Global Color after use get disconnected *
SRO_DevKit
global color It became the normal thing there is a lot who did this and there is a lot of dll about this thing, and we would have wanted to do this in the source If there is someone who has a better code than this, does not skimp to share and thank you

Code:
#include "globalcolors.h"
#include "memhelp.h"
#include "chathelp.h"


std::vector<tGlobalIdColorPair> globalcolors::m_data;

const DWORD dwHookAddr = 0x0087703A; //we need EAX
const DWORD dwHookJmpback = 0x0087704C; // 0x00877046;

const DWORD dwHookMsgSend = 0x00790287;
const DWORD dwHookMsgSendJumpback = 0x007902A1;

const DWORD wOpcodeForEventGlobal = 0x1333;
const DWORD wOpcodeForNormalGlobal = 0x1334;

const WORD wEventGlobalRefItemID = 35592 + 1; //+1 from db
const WORD wNormalGlobalRefItemID = 3851 + 1; //+1 from db

//const DWORD dwJumpSendIfEq1= 0x0079035D; see __asm
const DWORD dwHookSendCall1 = 0x00841780; //call sro_clie.0x00841780

DWORD dwIsEvent = 0;

//nop 9 bytes, emulate movzx eax, byte
//movzx eax, byte ptr ss:[esp+230] == msg type (will spoof)


void globalcolors::AssignColorToId(uint8_t id, DWORD color)
{
    m_data.push_back(tGlobalIdColorPair(id, color));
}


wchar_t* msgBuf;
void HandleCustomGlobalMsg()
{
    std::wcout << msgBuf << std::endl;
    std::cout << wcslen(msgBuf) << std::endl;


    int lastIndex = wcslen(msgBuf) - 1;
    DWORD color = globalcolors::GetColorByType(msgBuf[lastIndex]);

    msgBuf[lastIndex] = 0x00;

}

DWORD globalcolors::GetColorByType(uint8_t id)
{
    DWORD res = 0;
    for(std::vector<tGlobalIdColorPair>::iterator iter = m_data.begin(); iter != m_data.end(); iter++)
    {
        if(iter->first == id)
        {
            res = iter->second;
            break;
        }
    }
    return res;
}

__declspec(naked) void globalcolors::OnGlobalMsg()
{
    __asm
    {
    mov msgBuf, eax;

    pushad;
    call HandleCustomGlobalMsg;
    popad;

    movzx eax, byte ptr ss:[esp+0x230];


    //add esp, 0x8;
    jmp dwHookJmpback;
    }

    }

    __declspec(naked) void ExecEvent()
    {
        __asm pop eax;

        __asm push wOpcodeForEventGlobal;
        __asm call dwHookSendCall1;
        __asm add esp, 8;
        __asm test eax, eax;
        __asm je 0x0079035D;
        __asm push wOpcodeForEventGlobal;
        __asm jmp dwHookMsgSendJumpback;
    }

    __declspec(naked) void ExecNormal()
    {
        __asm pop eax;

        __asm push wOpcodeForNormalGlobal;
        __asm call dwHookSendCall1;
        __asm add esp, 8;
        __asm test eax, eax;
        __asm je 0x0079035D;
        __asm push wOpcodeForNormalGlobal;
        __asm jmp dwHookMsgSendJumpback;
    }

    __declspec(naked) void OnGlobalItemUsed()
    {
        __asm push eax;
        __asm mov ax, ss : [esp - 0x24];
        __asm cmp ax, wEventGlobalRefItemID;

        __asm je ExecEvent;
        __asm jmp ExecNormal;
    }


    void globalcolors::Initialize()
    {
        memhelp::RenderNop((void*)dwHookAddr, 9);
        memhelp::RenderDetour(ASM_JMP, (void*)dwHookAddr, globalcolors::OnGlobalMsg);

        memhelp::RenderNop((void*)dwHookMsgSend, 26);
        memhelp::RenderDetour(ASM_JMP, (void*)dwHookMsgSend, OnGlobalItemUsed);
    }
Code:
#pragma once
#include "xlib.h"

typedef std::pair<uint8_t, DWORD> tGlobalIdColorPair;


class globalcolors
{
public:
    static void Initialize();
    static void AssignColorToId(uint8_t id, DWORD color);
    static DWORD GetColorByType(uint8_t id);

private:
    //__declspec(naked)
    static void OnGlobalMsg();

    static std::vector<tGlobalIdColorPair> m_data;

};
Code:
        globalcolors::Initialize();
        globalcolors::AssignColorToId(0x01, 0xFF33FF33);
        globalcolors::AssignColorToId(0x02, 0xFF669911);
Is there anyone who helps about this
Exner. is offline  
Old 01/31/2021, 04:00   #2
 
ryaneichner's Avatar
 
elite*gold: 0
Join Date: Oct 2014
Posts: 172
Received Thanks: 38
Thumbs up

Hello sir.

Well I don't know how to help you because I'm a newbie but this code also leaves the normal chat with black color and the last letter of the phrase / word invisible, specify this in the topic too so that someone helps us this code is good, just a little missing correction
ryaneichner is offline  
Old 01/31/2021, 06:58   #3
 
JellyBitz's Avatar
 
elite*gold: 0
Join Date: Sep 2018
Posts: 419
Received Thanks: 941
Quote:
Originally Posted by ryaneichner View Post
... this code also leaves the normal chat with black color and the last letter of the phrase / word invisible ...
It's because...

PHP Code:
DWORD globalcolors::GetColorByType(uint8_t id)
{
    
DWORD res 0// DEFAULT COLOR (BLACK)
    
....

And seems like the code is editing the last byte to set the color id, that means your maximum will be 256 color id availables and you'll lost the last letter.
JellyBitz is offline  
Thanks
1 User
Old 01/31/2021, 10:45   #4
 
LegendarySouL's Avatar
 
elite*gold: 0
Join Date: Nov 2020
Posts: 170
Received Thanks: 61
This source does not support help because the person who created it does not want help
LegendarySouL is offline  
Old 02/01/2021, 00:47   #5
 
ryaneichner's Avatar
 
elite*gold: 0
Join Date: Oct 2014
Posts: 172
Received Thanks: 38
Thumbs up hello sir

Quote:
Originally Posted by JellyBitz View Post
It's because...

PHP Code:
DWORD globalcolors::GetColorByType(uint8_t id)
{
    
DWORD res 0// DEFAULT COLOR (BLACK)
    
....

And seems like the code is editing the last byte to set the color id, that means your maximum will be 256 color id availables and you'll lost the last letter.
you know how we can fix it, and add fix dc when use global color's ?

thanks for your help!
ryaneichner is offline  
Old 02/01/2021, 01:39   #6
 
GameRPoP's Avatar
 
elite*gold: 0
Join Date: Sep 2020
Posts: 122
Received Thanks: 64
You can do it more easily with filter control. Thus, you can determine the color you want according to itemIDs.

GameRPoP is offline  
Thanks
1 User
Old 02/01/2021, 02:02   #7
 
ryaneichner's Avatar
 
elite*gold: 0
Join Date: Oct 2014
Posts: 172
Received Thanks: 38
Thumbs up Thanks for your coment!

Quote:
Originally Posted by GameRPoP View Post
You can do it more easily with filter control. Thus, you can determine the color you want according to itemIDs.

yeah i know but we don't have source codes and i don't have any filter source coded by me or one source working fine to edit, i'm using a open source filter but i can't know how extract it or edit it, athena filter source have alot bug's, and kryfilter have bug in dll HWID

maybe we can try add from dll this codes for me will work fine, if you can help we are thank you to it !

sorry for bad english.
ryaneichner is offline  
Old 02/01/2021, 09:48   #8
 
Exner.'s Avatar
 
elite*gold: 5
Join Date: Jul 2020
Posts: 183
Received Thanks: 54
Quote:
Originally Posted by LegendarySouL View Post
he is money lover not support for free
right

Quote:
Originally Posted by LegendarySouL View Post
he is money lover not support for free
Quote:
Originally Posted by ryaneichner View Post
yeah i know but we don't have source codes and i don't have any filter source coded by me or one source working fine to edit, i'm using a open source filter but i can't know how extract it or edit it, athena filter source have alot bug's, and kryfilter have bug in dll HWID

maybe we can try add from dll this codes for me will work fine, if you can help we are thank you to it !

sorry for bad english.
You are a person trying to reach this is a good thing

Quote:
Originally Posted by GameRPoP View Post
You can do it more easily with filter control. Thus, you can determine the color you want according to itemIDs.

Lots of people did that and are asking money for things like that. If something like that were released it would be awesome
Exner. is offline  
Old 02/01/2021, 16:32   #9
 
Mc-Diesel's Avatar
 
elite*gold: 80
Join Date: May 2015
Posts: 374
Received Thanks: 118
you can use Flor tut i didn't try but it gonna work im sure


use this tutorial create a custom packet or global one , add the the function to item id by filter , send the packet to all server and done
Mc-Diesel is offline  
Old 02/01/2021, 18:37   #10
dotCom
 
Devsome's Avatar
 
elite*gold: 9842
The Black Market: 107/0/0
Join Date: Mar 2009
Posts: 16,834
Received Thanks: 4,667
Guys stick to the topic, if you want to bash each other do it via private message.
Devsome is offline  
Old 02/02/2021, 05:51   #11
 
elite*gold: 0
Join Date: Mar 2010
Posts: 568
Received Thanks: 228
Hello to everyone


I'm trying to give you an example


Already this system in SRO_DevKit

Code:
wchar_t message[] = L"  Exner. SRO_DevKit / Elitepvpers";

int color = D3DCOLOR_ARGB(255, 166, 9, 168);
int color2 = D3DCOLOR_ARGB(255, 4, 72, 37);
int color3 = D3DCOLOR_ARGB(255, 15, 179, 53);

g_pCGInterface->FUN_00777c30(CHAT_All, message, color, 1);
g_pCGInterface->FUN_00777c30(CHAT_All, message, color2, 1);
g_pCGInterface->FUN_00777c30(CHAT_All, message, color3, 1);


Just need to send a packet from server to client


Good Luck

Special thanks to: florian0
Laag#82 is offline  
Thanks
1 User
Old 02/02/2021, 06:00   #12
 
Exner.'s Avatar
 
elite*gold: 5
Join Date: Jul 2020
Posts: 183
Received Thanks: 54
Quote:
Originally Posted by khaleed2010 View Post
Hello to everyone


I'm trying to give you an example


Already this system in SRO_DevKit

Code:
wchar_t message[] = L"  Exner. SRO_DevKit / Elitepvpers";

int color = D3DCOLOR_ARGB(255, 166, 9, 168);
int color2 = D3DCOLOR_ARGB(255, 4, 72, 37);
int color3 = D3DCOLOR_ARGB(255, 15, 179, 53);

g_pCGInterface->FUN_00777c30(CHAT_All, message, color, 1);
g_pCGInterface->FUN_00777c30(CHAT_All, message, color2, 1);
g_pCGInterface->FUN_00777c30(CHAT_All, message, color3, 1);


Just need to send a packet from server to client


Good Luck

Special thanks to: florian0
You are a wonderful person, thank you
Exner. is offline  
Old 02/03/2021, 13:27   #13
 
Exner.'s Avatar
 
elite*gold: 5
Join Date: Jul 2020
Posts: 183
Received Thanks: 54
Quote:
Originally Posted by khaleed2010 View Post
Hello to everyone


I'm trying to give you an example


Already this system in SRO_DevKit

Code:
wchar_t message[] = L"  Exner. SRO_DevKit / Elitepvpers";

int color = D3DCOLOR_ARGB(255, 166, 9, 168);
int color2 = D3DCOLOR_ARGB(255, 4, 72, 37);
int color3 = D3DCOLOR_ARGB(255, 15, 179, 53);

g_pCGInterface->FUN_00777c30(CHAT_All, message, color, 1);
g_pCGInterface->FUN_00777c30(CHAT_All, message, color2, 1);
g_pCGInterface->FUN_00777c30(CHAT_All, message, color3, 1);


Just need to send a packet from server to client


Good Luck

Special thanks to: florian0
If you don't mind this I don't have much experience in c#

Code in sro_devkit

CPSMission
Code:
        if (MsgBuffer->msgid() == 0x9418) //this new packet
        {

            std::n_string msg;
            *MsgBuffer >> msg;

            wchar_t message[1000];

            int color = D3DCOLOR_ARGB(255, 166, 9, 168);


            g_pCGInterface->FUN_00777c30(CHAT_All, message, color, 1);

        }
Code in Filter
Code:
        public void GlobalColor()

        {

            Packet packet = new Packet(0x9418);
            packet.WriteUInt8((byte)105);
            m_LocalSecurity.Send(packet);
            Send(false);
        }
Code:
            if (itemid == MainForm.COLOR_GLOBAL_ITEMID)
            {
            this.GlobalColor();
            }
don't know if I’m doing it right

I'm trying to do if an item id global is used this command is executed

But I don't have experience with c#

If you don't mind help
Exner. is offline  
Old 02/03/2021, 13:59   #14
 
LegendarySouL's Avatar
 
elite*gold: 0
Join Date: Nov 2020
Posts: 170
Received Thanks: 61
Quote:
Originally Posted by Exner. View Post
If you don't mind this I don't have much experience in c#

Code in sro_devkit

CPSMission
Code:
        if (MsgBuffer->msgid() == 0x9418) //this new packet
        {

            std::n_string msg;
            *MsgBuffer >> msg;

            wchar_t message[1000];

            int color = D3DCOLOR_ARGB(255, 166, 9, 168);


            g_pCGInterface->FUN_00777c30(CHAT_All, message, color, 1);

        }
Code in Filter
Code:
        public void GlobalColor()

        {

            Packet packet = new Packet(0x9418);
            packet.WriteUInt8((byte)105);
            m_LocalSecurity.Send(packet);
            Send(false);
        }
Code:
            if (itemid == MainForm.COLOR_GLOBAL_ITEMID)
            {
            this.GlobalColor();
            }
don't know if I’m doing it right

I'm trying to do if an item id global is used this command is executed

But I don't have experience with c#

If you don't mind help

not more information
Code:
            else if (type == 6) // Colorful Global Chatting
            {
                Packet packet = new Packet(0xB034);
                packet.WriteUInt8((byte)105);
                packet.WriteUInt32(color);
                packet.WriteAscii(message);
                m_LocalSecurity.Send(packet);
                Send(false);
            }
_________________________________________
Doesn't help people, just wants help, meaning nothing
LegendarySouL is offline  
Old 02/03/2021, 14:07   #15
 
Exner.'s Avatar
 
elite*gold: 5
Join Date: Jul 2020
Posts: 183
Received Thanks: 54
Quote:
Originally Posted by LegendarySouL View Post
not more information

_________________________________________
Doesn't help people, just wants help, meaning nothing
But I want to understand something about how if use a packet or use item ID to send this packet
Exner. is offline  
Reply


Similar Threads Similar Threads
Help with color name / color global / counter fortress
01/10/2021 - SRO PServer Questions & Answers - 1 Replies
#closed
[COLOR="Red"][SIZE="6"][B]~ArmyMS~[/B][/SIZE][/COLOR]
08/22/2008 - MapleStory - 0 Replies
~ArmyMS~ You need Maplestory Version 55. for this. then download the Army Ms File here >Army MS.exe then get onto hamachi, >>>Hamachi Netowrks: >ArmyMS,
WoW Color Hack (Use color-codes in text)
09/23/2007 - WoW Exploits, Hacks, Tools & Macros - 31 Replies
WoWColorHack.flt -=Preamble=- I'm quite surprised that no one has released anything similar yet - the theory behind this dates back to the alpha days. Hell, I first used this filter on my own alpha sandbox. -=Theory=-



All times are GMT +1. The time now is 18:08.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.