[theory] alt method to get object list via codecave menu

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 27
  1. #1
    abuckau907's Avatar Active Member
    Reputation
    49
    Join Date
    May 2009
    Posts
    225
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [theory] alt method to get object list via codecave

    Basic theory is this.

    There are functions in wow that loop over the object list (duh). Apparently there is more than one. Anyway.

    Patch one of those functions to run our own byte code. The byte code will copy a (the) register to a buffer inside the bytecode. (it will also keep a counter variable at the very end of the bytecode)

    Problem: There is no way to know when the wow function is done running, which means all we can do is blindly read the buffer. But I think there are ways to make sure you get an up-to-date list. If you make the buffer long enough (ie. 2x actual object list length) the wow function will run multiple times and fill the buffer, basically treating it like a circular stack. The 2x length is crucial. Basically there will be 2 very similar lists in the buffer, once you figure out where each one is, you have 2 copies of the list: 1 old complete list, 1 new and possibly incomplete.?

    I'm stuck on the actual codecave code atm. Just trying to copy a register to array. Haven't got it yet.

    Code:
                 '_codeCaveCtrLoc = end of the buffer - 4 'ie. Int32
                 '_codeCaveDumpStart = _codeCaveStart + 200 'assuming 200 bytes is enough for my code
                 '_objMgrListGiveAddr = wow.exe code that uses a register to store object.baseaddress
                .AppendLine("push eax")
                .AppendLine("push ebx")
                .AppendLine("push ecx")
                ''Check counter
                .AppendLine("mov eax, " & _codeCaveCtrLoc.ToInt32.ToString)
                .AppendLine("mov ebx, [eax]") 'ebx = curIndex
                .AppendLine("cmp ebx, 999") '
                  .AppendLine("jle 6")        'If
                .AppendLine("mov [eax], 0") 'reset index
                .AppendLine("add [eax], 1") 'Else increment index
                ''write ebx to list
                ''ebx = _codeCaveDumpStartLoc + (indx * 4)
                .AppendLine("mov ebx, " & _codeCaveDumpStartLoc.ToInt32.ToString)
                .AppendLine("mov ecx, [eax]")
                .AppendLine("add ebx, ecx * 4") 'howto?
                .AppendLine("pop eax")
                .AppendLine("mov [ebx], eax") 'magic happens right here
                .AppendLine("pop ebx")
                .AppendLine("pop ecx")
                .AppendLine("jmp " & _objMgrListGiverAddr.ToInt32.ToString)
    
    * 999 is hardcoded. will change to some MAX_SIZE constant once i feel comfortable I know how big the list gets.
    * jle 6 --might not be 6, I'm using fasm_managed (credits*) to assemble the bytecode. Will debug the
    byteCode jmps once i get the array index part working.
    Any thoughts on the basic principal? (or my asm mistake?)

    edit: fixed comments.
    *obviously I did the "mov [ecx], 0" wrong. I keep trying to move value/reg/valueOfReg incorrectly. learning. fixed in image 2 comments down.
    **jmp was wrong too. I just now started viewing the codecave with CE (because it shows opcodes in assembly too, very nice), and noticed it was
    actually jumping backwards! (instead of jumping past the next instruction::how i implement my loop counter)
    one thing I'm unsure about: the fixed coded is "jle 20" which is "Jump near if less than or equal to. But the 20 confuses me. it's relative to the beginning of the codecave location not the current instruction location which I thought it would be? It compiles to ** 02 which is "some jmp type" + 02 so it's actually doing what I want, jmping ahead 1 inctruction. just not sure why it's "+20" for the jle, not +02. <--has something to do with how fasm_managed compiles "jle 20" .
    Last edited by abuckau907; 11-08-2012 at 08:53 AM.

    [theory] alt method to get object list via codecave
  2. #2
    bigtimt's Avatar Active Member
    Reputation
    41
    Join Date
    Mar 2008
    Posts
    100
    Thanks G/R
    2/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why would you want to do this? If you want to use a function, just call ClntObjMgrObjectPtr and walk the linked list backwards.

  3. #3
    abuckau907's Avatar Active Member
    Reputation
    49
    Join Date
    May 2009
    Posts
    225
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by bigtimt View Post
    Why would you want to do this? If you want to use a function, just call ClntObjMgrObjectPtr and walk the linked list backwards.
    Because I don't have IDA. only cheat engine. and I can find those functions that access .baseaddress easily in CE. ie. I can't use IDA but still..in theory..

    working on asm still, will update soon.

    ClntObjMgrObjectPtr - First time seeing this and I can't find it myself so I'm trying to become better at 'this' and hopefully that will lead to FirstObjectAddress
    which is all i care about.

    I guess you're thinking, since i'm injecting code, why not just call local wow functions from my codecave? -- because I don't know how. And if I did, I don't know how to find the functions using only .net or CE <--needs to be this simple if i'm ever going to update it patch to patch. I have a findPattern() but don't know how to actually use IDA to find the function names/locations etc(?). So I use CE, which has functionality similar to what i can do in memoryManager class. :/
    Last edited by abuckau907; 11-08-2012 at 08:08 AM.

  4. #4
    abuckau907's Avatar Active Member
    Reputation
    49
    Join Date
    May 2009
    Posts
    225
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Working on the codecave.

    I create the byte code and write it into wow space (haven't patched wow.exe and made it run the codecave yet)
    codecave doesn't run wow.exe's orig code yet. doing that now. it's 3:38am..process is slow.

    note: on line 6EC0017 ecx = 6EC002A which is important codecave code! but, because of how i implemented the if _ctr < 999 loop, _ctr is always at least 1, which is important 2 lines downs, where it actually writes to the array.

    *I realize by posting this, (if they cared) warden could scan for my codecave in it's own ram. noted.

    theory edit: Once you have first object in list, and knowing "NextObject" offset (relatively easy to figure out once you know the baseaddress of every object ), you can loop over the objmgr list. duh. This means, once you *know* the nextObject offset, and you have a big list of possible addresses, you can sort through them to find which object has no other object pointing to it, ie. the first object?? *This is A LOT of unnecessary sorting again, my whole goal is to reliably find FirstObjectAddress.
    Last edited by abuckau907; 11-08-2012 at 07:59 AM.

  5. #5
    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)
    or you can call EnumVisibleObjects passing your codecave as a callback which populate a list.

  6. #6
    abuckau907's Avatar Active Member
    Reputation
    49
    Join Date
    May 2009
    Posts
    225
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    "EnumVisibleObjects"

    how would i 'discover' this myself lol? What happens if wow stops exporting functions names in it's binary? (ie. packing?). Basically I don't know wth EnumVisibleObjects is, and don't want to ask how to find it because..i didn't think of that question myself. :/

    I'm entirely open to calling wow functions. I guess I just don't know how to look up the functions / will that process change :/ Everything I've done so far is in CheatEngine which is pretty basic, but that's why I like it.

    EnumVisibleObjects sounds amazing tho

    edit: wow will never be packed* just an excuse. Just saying, I've never seen that functionName before now.
    Last edited by abuckau907; 11-08-2012 at 08:44 AM.

  7. #7
    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)
    Originally Posted by abuckau907 View Post
    What happens if wow stops exporting functions names in it's binary?
    Nothing. Because it never exported anything useful.

  8. #8
    abuckau907's Avatar Active Member
    Reputation
    49
    Join Date
    May 2009
    Posts
    225
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    TOM_RUS -- Open IDA --> Open wow.exe, you get TONS of strings and function names etc? Isn't that how I'm supposed to find EnumVisibleObjects .? But I don't want to do it that way :/ ?

  9. #9
    Frosttall's Avatar Active Member
    Reputation
    64
    Join Date
    Feb 2011
    Posts
    261
    Thanks G/R
    16/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The symbolnames have been published as debugbuild once ago and now do we recalculate the addresses every time a new binary is released with the tools BinDiff or PatchDiff for IDA.

    Why do you waste your time on fixing your bugs instead of learning how to use IDA properly? http://www.ownedcore.com/forums/worl...ple-stuff.html ([Tutorial] How to find simple stuff)

  10. #10
    abuckau907's Avatar Active Member
    Reputation
    49
    Join Date
    May 2009
    Posts
    225
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    because I don't want to rely on the magic that is IDA. Maybe someday you open wow.exe with it and don't see any strings. :/ I'd rather not *rely* on IDA. The way I'm doing it should lead to the object list. Only using memory read/write, without using ida. That's all I really want.

    to stay generic. Maybe the next mmorpg i get interested in won't give strings in ida. ?? <--dumb?
    ^^so maybe this shouldn't be in wow section? It's very wow specific tho.
    Last edited by abuckau907; 11-08-2012 at 09:33 AM.

  11. #11
    bigtimt's Avatar Active Member
    Reputation
    41
    Join Date
    Mar 2008
    Posts
    100
    Thanks G/R
    2/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You don't have to have the first object in the object list to enumerate objects. Find a static address for you player and walk the linked list backwards, when the first object is hit the list wraps back to the end. Just enumerate until you hit your player again.

    Code:
    public IntPtr GetPreviousObject(IntPtr pObject)
    {
        return Memory.ReadIntPtr(pObject + 0x24) - 0x24;
    }

  12. #12
    Frosttall's Avatar Active Member
    Reputation
    64
    Join Date
    Feb 2011
    Posts
    261
    Thanks G/R
    16/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by abuckau907 View Post
    because I don't want to rely on the magic that is IDA. Maybe someday you open wow.exe with it and don't see any strings. :/ I'd rather not *rely* on IDA. The way I'm doing it should lead to the object list. Only using memory read/write, without using ida. That's all I really want.

    to stay generic. Maybe the next mmorpg i get interested in won't give strings in ida. ?? <--dumb?
    ^^so maybe this shouldn't be in wow section? It's very wow specific tho.
    Again: You can get the functionnames for IDA on your own by using BinDiff or PatchDiff. Some other names can be received by scripts which loop for example trough the lua-engine (don't know the correct name right now), search for the error message if you're passing a wrong input and extract the name of the Lua-Function. Something like this can be done with every game as soon as they have an API or store any types of strings.

    Right now do you search for the objects via CheatEngine: You could search for your local object, look what references to it, open these addresses with IDA and will see a function which we know as "EnumVisibleObjects". It will have a random name if you haven't loaded the symbol names, but you can rename the function yourself by rightclicking it.

    To keep the function names between different binary versions you can use BinDiff/PatchDiff again and will keep all your names and things like that. This applies to all games and programs - not only WoW!

  13. #13
    abuckau907's Avatar Active Member
    Reputation
    49
    Join Date
    May 2009
    Posts
    225
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I said i don't want to use ida so you give me two more program to use with it. super. *******

  14. #14
    abuckau907's Avatar Active Member
    Reputation
    49
    Join Date
    May 2009
    Posts
    225
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @bigtimt Thank you, I didn't know the local player was for sure the beginning or end of the list. Tis helpful.
    (how do you walk the list backwards: i thought each object only pointed forward? ie objBase + NextObjOffst = NextObject.Base How would you do that in reverse? without brute forcing? nvm, thnx for the tip, I'm done for the day.
    tbh i'm giving up on wow (too many ppl do it already) and starting swtor as soon as I can buy a new graphics card. thank anyway.
    Last edited by abuckau907; 11-08-2012 at 07:36 PM.

  15. #15
    abuckau907's Avatar Active Member
    Reputation
    49
    Join Date
    May 2009
    Posts
    225
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For those who care

    Got the code-cave complete.


    Got the code-cave copying over the eax register (ie the .baseaddress of an object)


    semi-verify that it's outputting valid data.
    The addresses are very close to my localplayer.health --seems legit.

    right on**** yeah.

    Althought these might not be the object's .BaseAddress, could be some pointer inside each object?? Will start debugging soon --> i know health offset is 1294H, so i'll start checking for health values, and if I find them, i know these are baseaddresses.
    Last edited by abuckau907; 11-09-2012 at 02:00 AM.

Page 1 of 2 12 LastLast

Similar Threads

  1. [Theory] A method to not get caught while autoclicking.
    By skyth in forum World of Warcraft General
    Replies: 2
    Last Post: 11-13-2010, 09:46 PM
  2. Easy way to get object sizes
    By crediar in forum WoW Memory Editing
    Replies: 8
    Last Post: 05-19-2008, 05:07 PM
  3. Funny method to get attention, without caps or spam.
    By raffe in forum World of Warcraft Guides
    Replies: 10
    Last Post: 12-14-2007, 04:40 PM
  4. Eumerating the object list.
    By raindog in forum WoW Memory Editing
    Replies: 4
    Last Post: 12-08-2007, 11:27 PM
  5. [INFO] Halloween Game Object List
    By Hellgawd in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 11-06-2007, 10:45 PM
All times are GMT -5. The time now is 12:59 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