Small request (sorta...) menu

Shout-Out

User Tag List

Results 1 to 7 of 7
  1. #1
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Small request (sorta...)

    I'm not a big fan of the API set available in BlackMagic. (Btw, Shynd, ****ing awesome library you created.)

    I decided to do a rewrite of the structure of his library. (The back end is fairly similar, except for an OOP design, and being thread safe.)

    Anyhow, the following is a small snippet of code from a quick test program. (Granted, most of it doesn't actually work, and is a quick copy/paste from some of the stuff found around here, converted to Voodoo API.)

    Code:
    using System;
    using Voodoo;
    
    namespace VoodooTest
    {
        class Program
        {
            private static uint g_clientConnection = 0x011CA260;
            private static uint s_curMgr;
            private static Memory mgr;
            static void Main()
            {
                Console.WindowWidth = Console.LargestWindowWidth;
                mgr = new Memory("World of Warcraft");
                g_clientConnection = mgr.Read<uint>(g_clientConnection);
                s_curMgr = mgr.Read<uint>(0x011CA260, 0x2864);
                string name = mgr.ReadString(0x11CA298, true);
                Console.WriteLine(name);
                ReadObjectList();
                Console.WriteLine(LuaDoString("TargetLastTarget()"));
                Console.ReadLine();
            }
    
            static uint LuaDoString(string luaString)
            {
                using (CodeCave cc = mgr.CreateCodeCave(luaString.Length + 1))
                {
                    cc.WriteString(luaString, true);
                    using (CodeCave cc1 = mgr.CreateCodeCave())
                    {
                        // A few ways to inject ASM :)
    
                        /*
                        cc1.AsmAddLine("mov EDX, [0x0{0}]", g_clientConnection.ToString("X"));
                        cc1.AsmAddLine("mov EDX, [EDX+0x{0}]", s_curMgr.ToString("X"));
                        cc1.AsmAddLine("FS mov EAX, [0x2C]");
                        cc1.AsmAddLine("mov EAX, [EAX]");
                        cc1.AsmAddLine("add EAX, 8");
                        cc1.AsmAddLine("mov [EAX], EDX"); // End UpdateCurMgr
    
                        cc1.AsmAddLine("mov ecx, 0x0092E887");
                        cc1.AsmAddLine("mov eax, " + cc.AllocationAddress);
                        cc1.AsmAddLine("push ecx");
                        cc1.AsmAddLine("push eax");
    
                        cc1.AsmAddLine("push eax");
                        cc1.AsmAddLine("mov eax, 0x0077DEF0");
                        cc1.AsmAddLine("call eax");
                        cc1.AsmAddLine("add esp, 0xC");
                        cc1.AsmAddLine("retn")
    
                        return cc1.AsmInjectAndExecute();
                         */
    
    
                        /*
                         cc1.AsmAddLine("mov EDX, [0x0" + g_clientConnection.ToString("X"),
                                       "mov EDX, [EDX+0x" + s_curMgr.ToString("X"),
                                       "FS mov EAX, [0x2C]",
                                       "mov EAX, [EAX]",
                                       "add EAX, 8",
                                       "mov [EAX], EDX",
                         
                                       "mov ecx, 0x0092E887",
                                       "mov eax, " + cc.AllocationAddress,
                                       "push ecx",
                                       "push eax",
                         
                                       "push eax",
                                       "mov eax, 0x0077DEF0",
                                       "call eax",
                                       "add esp, 0xC",
                                       "retn");
                         */
    
                        return cc1.AsmInjectAndExecute(
                                       "mov EDX, [0x0" + g_clientConnection.ToString("X"),
                                       "mov EDX, [EDX+0x" + s_curMgr.ToString("X"),
                                       "FS mov EAX, [0x2C]",
                                       "mov EAX, [EAX]",
                                       "add EAX, 8",
                                       "mov [EAX], EDX",
    
                                       "mov ecx, 0x0092E887",
                                       "mov eax, " + cc.AllocationAddress,
                                       "push ecx",
                                       "push eax",
    
                                       "push eax",
                                       "mov eax, 0x0077DEF0",
                                       "call eax",
                                       "add esp, 0xC",
                                       "retn");
                    }
                }
            }
    
            static void ReadObjectList()
            {
                ulong localGuid = mgr.Read<ulong>(s_curMgr + 0xC0);
                Console.WriteLine("LocalGUID: 0x{0:X016}", localGuid);
                uint curObj = mgr.Read<uint>(s_curMgr + 0xAC);
                while (curObj != 0 && (curObj & 1) == 0)
                {
                    uint curpObj = mgr.Read<uint>(curObj + 0x8);
                    ulong objGuid = mgr.Read<ulong>(curpObj + ((uint)eObjectFields.OBJECT_FIELD_GUID * 4)); // 0x0
                    float X = mgr.Read<float>(curpObj + ((uint)eGameObjectFields.GAMEOBJECT_POS_X * 4));
                    float Y = mgr.Read<float>(curpObj + ((uint)eGameObjectFields.GAMEOBJECT_POS_Y * 4));
                    float Z = mgr.Read<float>(curpObj + ((uint)eGameObjectFields.GAMEOBJECT_POS_Z * 4));
                    float Facing = mgr.Read<float>(curpObj + ((uint) eGameObjectFields.GAMEOBJECT_FACING * 4));
                    int Type = mgr.Read<int>(curpObj + ((uint) eObjectFields.OBJECT_FIELD_TYPE * 4));
                    Console.WriteLine(
                            "Type: {6} Object: 0x{0:X08} -- GUID: 0x{1:X016} X: {2} Y: {3} Z: {4} Facing: {5}", curObj,
                            objGuid, X, Y, Z, Facing, (eObjType)Type);
                    uint nextObj = mgr.Read<uint>((curObj + 0x3C));
                    if (nextObj == curObj)
                        break;
                    curObj = nextObj;
                }
            }
        }
    }
    Again, don't expect any of that to actually compile, or make sense in some parts. (I know for a fact some of it won't work, but as I said, it's just an API example.)

    (Keep in mind, I've tried to eliminate the need to provide addresses for a good chunk of things, as well as the annoying hProc stuff. Also drastically simplified quite a few things such as the Read/Write methods. They are now generic, and can be used as so;

    Read<datatype>(address);
    Read<datatype>(address1, address2, address3); // This does a triple level read. I.E: [[[0x004]+0x05]+0x5022] in one method call. Instead of Read(Read(Read()));

    Write<datatype>(address, value);

    The only downside, is Read/WriteBytes is still it's own method, as is Read/WriteString. However, Read/WriteString now takes an address, and a bool determining whether it's ASCII or not. (Can be split easily, I just prefer having less methods needed.)

    Security tokens are now set properly. And you can tell a CodeCave to inject your function in a VEH. (Not at the moment, as I've been too lazy to write that small snippet of code)

    There are some utility things as well, just to make your life easier. MainWindowTitle in the Memory class has a getter, and setter. So you can easily change the window title on the process you're working on. (Does nothing if there's no window title)

    You can control multiple threads at once. (It's not limited to controlling a single thread. Just call myMemMgr.OpenThreads and it will return a dictionary of int, ThreadInfo. ThreadInfo contains a handle to the open thread, and an IsOpen bool. (Simple enough.)

    A whole bunch of other stuff as well.

    (Function detouring/hooking will be in soon once I get around to porting some stuff over)

    The CodeCave class is just a small wrapper around FASM and an easy way to create code caves. (Hence the name...)

    Note, you CAN get access to the base FASM object, however, it's recommended that you not. This removes the need for you guys to reference it in your project, and allows it to be updated by just dropping it in. Instead of having to do a whole bunch of updates within your project.

    So my 'request' is, any API things you'd like to see, or do like in BlackMagic that would be helpful. Or things you don't like.

    P.S: Credit to Shynd for his library, and credit to whoever's functions I ripped. (I forget who...)
    Last edited by Apoc; 12-24-2008 at 03:41 PM.

    Small request (sorta...)
  2. #2
    Geminix86's Avatar Member
    Reputation
    1
    Join Date
    Sep 2006
    Posts
    20
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I spent the last several hours pouring over the information in the LUA thread they linked to me in my other post. I've run into the same road blocks everyone else is, it seems. I need the return values of a few functions. UnitHealth, UnitHealthMax, UnitMana, UnitManaMax, UnitLevel, UnitDetailedThreatSituation, UnitName, UnitExists, UnitInParty, UnitInRaid, UnitIsDeadOrGhost, UnitClass, UnitRace, HasFullControl, GetSpellBonusHealing, UnitCastingInfo.

    If you can make it so it will return the actual values returned by the functions, that's really all I need. Mind you, some of those functions return multiple values / types. And being able to reliably get the values I need is currently all that's stopping me from moving on to the next step on my project.

    That being said, I have no idea what you're doing, but it sounds great. I wish I knew enough to contribute something real. Until then, I can be thankful there are people like you willing to share their findings.

  3. #3
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This isn't a WoW specific library. It's a general memory reading/writing library. However, I suppose I can write up a decently feature-full library for WoW at some point.

  4. #4
    Shynd's Avatar Contributor
    Reputation
    97
    Join Date
    May 2008
    Posts
    393
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Very nice.

  5. #5
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1358
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You stole my VEH idea. I want a refund.

  6. #6
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Cypher View Post
    You stole my VEH idea. I want a refund.
    No. You wanted SEH. :P

  7. #7
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1358
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Apoc View Post
    No. You wanted SEH. :P
    Fix the potential race condition issues ******. You will get a medal for writing the first ever C# library that doesn't suffer from a potential race condition bug.

Similar Threads

  1. Small request list
    By dawn1414 in forum WoW ME Questions and Requests
    Replies: 1
    Last Post: 09-16-2007, 12:42 PM
  2. A *small* request :3
    By Sinikarhu in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 05-29-2007, 04:45 AM
  3. Small request aimed for the model editers now abouts
    By majos90 in forum WoW ME Questions and Requests
    Replies: 1
    Last Post: 05-01-2007, 09:08 AM
  4. Small request aimed for the model editers know abouts
    By majos90 in forum WoW ME Questions and Requests
    Replies: 1
    Last Post: 03-24-2007, 09:33 PM
  5. a small request
    By Elt- in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 01-08-2007, 11:51 AM
All times are GMT -5. The time now is 03:20 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search