Decompiled DrawObjectOnViewport Function (1.03K) JPN

Page 1 of 2 12 LastLast
Results 1 to 15 of 28
  1. #1
    Darkness Member Kiosani is offline
    True MemberRank
    Oct 2007 Join Date
    ArgentinaLocation
    1,257Posts

    cool Decompiled DrawObjectOnViewport Function (1.03K) JPN

    Decompiled DrawObjectOnViewport Function (1.03K) JPN
    Hello everyone, today I want to share my decompilation of this function. Which makes it possible to modify the Rotation Angles: X,Y,Z and the Display Size of the Items on the Map Floor. Enjoy it!

    NOTE: 0 ASM Code.
    Item.cpp File:

    #include "StdAfx.h"

    cItem gItem;

    int cItem::DrawObjectOnViewport(lpObjViewport lpObjView) // -> 0x005C0467
    {
    switch(lpObjView->ObjIndex)
    {
    case Demon_Pet:
    lpObjView->AngleX = 0.f;
    lpObjView->AngleY = 0.f;
    lpObjView->AngleZ = 70.f;
    lpObjView->Size = 0.2f;
    break;

    case Fairy_Pet:
    lpObjView->AngleX = 0.f;
    lpObjView->AngleY = 0.f;
    lpObjView->AngleZ = 70.f;
    lpObjView->Size = 0.4f;
    break;

    default:
    return pObjOnViewport(lpObjView);
    break;
    }
    // ----
    return 0;
    }

    void cItem::InitDrawObjectOnViewport()
    {
    gToolKit.SetOp((LPVOID)oDrawObjectCall01,this->DrawObjectOnViewport,ASM::CALL);
    gToolKit.SetOp((LPVOID)oDrawObjectCall02,this->DrawObjectOnViewport,ASM::CALL);
    }

    void cItem::Load()
    {
    this->InitDrawObjectOnViewport();
    }

    Structs.h File:


    #ifndef __STRUCTS_H__#define __STRUCTS_H__#pragma pack(push,1)typedef struct{ /*+0*/ BYTE Unknown0; /*+1*/ BYTE Unknown1; /*+2*/ BYTE Unknown2; /*+3*/ BYTE Unknown3; /*+4*/ BYTE Unknown4; /*+5*/ BYTE Unknown5; /*+6*/ BYTE Unknown6; /*+7*/ BYTE Unknown7; /*+8*/ BYTE Unknown8; /*+9*/ BYTE Unknown9; /*+10*/ BYTE Unknown10; /*+11*/ BYTE Unknown11; /*+12*/ BYTE Unknown12; /*+13*/ BYTE Unknown13; /*+14*/ BYTE Unknown14; /*+15*/ BYTE Unknown15; /*+16*/ BYTE Unknown16; /*+17*/ BYTE Unknown17; /*+18*/ BYTE Unknown18; /*+19*/ BYTE Unknown19; /*+20*/ BYTE Unknown20; /*+21*/ BYTE Unknown21; /*+22*/ BYTE Unknown22; /*+23*/ BYTE Unknown23; /*+24*/ BYTE Unknown24; /*+25*/ BYTE Unknown25; /*+26*/ BYTE Unknown26; /*+27*/ BYTE Unknown27; /*+28*/ BYTE Unknown28; /*+29*/ BYTE Unknown29; /*+30*/ BYTE Unknown30; /*+31*/ BYTE Unknown31; /*+32*/ BYTE Unknown32; /*+33*/ BYTE Unknown33; /*+34*/ BYTE Unknown34; /*+35*/ BYTE Unknown35; /*+36*/ BYTE Unknown36; /*+37*/ BYTE Unknown37; /*+38*/ BYTE Unknown38; /*+39*/ BYTE Unknown39; /*+40*/ BYTE Unknown40; /*+41*/ BYTE Unknown41; /*+42*/ BYTE Unknown42; /*+43*/ BYTE Unknown43; /*+44*/ BYTE Unknown44; /*+45*/ BYTE Unknown45; /*+46*/ BYTE Unknown46; /*+47*/ BYTE Unknown47; /*+48*/ DWORD ObjIndex; /*+49*/ BYTE Unknown49; /*+50*/ BYTE Unknown50; /*+51*/ BYTE Unknown51; /*+52*/ BYTE Unknown52; BYTE Shift1[40]; /*+96*/ float Size; BYTE Shift2[164]; /*264*/ float AngleX; /*268*/ float AngleY; /*272*/ float AngleZ;}gObjViewport, *lpObjViewport;#pragma pack(pop)#endif
    ScreenShot:



    Downloads:


    Download Full Source Code (Main.dll):



    Download Main.exe Hooked + Compiled Main.dll:

    Credits:
    Webzen
    Kiosani
    Last edited by Kiosani; 11-01-17 at 07:15 PM.


  2. #2
    Member MaxSpeed is offline
    MemberRank
    Jul 2015 Join Date
    37Posts

    Re: Decompiled DrawObjectOnViewport Function (1.03K) JPN

    can you share method decode struct ?, i can decode sub code with the IDA, but cant decode struct :(

  3. #3
    Darkness Member Kiosani is offline
    True MemberRank
    Oct 2007 Join Date
    ArgentinaLocation
    1,257Posts

    Re: Decompiled DrawObjectOnViewport Function (1.03K) JPN

    Quote Originally Posted by MaxSpeed View Post
    can you share method decode struct ?, i can decode sub code with the IDA, but cant decode struct :(
    Decode Struct ? bro... you only can decode a struct if you have some: .pdb from main, at least I'm thinking this. If you need re-make some struct you only must calc positions that you know of this. and put Shift[XX] bytes on fields that you don't know of this struct. size must be the same for your used Fields -> /*+96*/ float Size; for example, etc.

  4. #4
    Member NaveMu is offline
    MemberRank
    Feb 2012 Join Date
    57Posts

    Re: Decompiled DrawObjectOnViewport Function (1.03K) JPN

    Quote Originally Posted by Kiosani View Post
    Decode Struct ? bro... you only can decode a struct if you have some: .pdb from main, at least I'm thinking this. If you need re-make some struct you only must calc positions that you know of this. and put Shift[XX] bytes on fields that you don't know of this struct. size must be the same for your used Fields -> /*+96*/ float Size; for example, etc.
    Wonderful topic bro, could you someday come us teaching a little to pick up new effects and put on the older mains? Example: catch the effect of season 8 and put season 4

  5. #5
    Darkness Member Kiosani is offline
    True MemberRank
    Oct 2007 Join Date
    ArgentinaLocation
    1,257Posts

    Re: Decompiled DrawObjectOnViewport Function (1.03K) JPN

    Quote Originally Posted by NaveMu View Post
    Wonderful topic bro, could you someday come us teaching a little to pick up new effects and put on the older mains? Example: catch the effect of season 8 and put season 4
    yes is possible, but new main are packed...

  6. #6
    Member NaveMu is offline
    MemberRank
    Feb 2012 Join Date
    57Posts

    Re: Decompiled DrawObjectOnViewport Function (1.03K) JPN

    Quote Originally Posted by Kiosani View Post
    yes is possible, but new main are packed...
    this is true ;/

    A doubt this AngleX, X, Z and Size, has in all versions? 1.02t too?

  7. #7
    #ChangeBrazil SmileYzn is offline
    True MemberRank
    Nov 2012 Join Date
    0x00401000Location
    918Posts

    Re: Decompiled DrawObjectOnViewport Function (1.03K) JPN

    Quote Originally Posted by MaxSpeed View Post
    can you share method decode struct ?, i can decode sub code with the IDA, but cant decode struct :(
    I can say a tip to you: Some structs are the same (In the case of this 1.03K main) of GameServer 1.00.90 decompilation.

    Good luck.

    Ps. N1ce share

  8. #8
    Member NaveMu is offline
    MemberRank
    Feb 2012 Join Date
    57Posts

    Re: Decompiled DrawObjectOnViewport Function (1.03K) JPN

    Quote Originally Posted by Kiosani View Post
    Item.cpp File:



    Structs.h File:



    ScreenShot:



    Downloads:



    I found this reference in main 1.02.14 but did not want to decrease the size of the items see:



    The item does not change the size because it will?

  9. #9
    Darkness Member Kiosani is offline
    True MemberRank
    Oct 2007 Join Date
    ArgentinaLocation
    1,257Posts

    Re: Decompiled DrawObjectOnViewport Function (1.03K) JPN

    Quote Originally Posted by NaveMu View Post
    I found this reference in main 1.02.14 but did not want to decrease the size of the items see:



    The item does not change the size because it will?
    because here you have a different struct lpObjViewport bro... anyways are you sure that this is equivalent function on your old school main ?? If your Answer it's YES, then you must remake it !

    Ex for your main ObjIndex(using your Screenshot from reference at: 0x005F5478):


    /*+0*/ BYTE Unknown0;
    /*+1*/ BYTE Unknown1;
    /*+2*/ WORD ObjIndex;


    PS: I can try to make for u, pass me your main.exe + your DLLs (ogg.dll, wzAudio.dll & vorbisfile.dll).

    PS 2: I'm thinking that by your Screenshot... I mean.. using your showed function on your Screenshot... your struct is something like this:

    /*+28*/ float AngleX;
    /*+32*/ float AngleY;
    /*+36*/ float AngleZ;

    Last edited by Kiosani; 15-01-17 at 08:23 PM.

  10. #10
    Registered florus is offline
    MemberRank
    Jan 2017 Join Date
    18Posts

    Re: Decompiled DrawObjectOnViewport Function (1.03K) JPN

    Hello. Can you give me offset for this function in 1.04D main.exe? Thx.

  11. #11
    Member NaveMu is offline
    MemberRank
    Feb 2012 Join Date
    57Posts

    Re: Decompiled DrawObjectOnViewport Function (1.03K) JPN

    Quote Originally Posted by Kiosani View Post
    because here you have a different struct lpObjViewport bro... anyways are you sure that this is equivalent function on your old school main ?? If your Answer it's YES, then you must remake it !

    Ex for your main ObjIndex(using your Screenshot from reference at: 0x005F5478):


    /*+0*/ BYTE Unknown0;
    /*+1*/ BYTE Unknown1;
    /*+2*/ WORD ObjIndex;


    PS: I can try to make for u, pass me your main.exe + your DLLs (ogg.dll, wzAudio.dll & vorbisfile.dll).

    PS 2: I'm thinking that by your Screenshot... I mean.. using your showed function on your Screenshot... your struct is something like this:

    /*+28*/ float AngleX;
    /*+32*/ float AngleY;
    /*+36*/ float AngleZ;


    Yes I searched all references and gave me this function I tried to use like this:

    Int Type = * (WORD *) (Struct + 2);

    Direct without using struct and also in asm but did not change the size;

    My main is this: https://www.sendspace.com/file/64ore0


    Thankiu!

  12. #12
    Darkness Member Kiosani is offline
    True MemberRank
    Oct 2007 Join Date
    ArgentinaLocation
    1,257Posts

    Re: Decompiled DrawObjectOnViewport Function (1.03K) JPN

    Quote Originally Posted by NaveMu View Post
    Yes I searched all references and gave me this function I tried to use like this:

    Int Type = * (WORD *) (Struct + 2);

    Direct without using struct and also in asm but did not change the size;

    My main is this: https://www.sendspace.com/file/64ore0


    Thankiu!
    your main.exe named like: 'MyPrincipal' is not the same main.exe that in your ScreenShot bro... anyways... your posted main.exe have the same struct size, then maybe this can be useful for you:

    Code:
    // Main 1.02.14 Protocol: ??? (32 Item Index)
    #pragma pack(push,1)
    typedef struct            // -> Total Size: ?
    {    
          /*+0*/        BYTE Unknown0;    
          /*+1*/        BYTE Unknown1;
          /*+2*/        WORD ObjIndex;
          /*+3*/        BYTE Unknown2;
          /*+4*/        BYTE Unknown3;
          /*+5*/        BYTE Unknown4;
          /*+6*/        BYTE Unknown5;
          /*+7*/        BYTE Unknown6;
          /*+8*/        BYTE Unknown7;
          /*+9*/        BYTE Unknown8;
          /*+10*/       BYTE Unknown9;
          /*+12*/       DWORD Size;
          /*+16*/       float PosX;
          /*+20*/       float PosY;
          /*+24*/       float PosZ;
          /*+28*/       float AngleX;
          /*+32*/       float AngleY;
          /*+36*/       float AngleZ;
    }gObjViewport, *lpObjViewport;
    #pragma pack(pop)
    PS: In old school main.exe (like your main) that use ITEM_STRUCTURE from: 32 Item Index by every Item Type... in lpObjViewport Struct Size field is: /*+12*/ DWORD Size; sincerely I don't know why... but anyways you can try to use: float values on code if you make a small Cast first something like this:

    Cast Ex:

    Code:
    case Demon_Pet:
    lpObjView->AngleX    = 0.f;
    lpObjView->AngleY    = 0.f;
    lpObjView->AngleZ    = 70.f;
    lpObjView->Size        = (DWORD)0.2f;
    break;
    PS 2: I hope this has been helpful to you... don't forget that your main works with: 32 as maximum Index, so: ObjIndex must be matched to a formula like this:

    Main 1.02.14 Protocol: ??? ObjectId Formula:

    Code:
    #define ObjectId(x,y)        ((x*32)+y+530) // -> 530 in hex: (0x212) is Item Offset in Array from: 1.02.14 main
    Last edited by Kiosani; 17-01-17 at 05:01 AM.

  13. #13
    Member NaveMu is offline
    MemberRank
    Feb 2012 Join Date
    57Posts

    Re: Decompiled DrawObjectOnViewport Function (1.03K) JPN

    Quote Originally Posted by Kiosani View Post
    your main.exe named like: 'MyPrincipal' is not the same main.exe that in your ScreenShot bro... anyways... your posted main.exe have the same struct size, then maybe this can be useful for you:

    Code:
    // Main 1.02.14 Protocol: ??? (32 Item Index)
    #pragma pack(push,1)
    typedef struct            // -> Total Size: ?
    {    
          /*+0*/        BYTE Unknown0;    
          /*+1*/        BYTE Unknown1;
          /*+2*/        WORD ObjIndex;
          /*+3*/        BYTE Unknown2;
          /*+4*/        BYTE Unknown3;
          /*+5*/        BYTE Unknown4;
          /*+6*/        BYTE Unknown5;
          /*+7*/        BYTE Unknown6;
          /*+8*/        BYTE Unknown7;
          /*+9*/        BYTE Unknown8;
          /*+10*/       BYTE Unknown9;
          /*+12*/       DWORD Size;
          /*+16*/       float PosX;
          /*+20*/       float PosY;
          /*+24*/       float PosZ;
          /*+28*/       float AngleX;
          /*+32*/       float AngleY;
          /*+36*/       float AngleZ;
    }gObjViewport, *lpObjViewport;
    #pragma pack(pop)
    PS: In old school main.exe (like your main) that use ITEM_STRUCTURE from: 32 Item Index by every Item Type... in lpObjViewport Struct Size field is: /*+12*/ DWORD Size; sincerely I don't know why... but anyways you can try to use: float values on code if you make a small Cast first something like this:

    Cast Ex:

    Code:
    case Demon_Pet:
    lpObjView->AngleX    = 0.f;
    lpObjView->AngleY    = 0.f;
    lpObjView->AngleZ    = 70.f;
    lpObjView->Size        = (DWORD)0.2f;
    break;
    PS 2: I hope this has been helpful to you... don't forget that your main works with: 32 as maximum Index, so: ObjIndex must be matched to a formula like this:

    Main 1.02.14 Protocol: ??? ObjectId Formula:

    Code:
    #define ObjectId(x,y)        ((x*32)+y+530) // -> 530 in hex: (0x212) is Item Offset in Array from: 1.02.14 main
    Bro sorry to waste your time, but unfortunately this offset comes from the protocol recv, and seems not to be used I used breakpoint before starting the main after I started it and I entered the character in no time used the function and unfortunately it was the only reference Closer to the one you posted, I think the older ones do not have these options, thanks for trying to help me!

  14. #14
    Member NaveMu is offline
    MemberRank
    Feb 2012 Join Date
    57Posts

    Re: Decompiled DrawObjectOnViewport Function (1.03K) JPN

    Quote Originally Posted by Kiosani View Post
    Item.cpp File:



    Structs.h File:



    ScreenShot:



    Downloads:



    Unfortunately I ran the whole main, I modified several places where I used 0x1C 0x18 0x20 and 0x24, but I did not find any that modified the size of the item in the character, I think this is not possible in the old versions, if it were you would have some Idea of where it might be? So that I can continue my search

  15. #15
    Newbie :) Pinkof is offline
    True MemberRank
    Mar 2008 Join Date
    760Posts

    Re: Decompiled DrawObjectOnViewport Function (1.03K) JPN

    Quote Originally Posted by NaveMu View Post
    Unfortunately I ran the whole main, I modified several places where I used 0x1C 0x18 0x20 and 0x24, but I did not find any that modified the size of the item in the character, I think this is not possible in the old versions, if it were you would have some Idea of where it might be? So that I can continue my search
    You can do it in any version. Change size rotate create own movements change color and more. First learn how work the character and later try work with items to decode struct . Both are similar



Page 1 of 2 12 LastLast

Advertisement