[1.12.1] Dll Injection - Get Object Pointer menu

User Tag List

Results 1 to 3 of 3
  1. #1
    Lywbringer's Avatar Member
    Reputation
    11
    Join Date
    Sep 2022
    Posts
    14
    Thanks G/R
    2/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [1.12.1] Dll Injection - Get Object Pointer

    Hello I am new on this forum and I have a question:

    I followed a guide on internet on how to make a bot (https://drewkestell.us/Article/6/Chapter/1) and I suceeded to inject a dll and get the player GUID and a list of all visible objects GUIDs.

    But when I try to use the function GetObjectPtr(ulong guid) defined at GET_OBJECT_PTR_FUN_PTR = 0x00464870 it always returns 0 !

    This is an important function and I can't keep following the tutorial without it.

    I don't know where to start to learn reverse engineering, if you have courses online or tutorials I'll be glad to read them.

    Before making this in-process bot I already made an out of process bot using pixels and lua only but I am limited in my capabilities so I started to look for DLL injection.


    This is the function I am using:

    Code:
    const int GET_OBJECT_PTR_FUN_PTR = 0x00464870;
    
    [UnmanagedFunctionPointer(CallingConvention.StdCall)]
    delegate IntPtr GetObjectPtrDelegate(ulong guid);
    
    static readonly GetObjectPtrDelegate GetObjectPtrFunction =
        Marshal.GetDelegateForFunctionPointer<GetObjectPtrDelegate>((IntPtr)GET_OBJECT_PTR_FUN_PTR);
    
    internal static IntPtr GetObjectPtr(ulong guid) => GetObjectPtrFunction(guid);
    Last edited by Lywbringer; 09-12-2022 at 08:56 PM.

    [1.12.1] Dll Injection - Get Object Pointer
  2. #2
    namreeb's Avatar Legendary

    Reputation
    658
    Join Date
    Sep 2008
    Posts
    1,023
    Thanks G/R
    7/215
    Trade Feedback
    0 (0%)
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    This looks right to me. Maybe try attaching a debugger with a breakpoint at 0x464870 to see what comes in for guid? My only guess is that somehow the arguments are not being passed on the stack correctly by the marshaller.

  3. #3
    Lywbringer's Avatar Member
    Reputation
    11
    Join Date
    Sep 2022
    Posts
    14
    Thanks G/R
    2/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I solved my problem by adding:

    Code:
    [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
    delegate int EnumerateVisibleObjectsCallback(ulong guid, int filter);
    now it returns the GUIDs and Pointers but at the very end the program crash with System.AccessViolationException.

    I tested the code a bit and I think it comes from the function inside the client.

    I simply put:

    Code:
    try {
        EnumerateVisibleObjectsFunction(callback, filter, (IntPtr)ENUMERATE_VISIBLE_OBJECTS_FUN_PTR);
    } catch { }
    And now it works even though it's an ugly way to do it
    Last edited by Lywbringer; 09-14-2022 at 01:45 AM.

Similar Threads

  1. Get Object GUID by Pointer
    By Amrok in forum WoW Memory Editing
    Replies: 3
    Last Post: 09-01-2011, 01:58 PM
  2. Object pointer, player GUID
    By Justink15 in forum WoW Memory Editing
    Replies: 3
    Last Post: 12-19-2008, 12:47 AM
  3. DLL injection with windows SP3
    By Therrm in forum World of Warcraft Bots and Programs
    Replies: 3
    Last Post: 12-06-2008, 03:03 PM
  4. What are the risks with DLL injection?
    By object in forum WoW Memory Editing
    Replies: 14
    Last Post: 08-22-2008, 09:23 PM
  5. Easy way to get object sizes
    By crediar in forum WoW Memory Editing
    Replies: 8
    Last Post: 05-19-2008, 05:07 PM
All times are GMT -5. The time now is 09:06 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