[SourceCode & Question] CastSpell by ID with SendPacket menu

User Tag List

Results 1 to 4 of 4
  1. #1
    RivaLfr's Avatar Contributor CoreCoins Purchaser Authenticator enabled
    Reputation
    221
    Join Date
    Sep 2010
    Posts
    258
    Thanks G/R
    2/25
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [SourceCode & Question] CastSpell by ID with SendPacket

    Hi there,

    I work in the systeme to launch aoe spell with SendPacket.

    I can cast a basic spell (spell without target, and without position)

    This is my code:

    Code:
        [StructLayout(LayoutKind.Explicit, Size = 0x18)]
        public struct DataStore
        {
            [FieldOffset(0x0)]
            public int ptrDataStore; // pDataStore1,pDataStore2
            [FieldOffset(0x4)]
            public int ptrPacketData; //pointer to packet data
            [FieldOffset(0x8)]
            public int UnKnown1; //always 0
            [FieldOffset(0xC)]
            public int MayType; // 0x100 for normal, 0x300 for warden
            [FieldOffset(0x10)]
            public int PacketLen; //data length
            [FieldOffset(0x14)]
            public int UnKnown3; //always 0
        }
    
        [StructLayout(LayoutKind.Explicit, Size = 0x12)]
        public struct SpellPacket
        {
            [FieldOffset(0x0)]
            public int OpCode;
            [FieldOffset(0x4)]
            public byte Count;
            [FieldOffset(0x5)]
            public ushort SpellID;
        }
    
        public class SendPacket
        {
            public static void pulse(int spellId)
            {
                uint ClientConnection__SendPacket = 0x90670;
                uint dataStore1 = 0x6AECB8;
                uint currentConnection = 0x8B3F78;
    
                int CMSG_CAST_SPELL = 0x4C56;
    
                UInt32 codeCaveDatastore = Memory.Memory.MyHook.Memory.AllocateMemory(Marshal.SizeOf(typeof(DataStore)));
                UInt32 codeCavePacketData = Memory.Memory.MyHook.Memory.AllocateMemory(Marshal.SizeOf(typeof(SpellPacket)));
    
        
                //Packet
                SpellPacket spellPacket = new SpellPacket();
                spellPacket.OpCode = CMSG_CAST_SPELL;
                spellPacket.Count = 0;
                spellPacket.SpellID = (ushort)spellId;
                //DataStore:
                DataStore dataStore = new DataStore();
                dataStore.ptrDataStore = (int)dataStore1;
                dataStore.ptrPacketData = (int)codeCavePacketData;
                dataStore.UnKnown1 = 0;
                dataStore.MayType = 0x100;
                dataStore.PacketLen = Marshal.SizeOf(typeof(SpellPacket));       
                dataStore.UnKnown3 = 0;
                
               
    
                // WRITE
                // DataStore:
                Memory.Memory.MyHook.Memory.WriteObject(codeCaveDatastore, dataStore, typeof(DataStore));
                //Packet
                Memory.Memory.MyHook.Memory.WriteObject(codeCavePacketData, spellPacket, typeof(SpellPacket));
              
                string[] asm = new string[]
                    {
                    "mov ecx, [" + (uint)((uint)Process.Process.wowModule + (uint)currentConnection) + "]",
                    "push " + (uint)codeCaveDatastore,
                    "mov ebx, " + (uint)((uint)Process.Process.wowModule + (uint)ClientConnection__SendPacket),
                    "call ebx",
                    "@out:",
                    "retn",
                     };
    
                Memory.Memory.MyHook.InjectAndExecute(asm);
    
                Memory.Memory.MyHook.Memory.FreeMemory(codeCaveDatastore);
                Memory.Memory.MyHook.Memory.FreeMemory(codeCaveDatastore);
            }
        }

    This code work, but I not find the packet structure for cast spell by position.

    Thank
    Last edited by RivaLfr; 02-07-2011 at 03:12 PM.

    [SourceCode & Question] CastSpell by ID with SendPacket
  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)
    Have you looked at Mangos, etc?

  3. #3
    RivaLfr's Avatar Contributor CoreCoins Purchaser Authenticator enabled
    Reputation
    221
    Join Date
    Sep 2010
    Posts
    258
    Thanks G/R
    2/25
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    With my packet monitor I find this:

    Code:
    56 4C 00 00 ; OPcode +0
    03 ; Count +4
    01 A9 ; Spell ID +5
    00 00 00 00 00 00 00 ; ??? +7
    40 00 ; SpellType +14
    00 00 00  ; ??? + 16
    DB 72 DB 44  ; X +19
    9C 1D 8D C5  ; Y +23
    56 38 DD 41 ; Z + 27
    
    In C#:
    
        [StructLayout(LayoutKind.Explicit, Size = 0x1F)]
        public struct SpellPositionPacket
        {
            [FieldOffset(0x0)]
            public int OpCode;
            [FieldOffset(0x4)]
            public byte Count;
            [FieldOffset(0x5)]
            public ushort SpellID;
            [FieldOffset(0xE)]
            public ushort SpellType;
            [FieldOffset(0x13)]
            public float X;
            [FieldOffset(0x17)]
            public float Y;
            [FieldOffset(0x1B)]
            public float Z;
        }

  4. #4
    reggggg's Avatar Member
    Reputation
    1
    Join Date
    Sep 2009
    Posts
    22
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Count?

    padding

Similar Threads

  1. [Question] Need some help with sometihng.
    By Hellgawd in forum World of Warcraft Emulator Servers
    Replies: 10
    Last Post: 01-04-2008, 03:26 PM
  2. [Question] Adding Custom Items with Cutom Display ID's??
    By Reshnaak in forum World of Warcraft Emulator Servers
    Replies: 8
    Last Post: 12-22-2007, 10:59 AM
  3. [Question] More help needed with loading screen
    By Despite in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 11-05-2007, 07:33 PM
  4. [Question] Finding textures assosicated with a m2?
    By merfed in forum WoW ME Questions and Requests
    Replies: 1
    Last Post: 10-15-2007, 09:09 AM
  5. 2 questions I need help with
    By Kal-El in forum World of Warcraft General
    Replies: 4
    Last Post: 11-25-2006, 03:00 AM
All times are GMT -5. The time now is 01:35 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