Migrate cleanLayer to 6.0 menu

User Tag List

Results 1 to 6 of 6
  1. #1
    Shadowhunter12's Avatar Member
    Reputation
    1
    Join Date
    Sep 2012
    Posts
    44
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Migrate cleanLayer to 6.0

    Hello everyone,

    I just returned to playing WoW for the new expansion, and thus wanted to pick up working on a bot of some sort (mostly for learning, I use Honorbuddy and various other bots since I simply do not have enough time to work on a full bot).

    I was thinking about taking a previous open source example full bot example (or engine for other bots), called cleanLayer by miceiken, and updating it and providing it back to the community. It'll mostly help people like myself who have a lot of experience programming, but don't have enough skills to fully reverse engineer/work with IDA, etc.

    cleanLayer:
    http://www.ownedcore.com/forums/worl...leanlayer.html (cleanLayer)


    I was hoping if someone might be able to provide some guidance and maybe answer some of these questions for me. Thank in in advance, I appreciate any assistance and will do my best to get this engine updated and provided back for anyone else who would like to work with it.


    1) Has anything materially changed between 5.0 and 6.0? From what I've gathered so far, GUIDs are now 128 bit versus 64.

    2) cleanLayer does the following for LUA script execution using the following functions. Has anything really changed with this method, or will updated offsets allow this same method to work? Or is there an easier way?

    GetTop = Helper.Magic.RegisterDelegate<LuaGetTopDelegate>(Offsets.LuaGetTop);
    SetTop = Helper.Magic.RegisterDelegate<LuaSetTopDelegate>(Offsets.LuaSetTop);
    Type = Helper.Magic.RegisterDelegate<LuaTypeDelegate>(Offsets.LuaType);
    ToLString = Helper.Magic.RegisterDelegate<LuaToLStringDelegate>(Offsets.LuaToLString);
    ToBoolean = Helper.Magic.RegisterDelegate<LuaToBooleanDelegate>(Offsets.LuaToBoolean);
    ToNumber = Helper.Magic.RegisterDelegate<LuaToNumberDelegate>(Offsets.LuaToNumber);
    PCall = Helper.Magic.RegisterDelegate<LuaPCallDelegate>(Offsets.LuaPCall);
    LoadBuffer = Helper.Magic.RegisterDelegate<LuaLoadBufferDelegate>(Offsets.LuaLoadBuffer);

    And uses this logic to call the LUA functions through PCall:

    Code:
    private static List<string> ExecuteInternal(string query, bool withResults)
            {
                if (withResults)
                    query = "return " + query;
                var state = LuaInterface.LuaState;
                int top = LuaInterface.GetTop(state);
    
                var data = Encoding.ASCII.GetBytes(query);
                var memory = Marshal.AllocHGlobal(data.Length + 1);
                try
                {
                    Marshal.Copy(data, 0, memory, data.Length);
                    Marshal.WriteByte(memory + data.Length, 0);
    
                    if (LuaInterface.LoadBuffer(state, memory, data.Length, "cleanCore") > 0)
                        return new List<string> {PopError(state)};
    
                    if (LuaInterface.PCall(state, 0, withResults ? (int)LuaInterface.LuaConstant.MultRet : 0, 0) > 0)
                        return new List<string> {PopError(state)};
    
                    int returnValueCount = LuaInterface.GetTop(state) - top;
                    var ret = new List<string>(returnValueCount);
                    for (int i = 1; i <= returnValueCount; i++)
                        ret.Add(LuaInterface.StackObjectToString(state, i));
                    LuaInterface.Pop(state, returnValueCount);
                    return ret;
                }
                finally
                {
                    Marshal.FreeHGlobal(memory);
                }
            }
    3) Is EnumVisibleObjects still the preferred method of enumerating and updating object states?

    [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
    private delegate int EnumVisibleObjectsCallback(ulong guid, uint filter);

    Since GUIDs are now 128 bit, does the callback for EnumVisibleObjects return the 128 bit guid now? (WoWGuid)

    4) Does anyone have any patterns defined for various internal WoW functions? LUA Functions, Enumerations, etc

    5) Does anyone have any implementations that they are comfortable sharing with me? Just as a reference to allow cleanLayer to be updated.



    Again thank you for your help, I really appreciate it!!

    -Shadow

    Migrate cleanLayer to 6.0
  2. #2
    -Ryuk-'s Avatar Elite User CoreCoins Purchaser Authenticator enabled
    Reputation
    529
    Join Date
    Nov 2009
    Posts
    1,028
    Thanks G/R
    38/51
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you want to use lua like that, you will need to check the functions as at least one of them has checks to make sure its not being called from hacks/bots
    |Leacher:11/2009|Donor:02/2010|Established Member:09/2010|Contributor:09/2010|Elite:08/2013|

  3. #3
    Shadowhunter12's Avatar Member
    Reputation
    1
    Join Date
    Sep 2012
    Posts
    44
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by -Ryuk- View Post
    If you want to use lua like that, you will need to check the functions as at least one of them has checks to make sure its not being called from hacks/bots
    Ryuk, thanks again for your response! Is there a better way of calling LUA besides GetTop, SetTop, LoadBuffer, and PCall?

    Are they monitoring these function's callstacks for bots? If so, they must have started this since MoP began..

    Also, can you possibly verify these updated delegates please?

    (ClntObjMgrObjectPtr)
    private delegate IntPtr GetObjectByGuidDelegate(WoWGuid guid, int filter);

    (ClntObjMgrEnumVisibleObjects)
    internal delegate uint EnumVisibleObjectsDelegate(IntPtr callback, int filter);
    private delegate int EnumVisibleObjectsCallBackDelegate(WoWGuid guid, uint filter);

    (ClntObjMgrGetActivePlayerObj)
    private static GetLocalPlayerPointerDelegate WoWFunction_GetLocalPlayerPointer;

    Thank you again Ryuk!

  4. #4
    JuJuBoSc's Avatar Banned for scamming CoreCoins Purchaser
    Reputation
    1019
    Join Date
    May 2007
    Posts
    922
    Thanks G/R
    1/3
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    private delegate IntPtr GetObjectByGuidDelegate(ref WoWGuid guid, int filter);

  5. #5
    TOM_RUS's Avatar Legendary
    Reputation
    914
    Join Date
    May 2008
    Posts
    699
    Thanks G/R
    0/52
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    "filter" thing is a pointer, just in case you ever decide to use it for x64 where it probably matters.

  6. #6
    Shadowhunter12's Avatar Member
    Reputation
    1
    Join Date
    Sep 2012
    Posts
    44
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by JuJuBoSc View Post
    private delegate IntPtr GetObjectByGuidDelegate(ref WoWGuid guid, int filter);
    Ahh thank you JuJu, I had overlooked the pointer part. By the way, I followed your work on the ESO Radar and LUA.. Really appreciate your contributions!


    Thank you TOM_RUS!

Similar Threads

  1. Free migration when Lich hits. True or false?
    By macho271 in forum World of Warcraft General
    Replies: 5
    Last Post: 08-23-2008, 02:20 AM
  2. Migrate to Russian realms SUCKS
    By Rockerfooi in forum World of Warcraft General
    Replies: 3
    Last Post: 08-06-2008, 07:46 PM
  3. Replies: 4
    Last Post: 06-11-2008, 05:05 PM
  4. Easy migrate a character!
    By INS4N3K1LL in forum WoW EMU Guides & Tutorials
    Replies: 6
    Last Post: 06-11-2008, 01:41 AM
  5. Free Character Migration
    By Unholyshaman in forum World of Warcraft General
    Replies: 0
    Last Post: 12-08-2007, 10:31 AM
All times are GMT -5. The time now is 12:12 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search