CastSpellByID Weird asm crash menu

Shout-Out

User Tag List

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

    CastSpellByID Weird asm crash

    Code:
    __asm
    {
    	push 0
    	push 0
    	push 0
    	push 78
    	mov eax, [OFFSET_LUACASTSPELLBYID]//Offset is OK
    	call eax //<-- Crash after the call.
    	add esp, 0x10
    }
    EDIT: Oh and yeah, im calling it from WoW's main thread, so its not about the TLS.

    The exact error is an access violation while trying to read from 0x5E, very strange.
    Any ideas why?


    Leo
    Last edited by xLeo123; 01-11-2010 at 12:12 PM.

    CastSpellByID Weird asm crash
  2. #2
    akh's Avatar Member
    Reputation
    4
    Join Date
    Mar 2008
    Posts
    39
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I guess you have to give a little more info on the error message, but you could try using a function pointer instead of asm:

    Code:
    typedef bool ( __cdecl * tCastSpellById )( unsigned long, unsigned long, WGUID, unsigned long );
    tCastSpellById oCastSpellById = (tCastSpellById)gpWoWX->GetFindPattern()->GetAddress( "CastSpellById" );
    oCastSpellById( dwSpellId, 0, targetGuid, 0 );
    Edit:
    Just noticed that you are using
    mov eax, [OFFSET_LUACASTSPELLBYID]//Offset is OK
    It could be that you are using the wrong offset, the current offset for CastSpellById is 0x007E6700
    Last edited by akh; 01-11-2010 at 12:04 PM.

  3. #3
    xLeo123's Avatar Member
    Reputation
    1
    Join Date
    Jan 2009
    Posts
    27
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yup, i've tried using a typedef too,

    Code:
    typedef bool(__cdecl* fnCastSpellByID)(unsigned int SpellID,unsigned int Unk2,unsigned int Unk3, unsigned int Unk4);
    ...
    fnCastSpellByID LUACastSpellByID;
    ...
    LUACastSpellByID = (fnCastSpellByID)OFFSET_LUACASTSPELLBYID;
    ...
    bool ret = LUACastSpellByID(78,0,0,0);//Heroic Strike (R1)
    Gives the exact same error..

    EDIT:
    Turns out here is where the code is crashing, apparently according to Visual Studio 2010:

    Code:
    /***
    * _unlock - Release multi-thread lock
    *
    *Purpose:
    *       Note that it is legal for a thread to aquire _EXIT_LOCK1
    *       multiple times.
    *
    *Entry:
    *       locknum = number of the lock to release
    *
    *Exit:
    *
    *Exceptions:
    *
    *******************************************************************************/
    
    void __cdecl _unlock (
            int locknum
            )
    {
            /*
             * leave the critical section.
             */
            LeaveCriticalSection( _locktable[locknum].lock ); <-- Access violation reading 0x5E here..
    }
    Last edited by xLeo123; 01-11-2010 at 12:08 PM.

  4. #4
    akh's Avatar Member
    Reputation
    4
    Join Date
    Mar 2008
    Posts
    39
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What about the offset, it looks like you are using the Lua_CastSpellById offset

  5. #5
    xLeo123's Avatar Member
    Reputation
    1
    Join Date
    Jan 2009
    Posts
    27
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The offset is 0x4D6FC0, which is correct according to the current build (11159)
    ???

  6. #6
    akh's Avatar Member
    Reputation
    4
    Join Date
    Mar 2008
    Posts
    39
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, thats the offset for the Lua_CastSpellByID, try using the offset for CastSpellById: 0x007E6700.

    If you are going to use the Lua version you must pass the Lua state and some other parameters I guess.

  7. #7
    xLeo123's Avatar Member
    Reputation
    1
    Join Date
    Jan 2009
    Posts
    27
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sir, you are a genius. THANK YOU! By the way, how did you find this offset? Lua_X is easy because it's clearly labeled as a string in IDA, but what about the pure versions like this?

    Thanks!!

  8. #8
    akh's Avatar Member
    Reputation
    4
    Join Date
    Mar 2008
    Posts
    39
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try searching for CFindPattern either on this site or on GameDeception and you will find more info on how to find function addresses.

  9. #9
    flo8464's Avatar Active Member
    Reputation
    30
    Join Date
    Apr 2009
    Posts
    434
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    By the way, how did you find this offset? Lua_X is easy because it's clearly labeled as a string in IDA, but what about the pure versions like this?
    Open lua_CastSpellById in IDA and reverse the function. The luafunction also has to call the gamefunction
    It is pretty simple.

    Try searching for CFindPattern either on this site or on GameDeception and you will find more info on how to find function addresses.
    That is the leecher way and you learn nothing by doing it.
    It is ok for updating your code, but for sure no help to get better in anything.
    Hey, it compiles! Ship it!

  10. #10
    Seifer's Avatar Site Donator
    Reputation
    129
    Join Date
    Apr 2007
    Posts
    270
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you have LUA.DoString() working properly, you could also use:

    Code:
    /// <summary>
            /// Casts a spell by ID.
            /// </summary>
            /// <param name="SpellID">Spell ID</param>
            /// <param name="SpellBook">Pet or Spell, depending on the caster.</param>
            public static void CastSpellByID(int SpellID, string SpellBook)
            {
                if (SpellID >= 0 && !string.IsNullOrEmpty(SpellBook))
                {
                    Lua.DoString("CastSpellByID(\"" + SpellID + "\", \"" + SpellBook + "\")", "hax.lua", 0);
                }
            }
    Not a direct answer to your question, but hey, it works! Ship it!

  11. #11
    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)
    Code:
    typedef void (__cdecl * tCastSpell)(const int SpellId, const int Unknown1, const int Unknown2, const int Unknown3, const int Unknown4);
    tCastSpell oCastSpell = reinterpret_cast<tCastSpell>(0x007E6700);
    This one work fine for me.

  12. #12
    Nesox's Avatar ★ Elder ★
    Reputation
    1280
    Join Date
    Mar 2007
    Posts
    1,238
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    UREDOINITWRONG!

    const unsigned int CastSpellById = 0x007E6700;
    const unsigned int SpellId = 78;

    push 0
    push 0
    push 0
    push SpellId
    call CastSpellById
    add esp, 0x10
    retn
    Last edited by Nesox; 01-12-2010 at 03:13 PM.

  13. #13
    hamburger12's Avatar Contributor CoreCoins Purchaser
    Reputation
    87
    Join Date
    Jan 2010
    Posts
    297
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Mh this don't work for me :S he injected it and then nothing happens... He just stand there and don't cast -.- my code:

    DWORD CastSpellById = 0x007E6700;

    void Castspell(unsigned int SpellId)
    {
    __asm
    {
    push 0
    push 0
    push 0
    push 1443
    call CastSpellById
    add esp, 0x10
    }
    }

  14. #14
    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)

  15. #15
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cypher, you are a fag.

Page 1 of 2 12 LastLast

Similar Threads

  1. Weird Custom Zone Crashing
    By Xmaily in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 11-22-2015, 05:37 PM
  2. Replies: 11
    Last Post: 05-12-2014, 04:52 AM
  3. Weird WndProc hook : Crash when zoning/loading into game
    By nippel in forum Elder Scrolls Online Memory Editing
    Replies: 11
    Last Post: 04-25-2014, 09:30 AM
  4. Weird issues calling CastSpellByID
    By hypnodok in forum WoW Memory Editing
    Replies: 17
    Last Post: 12-13-2008, 08:35 PM
  5. weird dancing
    By Avianar47 in forum World of Warcraft Exploits
    Replies: 3
    Last Post: 07-25-2006, 11:59 AM
All times are GMT -5. The time now is 08:34 PM. 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