CastSpellById Help menu

User Tag List

Results 1 to 4 of 4
  1. #1
    naa's Avatar Contributor
    Reputation
    100
    Join Date
    Oct 2006
    Posts
    63
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CastSpellById Help

    Hello, i have been trying to get CastSpellById to work but i keep getting an error: Injection failed for some reason.
    Code:

    Code:
            public bool CastSpellByID(uint id)
            {
                Console.WriteLine("Castspell");
                uint codeCave = wow.AllocateMemory();
                const uint CastSpellID = 0x007735F0;
    
                wow.Asm.Clear();
                wow.Asm.AddLine("fs mov eax, [0x2C]");
                wow.Asm.AddLine("mov eax, [eax]");
                wow.Asm.AddLine("add eax, 8");
                wow.Asm.AddLine("mov dword [eax], {0}", CurMgr);
    
                wow.Asm.AddLine("push 0");
                wow.Asm.AddLine("push 0");
                wow.Asm.AddLine("push 0");
                wow.Asm.AddLine("push {0}", id);
    
                wow.Asm.AddLine("call {0}", CastSpellID);
                wow.Asm.AddLine("add esp,16");
                wow.Asm.AddLine("retn");
    
                wow.Asm.InjectAndExecute(codeCave); //<-- This line makes the error
                wow.FreeMemory(codeCave);
                return true;
            }
    The code that calls the function:

    Code:
          BlackMagic wow;
          UInt32 g_clientConnection, clientConnection, CurMgr, CurMgrOffset;
    
          private const string PATTERN_CLIENT_CONNECTION = "EB 02 33 C0 8B D 00 00 00 00 64 8B 15 00 00 00 00 8B 34 8A 8B D 00 00 00 00 89 81 00 00 00 00";
          private const string MASK_CLIENT_CONNECTION = "xxxxxx????xxx????xxxxx????xx????";
         Public go()
         {
                uint dwCodeLoc;
                wow = new BlackMagic();
                if (wow.OpenProcessAndThread(SProcess.GetProcessFromProcessName("wow")))
                {
                    dwCodeLoc = SPattern.FindPattern(wow.ProcessHandle, wow.MainModule, PATTERN_CLIENT_CONNECTION, MASK_CLIENT_CONNECTION, ' ');
    
                    g_clientConnection = wow.ReadUInt(dwCodeLoc + 0x16);
                    clientConnection = wow.ReadUInt(g_clientConnection); 
                    CurMgrOffset = wow.ReadUInt(dwCodeLoc + 0x1C);
                    CurMgr = wow.ReadUInt(clientConnection + CurMgrOffset);
    
                    Console.WriteLine("CLIENT_CONNECTION: 0x{0:X08}", clientConnection);
                    Console.WriteLine("CURMGR_OFFSET: 0x{0:X08}", CurMgrOffset);
                    Console.WriteLine("CurMgr: 0x{0:X08}", CurMgr);
                    Console.ReadLine();
                    CastSpellByID(2050); //Lesser Heal rank 1
                }
                else
                {
                    Console.WriteLine("World of Warcraft could not be opened for read/write.");
                }
        }
    I am rather new to ASM and memory programming.
    Last edited by naa; 01-25-2009 at 08:14 AM.

    CastSpellById Help
  2. #2
    Robske's Avatar Contributor
    Reputation
    305
    Join Date
    May 2007
    Posts
    1,062
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    is FASM.dll in your output directory?
    "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
    "I cried a little earlier when I had to poop" - Sku

  3. #3
    naa's Avatar Contributor
    Reputation
    100
    Join Date
    Oct 2006
    Posts
    63
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Robske007a View Post
    is FASM.dll in your output directory?
    Yes got:
    BlackMagic.dll
    fasmdll_managed.dll
    FASM.DLL

    in my output dir.
    BlackMagic and fasmdll_manged is set as references and i am "using Magic;"

  4. #4
    naa's Avatar Contributor
    Reputation
    100
    Join Date
    Oct 2006
    Posts
    63
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm I tried to move the code to a new project and now it works
    I did not change anything so dunno what stopped it from working before.
    If anyone needs a CastSpellById the above code works (Copied from around the board so credits to Shynd and others).
    But thanks for you help

Similar Threads

  1. HELP: Gold Scam Exploit
    By GoldDragon in forum World of Warcraft General
    Replies: 11
    Last Post: 01-23-2007, 07:26 PM
  2. Banner Ad Redesign help
    By Matt in forum Community Chat
    Replies: 57
    Last Post: 07-08-2006, 08:40 PM
  3. Help WoW Fish-Bot
    By Eliteplague in forum World of Warcraft General
    Replies: 1
    Last Post: 05-07-2006, 08:36 PM
  4. Hit points and talent points? Please help
    By hankusdankus in forum World of Warcraft General
    Replies: 6
    Last Post: 05-04-2006, 02:00 PM
  5. bot help
    By xwhitedeathx in forum World of Warcraft General
    Replies: 3
    Last Post: 05-01-2006, 03:50 AM
All times are GMT -5. The time now is 04:29 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