Skip to content
View in the app

A better way to browse. Learn more.

WRobot

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Getting offsets/opcodes

Featured Replies

Hello how can i get offsets from wow memory?
I need a methods which will return NetClient connection state, num characters in charselect menu, get characters names from characterselect menu or charractercreate functions for different wow versions, but i can't get returned value from Lua.DoStiring, while bot is not in game. The only way is reading data from wow memory? If is true, how i can get this offsets?
 

  • Pudge changed the title to Getting offsets/opcodes

You need to use GetText to read if you are not ingame. here is the c++ code : 

 

note GetLocalizedText uses active client player object, but GetText doesnt.

 

image.thumb.png.260b34bbb59dea4102ca61b4508918a5.png

  • Author
21 hours ago, Nax said:

You need to use GetText to read if you are not ingame. here is the c++ code : 

 

note GetLocalizedText uses active client player object, but GetText doesnt.

 

image.thumb.png.260b34bbb59dea4102ca61b4508918a5.png

But how i can return value to variable?

So LuaDoString is FrameScriptExecute, and it casts the results of your code to a variable, then GetLocalizedText reads that veriable (@druids) just has LuaDoString return info. instead of two functions, he combinded both together. 

 

you need to write the asm for GetText Offset = 0x0819d40, Sample Asm code : https://www.ownedcore.com/forums/world-of-warcraft/world-of-warcraft-bots-programs/wow-memory-editing/407197-getlocalizedtext-problem.html

 

not gonna lie, its kinda funny that GetLocalizedText uses GetText, 

 

image.png.74ec12e1e2fd5742687620fffc412062.png

  • Author
public static string GetText(string commandline)
    {
        try
        {
            string s = commandline;
            if (s.Replace(" ", "").Length <= 0)
                return "";
            uint address = wManager.Wow.Memory.WowMemory.Memory.AllocateMemory(Encoding.UTF8.GetBytes(s).Length + 1);
            if (address <= 0U)
                return "";
            
            //uint ClntObjMgrGetActivePlayerObj = 0x4038F0; 
            //uint FrameScript__GetLocalizedText = 0x7225E0;
            uint FrameScript_GetText = 0x0819d40;
            wManager.Wow.Memory.WowMemory.Memory.WriteBytes(address, Encoding.UTF8.GetBytes(s));
            string[] asm = new string[]
        {
                "push 0",
                "push -1",
                "mov edx, " + address,
                "push edx",
                "call " + (FrameScript_GetText + wManager.Wow.Memory.WowMemory.Memory.MainModuleAddress) ,
                "add esp, 0Ch",
                "retn"
        };
            
            string _Text = Encoding.UTF8.GetString(wManager.Wow.Memory.WowMemory.InjectAndExecute(asm,true));
            wManager.Wow.Memory.WowMemory.Memory.FreeMemory(address);
            return _Text;
        }
        catch (Exception ex)
        {
            Logging.WriteError("[GetText]: error " + ex);
        }
        return "";
    }

 

This code just kills the client wow, I don't understand what's wrong with it, it's very similar to the code from the forum link you posted on

Hi, the correct code is :

    public static string GetTextFixed(string commandline)
    {
        uint FrameScript_GetText = 0x0819d40;

        var commandByte = System.Text.Encoding.UTF8.GetBytes(commandline + "\0");
        var luaGetLocalizedTextSpace = wManager.Wow.Memory.WowMemory.AllocData.Get(commandByte.Length);
        var rCodecave = wManager.Wow.Memory.WowMemory.AllocData.Get(IntPtr.Size);

        if (luaGetLocalizedTextSpace <= 0)
            return "";

        wManager.Wow.Memory.WowMemory.Memory.WriteBytes(luaGetLocalizedTextSpace, commandByte);
        wManager.Wow.Memory.WowMemory.Memory.WritePtr(rCodecave, 0);

        var asm = new[]
        {
            wManager.Wow.Memory.WowMemory.CallWrapperCodeRebaseEsp(FrameScript_GetText, 0x0C, luaGetLocalizedTextSpace, -1, 0),
            "mov ecx, " + rCodecave,
            "mov [ecx], eax",
            wManager.Wow.Memory.WowMemory.RetnToHookCode
        };

        wManager.Wow.Memory.WowMemory.InjectAndExecute(asm);
        var sResult = string.Empty;
        var a = wManager.Wow.Memory.WowMemory.Memory.ReadPtr(rCodecave);
        if (a > 0)
            sResult = wManager.Wow.Memory.WowMemory.Memory.ReadStringUTF8(a);
        if (string.IsNullOrEmpty(sResult))
            sResult = string.Empty;

        wManager.Wow.Memory.WowMemory.AllocData.Free(luaGetLocalizedTextSpace);
        wManager.Wow.Memory.WowMemory.AllocData.Free(rCodecave);

        return sResult;
    }

 

  • Author

@Droidz thank you for this snippet, it works and will be very useful for me.
But old wrobot versions, like "WRobot_7.3.5_26365_final" does not have such class like "AllocData". 
Which method from the old libraries can replace the missing one?
 

Spoiler

image.png.c8a741c4a7f9b0cff40966531b97aff4.png

 

@Pudgeto be honest, that code might not work with patch 7.3.5, the code above is for wotlk. May need to use Ida and see what GetText asm is as they might of changed it.

  • Author
On 3/26/2023 at 8:52 AM, Nax said:

@Pudgeto be honest, that code might not work with patch 7.3.5, the code above is for wotlk. May need to use Ida and see what GetText asm is as they might of changed it.

Hey, i understand it, but i cannot check new offsets because this snippet doesnot work on old wrobot legion

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.