How to hook the client-side?

03/11/2023 01:39 Luminoso845#1
First of all, I wish everyone a good day. I am new to this business and I am constantly trying to improve myself to solve the basic logic. I apologize in advance for disturbing you.
I am trying to find the memory address of the blacksmith in the first photo and I find it according to the cheat engine, and in the second photo, the value changes when I change it, then I search this value in IDA, as Mr. DOS has shown on the forum several times, in the first photo, I use the hex value as the value I got from the Cheat Engine. I search and I see the values like in the 2nd photo, then as it can be seen in the 3rd photo, I think it shows me where it is used or where it is defined. I'm not sure exactly. I click it and I think it sends me to the place in the 4th photo, fld dword ptr [ecx] value in the 5th photo. I'm trying to search for the value as well, and in the 6th photo it shows me that there are more defined places (or used in more places) this time. When I search again, I get the result in the first photo :D and as Mr DOS shows in the forum, the sequence of bytes in the search section I'm looking for the IMG file from the defined in the 1st photo (using ? ) I find the place When I perform the operations in the 2nd and 3rd photos, I reach the result in the 4th photo (I decompile by pressing the F5 key) I don't know exactly where I went wrong So I can't understand much here, even if I read the code because I don't know exactly what it is, I am giving an example on the client side I want to hook the damage function, but when I search for it, I can't quite understand how I should read that code. If I can understand this logic basically, I think I can write the code on the dll or source code side. Thank you very much for reading this far and taking your time. Something is wrong. If I said (or wrote) I apologize very much I wish everyone a good and healthy day
03/11/2023 14:49 lnwnuyhodd#2
use [Only registered and activated users can see links. Click Here To Register...] for hook client side

1.open craft page > search 10
2.close craft page > search 0
3.do it again
4.you will get nWorkIdx address

Here's code for init Blacksmith

Val[0] = 1st item for craft
Val[1] = 2nd item for craft
Val[2] = 3rd item for craft
Val[3] = 4th item for craft
Val[4] = 5th 0 = ? img, item id = item img
Val[5] = not in use
Code:
struct NPCUI_MATERIAL
{
  int Val[6];
};
void NPCUI::Init_010(NPCUI *this)
{
    int i;

    this->nWorkIdx = 10;
    for ( i = 0; i < 100; ++i )
        this->bIsClick[i] = 0;
    if ( this->uType )
    {
        if ( this->uType == 1 )
        {
            this->uMaxPage = 22;
            this->uSlot[20].Val[0] = 1379;
            this->uSlot[20].Val[1] = 1379;
            this->uSlot[20].Val[2] = 1379;
            this->uSlot[20].Val[3] = 1379;
            this->uSlot[20].Val[4] = 702;
            this->uSlot[20].Val[5] = 0;
            this->uSlot[21].Val[0] = 1125;
            this->uSlot[21].Val[1] = 1125;
            this->uSlot[21].Val[2] = 1125;
            this->uSlot[21].Val[3] = 1125;
            this->uSlot[21].Val[4] = 702;
            this->uSlot[21].Val[5] = 0;
            this->uMinPage = 20;
        }
        else if ( this->uType == 3 )
        {
            this->uMaxPage = 62;
            this->uSlot[60].Val[0] = 2483;
            this->uSlot[60].Val[1] = 2475;
            this->uSlot[60].Val[2] = 2150;
            this->uSlot[60].Val[3] = 2150;
            this->uSlot[60].Val[4] = 2474;
            this->uSlot[60].Val[5] = 0;
            this->uSlot[61].Val[0] = 2485;
            this->uSlot[61].Val[1] = 2150;
            this->uSlot[61].Val[2] = 2150;
            this->uSlot[61].Val[3] = 0;
            this->uSlot[61].Val[4] = 2474;
            this->uSlot[61].Val[5] = 0;
            this->uMinPage = 60;
        }
        else
        {
            this->uMaxPage = 42;
            this->uSlot[40].Val[0] = 695;
            this->uSlot[40].Val[1] = 695;
            this->uSlot[40].Val[2] = 695;
            this->uSlot[40].Val[3] = 0;
            this->uSlot[40].Val[4] = 0;
            this->uSlot[40].Val[5] = 0;
            this->uSlot[41].Val[0] = 695;
            this->uSlot[41].Val[1] = 695;
            this->uSlot[41].Val[2] = 695;
            this->uSlot[41].Val[3] = 0;
            this->uSlot[41].Val[4] = 696;
            this->uSlot[41].Val[5] = 0;
            this->uMinPage = 40;
        }
    }
    else
    {
        this->uMaxPage = 17;
        this->uSlot[0].Val[0] = 1019;
        this->uSlot[0].Val[1] = 1019;
        this->uSlot[0].Val[2] = 1019;
        this->uSlot[0].Val[3] = 1019;
        this->uSlot[0].Val[4] = 0;
        this->uSlot[0].Val[5] = 0;
        this->uSlot[1].Val[0] = 1024;
        this->uSlot[1].Val[1] = 1024;
        this->uSlot[1].Val[2] = 0;
        this->uSlot[1].Val[3] = 0;
        this->uSlot[1].Val[4] = 1025;
        this->uSlot[1].Val[5] = 0;
        this->uSlot[2].Val[0] = 1473;
        this->uSlot[2].Val[1] = 1474;
        this->uSlot[2].Val[2] = 1475;
        this->uSlot[2].Val[3] = 1476;
        this->uSlot[2].Val[4] = 1477;
        this->uSlot[2].Val[5] = 0;
        this->uSlot[3].Val[0] = 708;
        this->uSlot[3].Val[1] = 709;
        this->uSlot[3].Val[2] = 710;
        this->uSlot[3].Val[3] = 711;
        this->uSlot[3].Val[4] = 707;
        this->uSlot[3].Val[5] = 0;
        this->uSlot[4].Val[0] = 983;
        this->uSlot[4].Val[1] = 983;
        this->uSlot[4].Val[2] = 983;
        this->uSlot[4].Val[3] = 983;
        this->uSlot[4].Val[4] = 984;
        this->uSlot[4].Val[5] = 0;
        this->uSlot[5].Val[0] = 870;
        this->uSlot[5].Val[1] = 871;
        this->uSlot[5].Val[2] = 872;
        this->uSlot[5].Val[3] = 873;
        this->uSlot[5].Val[4] = 0;
        this->uSlot[5].Val[5] = 0;
        this->uSlot[6].Val[0] = 874;
        this->uSlot[6].Val[1] = 875;
        this->uSlot[6].Val[2] = 876;
        this->uSlot[6].Val[3] = 877;
        this->uSlot[6].Val[4] = 0;
        this->uSlot[6].Val[5] = 0;
        this->uSlot[7].Val[0] = 576;
        this->uSlot[7].Val[1] = 576;
        this->uSlot[7].Val[2] = 576;
        this->uSlot[7].Val[3] = 576;
        this->uSlot[7].Val[4] = 2476;
        this->uSlot[7].Val[5] = 0;
        this->uSlot[8].Val[0] = 2476;
        this->uSlot[8].Val[1] = 2150;
        this->uSlot[8].Val[2] = 0;
        this->uSlot[8].Val[3] = 0;
        this->uSlot[8].Val[4] = 2477;
        this->uSlot[8].Val[5] = 0;
        this->uSlot[9].Val[0] = 1886;
        this->uSlot[9].Val[1] = 1886;
        this->uSlot[9].Val[2] = 1886;
        this->uSlot[9].Val[3] = 1886;
        this->uSlot[9].Val[4] = 2150;
        this->uSlot[9].Val[5] = 0;
        this->uSlot[15].Val[0] = 17111;
        this->uSlot[15].Val[1] = 17111;
        this->uSlot[15].Val[2] = 17111;
        this->uSlot[15].Val[3] = 17111;
        this->uSlot[15].Val[4] = 17112;
        this->uSlot[15].Val[5] = 0;
        this->uSlot[16].Val[0] = 17112;
        this->uSlot[16].Val[1] = 17112;
        this->uSlot[16].Val[2] = 17112;
        this->uSlot[16].Val[3] = 17112;
        this->uSlot[16].Val[4] = 17113;
        this->uSlot[16].Val[5] = 0;
        this->uSlot[10].Val[0] = 17086;
        this->uSlot[10].Val[1] = 17089;
        this->uSlot[10].Val[2] = 17090;
        this->uSlot[10].Val[3] = 17093;
        this->uSlot[10].Val[4] = 17102;
        this->uSlot[10].Val[5] = 0;
        this->uSlot[11].Val[0] = 17087;
        this->uSlot[11].Val[1] = 17088;
        this->uSlot[11].Val[2] = 17091;
        this->uSlot[11].Val[3] = 17092;
        this->uSlot[11].Val[4] = 17103;
        this->uSlot[11].Val[5] = 0;
        this->uSlot[12].Val[0] = 17102;
        this->uSlot[12].Val[1] = 17103;
        this->uSlot[12].Val[2] = 2150;
        this->uSlot[12].Val[3] = 17104;
        if ( mMYINFO[0].mUseAvatar.aPreviousTribe )
        {
            if ( mMYINFO[0].mUseAvatar.aPreviousTribe == 1 )
            {
                this->uSlot[12].Val[4] = 90789;
            }
            else if ( mMYINFO[0].mUseAvatar.aPreviousTribe == 2 )
            {
                this->uSlot[12].Val[4] = 90792;
            }
        }
        else
        {
            this->uSlot[12].Val[4] = 90786;
        }
        this->uSlot[12].Val[5] = 0;
        this->uSlot[13].Val[0] = 17102;
        this->uSlot[13].Val[1] = 17103;
        this->uSlot[13].Val[2] = 2150;
        this->uSlot[13].Val[3] = 17104;
        if ( mMYINFO[0].mUseAvatar.aPreviousTribe )
        {
            if ( mMYINFO[0].mUseAvatar.aPreviousTribe == 1 )
            {
                this->uSlot[13].Val[4] = 90790;
            }
            else if ( mMYINFO[0].mUseAvatar.aPreviousTribe == 2 )
            {
                this->uSlot[13].Val[4] = 90793;
            }
        }
        else
        {
            this->uSlot[13].Val[4] = 90787;
        }
        this->uSlot[13].Val[5] = 0;
        this->uSlot[14].Val[0] = 17102;
        this->uSlot[14].Val[1] = 17103;
        this->uSlot[14].Val[2] = 2150;
        this->uSlot[14].Val[3] = 17104;
        if ( mMYINFO[0].mUseAvatar.aPreviousTribe )
        {
            if ( mMYINFO[0].mUseAvatar.aPreviousTribe == 1 )
            {
                this->uSlot[14].Val[4] = 90791;
            }
            else if ( mMYINFO[0].mUseAvatar.aPreviousTribe == 2 )
            {
                this->uSlot[14].Val[4] = 90794;
            }
        }
        else
        {
            this->uSlot[14].Val[4] = 90788;
        }
        this->uSlot[14].Val[5] = 0;
        this->uMinPage = 0;
    }
    INVENUI::Set();
}
03/11/2023 22:20 Luminoso845#3
Quote:
Originally Posted by lnwnuyhodd View Post
use [Only registered and activated users can see links. Click Here To Register...] for hook client side

1.open craft page > search 10
2.close craft page > search 0
3.do it again
4.you will get nWorkIdx address

Here's code for init Blacksmith

Val[0] = 1st item for craft
Val[1] = 2nd item for craft
Val[2] = 3rd item for craft
Val[3] = 4th item for craft
Val[4] = 5th 0 = ? img, item id = item img
Val[5] = not in use
Code:
struct NPCUI_MATERIAL
{
  int Val[6];
};
void NPCUI::Init_010(NPCUI *this)
{
    int i;

    this->nWorkIdx = 10;
    for ( i = 0; i < 100; ++i )
        this->bIsClick[i] = 0;
    if ( this->uType )
    {
        if ( this->uType == 1 )
        {
            this->uMaxPage = 22;
            this->uSlot[20].Val[0] = 1379;
            this->uSlot[20].Val[1] = 1379;
            this->uSlot[20].Val[2] = 1379;
            this->uSlot[20].Val[3] = 1379;
            this->uSlot[20].Val[4] = 702;
            this->uSlot[20].Val[5] = 0;
            this->uSlot[21].Val[0] = 1125;
            this->uSlot[21].Val[1] = 1125;
            this->uSlot[21].Val[2] = 1125;
            this->uSlot[21].Val[3] = 1125;
            this->uSlot[21].Val[4] = 702;
            this->uSlot[21].Val[5] = 0;
            this->uMinPage = 20;
        }
        else if ( this->uType == 3 )
        {
            this->uMaxPage = 62;
            this->uSlot[60].Val[0] = 2483;
            this->uSlot[60].Val[1] = 2475;
            this->uSlot[60].Val[2] = 2150;
            this->uSlot[60].Val[3] = 2150;
            this->uSlot[60].Val[4] = 2474;
            this->uSlot[60].Val[5] = 0;
            this->uSlot[61].Val[0] = 2485;
            this->uSlot[61].Val[1] = 2150;
            this->uSlot[61].Val[2] = 2150;
            this->uSlot[61].Val[3] = 0;
            this->uSlot[61].Val[4] = 2474;
            this->uSlot[61].Val[5] = 0;
            this->uMinPage = 60;
        }
        else
        {
            this->uMaxPage = 42;
            this->uSlot[40].Val[0] = 695;
            this->uSlot[40].Val[1] = 695;
            this->uSlot[40].Val[2] = 695;
            this->uSlot[40].Val[3] = 0;
            this->uSlot[40].Val[4] = 0;
            this->uSlot[40].Val[5] = 0;
            this->uSlot[41].Val[0] = 695;
            this->uSlot[41].Val[1] = 695;
            this->uSlot[41].Val[2] = 695;
            this->uSlot[41].Val[3] = 0;
            this->uSlot[41].Val[4] = 696;
            this->uSlot[41].Val[5] = 0;
            this->uMinPage = 40;
        }
    }
    else
    {
        this->uMaxPage = 17;
        this->uSlot[0].Val[0] = 1019;
        this->uSlot[0].Val[1] = 1019;
        this->uSlot[0].Val[2] = 1019;
        this->uSlot[0].Val[3] = 1019;
        this->uSlot[0].Val[4] = 0;
        this->uSlot[0].Val[5] = 0;
        this->uSlot[1].Val[0] = 1024;
        this->uSlot[1].Val[1] = 1024;
        this->uSlot[1].Val[2] = 0;
        this->uSlot[1].Val[3] = 0;
        this->uSlot[1].Val[4] = 1025;
        this->uSlot[1].Val[5] = 0;
        this->uSlot[2].Val[0] = 1473;
        this->uSlot[2].Val[1] = 1474;
        this->uSlot[2].Val[2] = 1475;
        this->uSlot[2].Val[3] = 1476;
        this->uSlot[2].Val[4] = 1477;
        this->uSlot[2].Val[5] = 0;
        this->uSlot[3].Val[0] = 708;
        this->uSlot[3].Val[1] = 709;
        this->uSlot[3].Val[2] = 710;
        this->uSlot[3].Val[3] = 711;
        this->uSlot[3].Val[4] = 707;
        this->uSlot[3].Val[5] = 0;
        this->uSlot[4].Val[0] = 983;
        this->uSlot[4].Val[1] = 983;
        this->uSlot[4].Val[2] = 983;
        this->uSlot[4].Val[3] = 983;
        this->uSlot[4].Val[4] = 984;
        this->uSlot[4].Val[5] = 0;
        this->uSlot[5].Val[0] = 870;
        this->uSlot[5].Val[1] = 871;
        this->uSlot[5].Val[2] = 872;
        this->uSlot[5].Val[3] = 873;
        this->uSlot[5].Val[4] = 0;
        this->uSlot[5].Val[5] = 0;
        this->uSlot[6].Val[0] = 874;
        this->uSlot[6].Val[1] = 875;
        this->uSlot[6].Val[2] = 876;
        this->uSlot[6].Val[3] = 877;
        this->uSlot[6].Val[4] = 0;
        this->uSlot[6].Val[5] = 0;
        this->uSlot[7].Val[0] = 576;
        this->uSlot[7].Val[1] = 576;
        this->uSlot[7].Val[2] = 576;
        this->uSlot[7].Val[3] = 576;
        this->uSlot[7].Val[4] = 2476;
        this->uSlot[7].Val[5] = 0;
        this->uSlot[8].Val[0] = 2476;
        this->uSlot[8].Val[1] = 2150;
        this->uSlot[8].Val[2] = 0;
        this->uSlot[8].Val[3] = 0;
        this->uSlot[8].Val[4] = 2477;
        this->uSlot[8].Val[5] = 0;
        this->uSlot[9].Val[0] = 1886;
        this->uSlot[9].Val[1] = 1886;
        this->uSlot[9].Val[2] = 1886;
        this->uSlot[9].Val[3] = 1886;
        this->uSlot[9].Val[4] = 2150;
        this->uSlot[9].Val[5] = 0;
        this->uSlot[15].Val[0] = 17111;
        this->uSlot[15].Val[1] = 17111;
        this->uSlot[15].Val[2] = 17111;
        this->uSlot[15].Val[3] = 17111;
        this->uSlot[15].Val[4] = 17112;
        this->uSlot[15].Val[5] = 0;
        this->uSlot[16].Val[0] = 17112;
        this->uSlot[16].Val[1] = 17112;
        this->uSlot[16].Val[2] = 17112;
        this->uSlot[16].Val[3] = 17112;
        this->uSlot[16].Val[4] = 17113;
        this->uSlot[16].Val[5] = 0;
        this->uSlot[10].Val[0] = 17086;
        this->uSlot[10].Val[1] = 17089;
        this->uSlot[10].Val[2] = 17090;
        this->uSlot[10].Val[3] = 17093;
        this->uSlot[10].Val[4] = 17102;
        this->uSlot[10].Val[5] = 0;
        this->uSlot[11].Val[0] = 17087;
        this->uSlot[11].Val[1] = 17088;
        this->uSlot[11].Val[2] = 17091;
        this->uSlot[11].Val[3] = 17092;
        this->uSlot[11].Val[4] = 17103;
        this->uSlot[11].Val[5] = 0;
        this->uSlot[12].Val[0] = 17102;
        this->uSlot[12].Val[1] = 17103;
        this->uSlot[12].Val[2] = 2150;
        this->uSlot[12].Val[3] = 17104;
        if ( mMYINFO[0].mUseAvatar.aPreviousTribe )
        {
            if ( mMYINFO[0].mUseAvatar.aPreviousTribe == 1 )
            {
                this->uSlot[12].Val[4] = 90789;
            }
            else if ( mMYINFO[0].mUseAvatar.aPreviousTribe == 2 )
            {
                this->uSlot[12].Val[4] = 90792;
            }
        }
        else
        {
            this->uSlot[12].Val[4] = 90786;
        }
        this->uSlot[12].Val[5] = 0;
        this->uSlot[13].Val[0] = 17102;
        this->uSlot[13].Val[1] = 17103;
        this->uSlot[13].Val[2] = 2150;
        this->uSlot[13].Val[3] = 17104;
        if ( mMYINFO[0].mUseAvatar.aPreviousTribe )
        {
            if ( mMYINFO[0].mUseAvatar.aPreviousTribe == 1 )
            {
                this->uSlot[13].Val[4] = 90790;
            }
            else if ( mMYINFO[0].mUseAvatar.aPreviousTribe == 2 )
            {
                this->uSlot[13].Val[4] = 90793;
            }
        }
        else
        {
            this->uSlot[13].Val[4] = 90787;
        }
        this->uSlot[13].Val[5] = 0;
        this->uSlot[14].Val[0] = 17102;
        this->uSlot[14].Val[1] = 17103;
        this->uSlot[14].Val[2] = 2150;
        this->uSlot[14].Val[3] = 17104;
        if ( mMYINFO[0].mUseAvatar.aPreviousTribe )
        {
            if ( mMYINFO[0].mUseAvatar.aPreviousTribe == 1 )
            {
                this->uSlot[14].Val[4] = 90791;
            }
            else if ( mMYINFO[0].mUseAvatar.aPreviousTribe == 2 )
            {
                this->uSlot[14].Val[4] = 90794;
            }
        }
        else
        {
            this->uSlot[14].Val[4] = 90788;
        }
        this->uSlot[14].Val[5] = 0;
        this->uMinPage = 0;
    }
    INVENUI::Set();
}
Mr Dos, I don't want to disrespect, but I want to learn the basic logic of this business, of course, you don't have to show or teach it, rather than a client-side code, but if you say it, I think it will be more useful for me to say the logic instead of this code block you have given, I hope I can express myself correctly.