Decompiled gObjItemAttach function from main.exe 1.03.15 (Eng)

Results 1 to 8 of 8
  1. #1
    Darkness Member Kiosani is offline
    MemberRank
    Oct 2007 Join Date
    ArgentinaLocation
    1,276Posts

    happy Decompiled gObjItemAttach function from main.exe 1.03.15 (Eng)

    Well this is my first decompilation code.. this job is functional to: 100% (tested) This is the function that allows you to attach apples and / or potions of all types that exist: Season 4, in the character inventory (using: Left Click), could be used to create a new jewelry packaging system that do not exist in: Season 4, as are: Bundled of Jewel of Chaos or Bundled Jewel of Life of: Season 6, good without much more to say, I give you the source code for anyone who wants to use it.

    Code:
    char __stdcall gObjAttachItemEx(int ItemStartId, int ItemEndId)
    {
        char result;
    
    
        if ( !ItemStartId || !ItemEndId )
        {
            return 0;
        }
        
        int ItemStartRange                = *(WORD*)ItemStartId;
        int ItemEndRange                = *(WORD*)ItemEndId;
        int ItemDurInByte1                = *(BYTE*)(ItemStartId+22);
        int ItemDurInByte2                = *(BYTE*)(ItemEndId+22);
        // ---------------------------------------------------------
        // for Elf Botls & Arrows
        // ---------------------------------------------------------
        int ItemStartSpecialRange        = *(DWORD*)(ItemStartId+2);
        int ItemEndSpecialRange            = *(DWORD*)(ItemEndId+2);
    
    
        if ( ItemStartRange != ItemEndRange )
        {
            goto REGRESO;
        }
    
    
        if ( ItemStartRange == ITEM(14,7) && ItemEndRange == ITEM(14,7) && ItemDurInByte1 < 250 && ItemDurInByte2 < 250 )
        {
            return 1;
        }
        
        if ( ItemStartRange >= ITEM(14,0) && ItemStartRange <= ITEM(14,8) && ItemStartRange != ITEM(14,7) && ItemEndRange >= ITEM(14,0) && ItemEndRange <= ITEM(14,8) && ItemEndRange != ITEM(14,7) && ItemDurInByte1 < 3 && ItemDurInByte2 < 3 )
        {
            return 1;
        }
    
    
        if ( ItemStartRange >= ITEM(14,38) && ItemStartRange <= ITEM(14,40) && ItemEndRange >= ITEM(14,38) && ItemEndRange <= ITEM(14,40) && ItemDurInByte1 < 3 && ItemDurInByte2 < 3 )
        {
            return 1;
        }
    
    
        if ( ItemStartRange == ITEM(4,7) && ItemEndRange == ITEM(4,7) && ItemStartSpecialRange == ItemEndSpecialRange )//Elf Bolts
        {
            return 1;
        }
    
    
        if ( ItemStartRange == ITEM(4,15) && ItemEndRange == ITEM(4,15) && ItemStartSpecialRange == ItemEndSpecialRange )//Elf Arrows
        {
            return 1;
        }
    
    
        if ( ItemStartRange == ITEM(14,28) && ItemEndRange == ITEM(14,28) )//Symbol of Kundun
        {
            return 1;
        }
    
    
        if ( ItemStartRange >= ITEM(13,32) && ItemStartRange <= ITEM(13,34) && ItemEndRange >= ITEM(13,32) && ItemEndRange <= ITEM(13,34) )//Splinter of Armor, Bless of Guardian & Claw of Beast
        {
            return 1;
        }
    
    
        if ( ItemStartRange >= ITEM(14,46) && ItemStartRange <= ITEM(14,50) && ItemEndRange >= ITEM(14,46) && ItemEndRange <= ITEM(14,50) && ItemDurInByte1 < 3 && ItemDurInByte2 < 3 )//Jack O'Lantern: Bless, Rage, Scream, Food & Drink Scrolls
        {
            return 1;
        }
    
    
        if ( ItemStartRange == ITEM(14,70) && ItemEndRange == ITEM(14,70) && ItemDurInByte1 < 50 && ItemDurInByte2 < 50 )//Elite Healing Potion
        {
            return 1;
        }
    
    
        if ( ItemStartRange == ITEM(14,71) && ItemEndRange == ITEM(14,71) && ItemDurInByte1 < 50 && ItemDurInByte2 < 50 )//Elite Mana Potion
        {
            return 1;
        }
    
    
        if ( ItemStartRange == ITEM(14,78) && ItemEndRange == ITEM(14,78) && ItemDurInByte1 < 3 && ItemDurInByte2 < 3 )//Leap of Strenght
        {
            return 1;
        }
    
    
        if ( ItemStartRange == ITEM(14,79) && ItemEndRange == ITEM(14,79) && ItemDurInByte1 < 3 && ItemDurInByte2 < 3 )//Leap of Agility
        {
            return 1;
        }
    
    
        if ( ItemStartRange == ITEM(14,80) && ItemEndRange == ITEM(14,80) && ItemDurInByte1 < 3 && ItemDurInByte2 < 3 )//Leap of Vitality
        {
            return 1;
        }
    
    
        if ( ItemStartRange == ITEM(14,81) && ItemEndRange == ITEM(14,81) && ItemDurInByte1 < 3 && ItemDurInByte2 < 3 )//Leap of Energy
        {
            return 1;
        }
    
    
        if ( ItemStartRange == ITEM(14,82) && ItemEndRange == ITEM(14,82) && ItemDurInByte1 < 3 && ItemDurInByte2 < 3 )//Leap of Command
        {
            return 1;
        }
    
    
        if ( ItemStartRange == ITEM(14,94) && ItemEndRange == ITEM(14,94) && ItemDurInByte1 < 50 && ItemDurInByte2 < 50 )//Medium Elite Healing Potion
        {
            return 1;
        }
    
    
        if ( ItemStartRange == ITEM(14,85) && ItemEndRange == ITEM(14,85) && ItemDurInByte1 < 3 && ItemDurInByte2 < 3 )//Cherry Blossom Wine
        {
            return 1;
        }
    
    
        if ( ItemStartRange == ITEM(14,86) && ItemEndRange == ITEM(14,86) && ItemDurInByte1 < 3 && ItemDurInByte2 < 3 )//Cherry Blossom Rice Cake
        {
            return 1;
        }
    
    
        if ( ItemStartRange == ITEM(14,87) && ItemEndRange == ITEM(14,87) && ItemDurInByte1 < 3 && ItemDurInByte2 < 3 )//Cherry Blossom Flower Petal
        {
            return 1;
        }
    
    
        if ( ItemStartRange == ITEM(14,88) && ItemEndRange == ITEM(14,88) && ItemDurInByte1 < 10 && ItemDurInByte2 < 10 )//White Cherry Blossom Branch (x10)
        {
            return 1;
        }
    
    
        if ( ItemStartRange == ITEM(14,89) && ItemEndRange == ITEM(14,89) && ItemDurInByte1 < 30 && ItemDurInByte2 < 30 )//Red Cherry Blossom Branch (x30)
        {
            return 1;
        }
    
    
        if ( ItemStartRange == ITEM(14,90) && ItemEndRange == ITEM(14,90) && ItemDurInByte1 < 50 && ItemDurInByte2 < 50 )//Golden Cherry Blossom Branch (x50)
        {
            return 1;
        }
    
    
        if ( ItemStartRange != ITEM(14,100) || ItemDurInByte1 >= 255 || ItemDurInByte2 >= 255 )//Restore normal durability from other types of items gets from: Item(Kor).txt
    REGRESO:
        result = 0;
        else
        result = 1;
        return result;
    }
    
    
    void HookFunction()
    {
        Utils.SetHook((LPVOID)gObjAttachItemEx, (LPVOID)0x0073595E, ASM::CALL);
        Utils.SetHook((LPVOID)gObjAttachItemEx, (LPVOID)0x007595E9, ASM::CALL);
        Utils.SetHook((LPVOID)gObjAttachItemEx, (LPVOID)0x0075C610, ASM::CALL);
    }
    
    
    extern "C" _declspec(dllexport) void RunDLL()
    {
        DWORD OldProtect;
        if(VirtualProtect(LPVOID(0x401000),0x00875FFF,PAGE_EXECUTE_READWRITE,&OldProtect))
        {
            HookFunction();
        }
        else
        {
            MessageBoxA(NULL,"Cannot load Client.dll","Error",MB_OK);
            ExitProcess(0);
        }
    }
    Video TEST:



    PS: This is my first decompilation made totally by me, and 100% Tested & Works!

    PS 2: For can make this fix on counts of Apples you must modify your server side too.

    Credits for this: Webzen, IDA & me

    - - - Updated - - -

    Thanks to all friends!, now I must fix Numbers that show main.exe.. I must search the correct function for this, decompile and modify I'm trying..
    Last edited by Kiosani; 10-06-14 at 04:24 AM.


  2. #2
    King of the bongo Denied is offline
    MemberRank
    Oct 2009 Join Date
    RomaniaLocation
    986Posts

    Re: Decompiled gObjItemAttach function from main.exe 1.03.15 (Eng)

    I find this code useful. Thank you for this release.

  3. #3
    Enthusiast IonGames is offline
    MemberRank
    Jun 2012 Join Date
    47Posts

    Re: Decompiled gObjItemAttach function from main.exe 1.03.15 (Eng)

    for 1.04D ?

  4. #4
    Mulegend Server Mulegend is offline
    MemberRank
    May 2006 Join Date
    Montevideo - UruguayLocation
    461Posts

    Re: Decompiled gObjItemAttach function from main.exe 1.03.15 (Eng)

    apple stack is´t a fail, anyways

    the best way = Return that function and made stack manager on server side

  5. #5
    el gordito tetas caidas GM-Andromeda is offline
    MemberRank
    Jun 2006 Join Date
    Complex plane.Location
    202Posts

    Re: Decompiled gObjItemAttach function from main.exe 1.03.15 (Eng)

    i really dont understand this function... it actually does not do anything but checking durability and range?

    it does not "attach" anything, no logic part for inventory, not even modify some variable that "somehow" would be related to the rendering pipeline (which is the tricky part in my opinion)

    so i think it should be called "bool _dosomechecksforVisualItems(int _itemStartId, int _itemEndId)" and it sould be a private method in the VisualInventory class

    anyway, maybe some guy would find it usefull, but no me :(

    nemesismucoder

  6. #6
    Valued Member Crazzy is offline
    MemberRank
    Jun 2009 Join Date
    Moscow, Russia,Location
    106Posts

    Re: Decompiled gObjItemAttach function from main.exe 1.03.15 (Eng)

    relax man ) for WZ usefull all their code and like if(true != false) xDDD

  7. #7
    el gordito tetas caidas GM-Andromeda is offline
    MemberRank
    Jun 2006 Join Date
    Complex plane.Location
    202Posts

    Re: Decompiled gObjItemAttach function from main.exe 1.03.15 (Eng)

    Quote Originally Posted by Crazzy View Post
    relax man ) for WZ usefull all their code and like if(true != false) xDDD
    i just dont understand why the function name is gObjAttachItemEx. nothing more

  8. #8
    Proficient Member phit666 is offline
    MemberRank
    Apr 2007 Join Date
    197Posts

    Re: Decompiled gObjItemAttach function from main.exe 1.03.15 (Eng)

    Quote Originally Posted by Mulegend View Post
    apple stack is´t a fail, anyways

    the best way = Return that function and made stack manager on server side
    Yes but ofc client has its local check like in this case to reduce unnecessary packets going to server so you still need to edit that check in the client.



Advertisement