SetFacing VMT menu

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    ap0stle2482's Avatar Member
    Reputation
    1
    Join Date
    Oct 2006
    Posts
    5
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    SetFacing VMT

    I am currently trying to set my facing using the setfacing vmt, but so far ive only managed to crash wow

    Code:
    public static void SetFacing(float Angle)
    {
    
    int SetFacingVMT = 19;
    uint pAngle = Endscene.BlackMagic.AllocateMemory(0x4);
    EndScene.BlackMagic.WriteFloat(pAngle, Angle);
    uint VMT = EndScene.BlackMagic.ReadUInt((EndScene.BlackMagic.ReadUInt(LocalPlayer.BaseAddress) + ((uint)SetFacingVMT * 4)));
    
    EndScene.Hook_AsmAddLine("push " + pAngle);
    EndScene.Hook_AsmAddLine("mov ecx, " + LocalPlayer.BaseAddress);
    EndScene.Hook_AsmAddLine("call " + VMT);
    EndScene.Hook_AsmAddLine("retn");
    
    EndScene.Hook_AsmInject();
    
    }
    Couldnt get the above code to work so i changed it to:
    Code:
    public static void SetFacing(float Angle)
    {
    
    uint pAngle = Endscene.BlackMagic.AllocateMemory(0x4);
    EndScene.BlackMagic.WriteFloat(pAngle, Angle);
    
    EndScene.Hook_AsmAddLine("push " + pAngle);
    EndScene.Hook_AsmAddLine("mov ecx, " + LocalPlayer.BaseAddress);
    EndScene.Hook_AsmAddLine("call " + ((uint)Wowbase + 0x55ED70);
    EndScene.Hook_AsmAddLine("retn");
    
    EndScene.Hook_AsmInject();
    
    }
    It doesnt crash wow anymore, but nothing happens, is there another or better way i should be using to set facing or am i just missing something =x
    Last edited by ap0stle2482; 03-23-2011 at 06:28 PM.

    SetFacing VMT
  2. #2
    Edder's Avatar Active Member
    Reputation
    22
    Join Date
    Dec 2008
    Posts
    77
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think its unnecessary to create a new topic and this one isnt that old.

    I have the same problem with SetFacing and I have the same approach as OP and I cant get it to work, I think its alright but it wont work:
    Code:
            public static void SetFacing(float angle)
            {
                uint pAngle = Hook.Memory.AllocateMemory(0x4);
                Hook.Memory.WriteFloat(pAngle, angle);
    
                string[] asm = new string[]
                {
                    "push " + pAngle,                                 // push pAngle in the function (as the first value, right-to-left)
                    "mov ecx, " + Player.BaseAddress,       // make ecx to the Player.BaseAddress -> this
                    "call " + 0x989B70,                            // call the function
                    "retn",
                };
    
                Hook.InjectAndExecute(asm);
            }
    IDA Pseudocode says that its a __thiscall function and I think I followed the calling conventions for thiscall functions...
    the float value is written to the mem and the pointer is pushed into the stack as the first argument, this (playerbase) is moved to ecx like thiscall desired it and then I call the function (without the base because Im working with 3.3.5a, no need for stack cleanup, cause that does the function, whats wrong?

    edit: It must be the float value, because I managed to get UnitReaction to work, this is the same as SetFacing, only SetFacing takes a float instead of a uint and returns a value...
    Last edited by Edder; 08-01-2011 at 03:14 PM.

  3. #3
    miceiken's Avatar Contributor Authenticator enabled
    Reputation
    209
    Join Date
    Dec 2007
    Posts
    401
    Thanks G/R
    7/9
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Missing BaseAddress for the offset aren't you?

  4. #4
    Edder's Avatar Active Member
    Reputation
    22
    Join Date
    Dec 2008
    Posts
    77
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by miceiken View Post
    Missing BaseAddress for the offset aren't you?
    I thought there is no need for the wow base since it's for a 3.3.5a binary?!

  5. #5
    miceiken's Avatar Contributor Authenticator enabled
    Reputation
    209
    Join Date
    Dec 2007
    Posts
    401
    Thanks G/R
    7/9
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Edder View Post
    I thought there is no need for the wow base since it's for a 3.3.5a binary?!
    Oh sorry, didn't read all of your text. Guess you're right then, must be another issue.

  6. Thanks thateuler (1 members gave Thanks to miceiken for this useful post)
  7. #6
    Edder's Avatar Active Member
    Reputation
    22
    Join Date
    Dec 2008
    Posts
    77
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by miceiken View Post
    Oh sorry, didn't read all of your text. Guess you're right then, must be another issue.
    Nevermind, dunno whats wrong though

    UnitReaction works the same way
    Code:
    public static uint UnitReaction(uint baseaddress) { uint pReaction = Hook.Memory.AllocateMemory(0x4); string[] asm = new string[] { "push " + baseaddress, "mov ecx, " + Player.BaseAddress, "call " + 0x7251C0, "mov [" + pReaction + "], eax", "retn", }; Hook.InjectAndExecute(asm); uint reaction = Hook.Memory.ReadUInt(pReaction); Hook.Memory.FreeMemory(pReaction); return reaction; }
    Howto proper push a float on the stack? Im pretty sure its the float which causes the issue.

  8. #7
    _Mike's Avatar Contributor
    Reputation
    310
    Join Date
    Apr 2008
    Posts
    531
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why not just patch InjectAndExecute() to return eax and avoid all this ugly temporary memory allocation?

  9. #8
    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)
    On the topic of SetFacing, maybe the function doesn't pass by pointer. Did you try passing by value?

    EDIT: Better solution than using the virtual functions of your player is to use CGInputControl functions. They work great for mouse-turning, setting facing, etc...
    Last edited by lanman92; 08-03-2011 at 12:39 AM.

  10. #9
    Edder's Avatar Active Member
    Reputation
    22
    Join Date
    Dec 2008
    Posts
    77
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by lanman92 View Post
    On the topic of SetFacing, maybe the function doesn't pass by pointer. Did you try passing by value
    You mean pushing the float directly onto the stack? Yea I tried that, it crashs the client, will look at the inputcontrol.

  11. #10
    _Mike's Avatar Contributor
    Reputation
    310
    Join Date
    Apr 2008
    Posts
    531
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wouldn't byval floats normally go on the fpu stack and not the cpu stack? Note, I haven't looked at the function(s) to see how they handle the arguments and if they are byval or byref. I'm just throwing out random guesses

  12. #11
    MaiN's Avatar Elite User
    Reputation
    335
    Join Date
    Sep 2006
    Posts
    1,047
    Thanks G/R
    0/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by _Mike View Post
    Wouldn't byval floats normally go on the fpu stack and not the cpu stack? Note, I haven't looked at the function(s) to see how they handle the arguments and if they are byval or byref. I'm just throwing out random guesses
    I don't think they do, no. MSVC only returns floating point values on the FPU stack, floating point arguments are sent on the normal stack. At least that's how I recall it.
    [16:15:41] Cypher: caus the CPU is a dick
    [16:16:07] kynox: CPU is mad
    [16:16:15] Cypher: CPU is all like
    [16:16:16] Cypher: whatever, i do what i want

  13. #12
    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 MaiN View Post
    I don't think they do, no. MSVC only returns floating point values on the FPU stack, floating point arguments are sent on the normal stack. At least that's how I recall it.

  14. #13
    MaiN's Avatar Elite User
    Reputation
    335
    Join Date
    Sep 2006
    Posts
    1,047
    Thanks G/R
    0/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Cypher View Post
    [16:15:41] Cypher: caus the CPU is a dick
    [16:16:07] kynox: CPU is mad
    [16:16:15] Cypher: CPU is all like
    [16:16:16] Cypher: whatever, i do what i want

  15. #14
    _Mike's Avatar Contributor
    Reputation
    310
    Join Date
    Apr 2008
    Posts
    531
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by MaiN View Post
    I don't think they do, no. MSVC only returns floating point values on the FPU stack, floating point arguments are sent on the normal stack. At least that's how I recall it.
    Yeah you are right. I guess I must have confused arguments with return values. I just knew the FPU was used for something

  16. #15
    Edder's Avatar Active Member
    Reputation
    22
    Join Date
    Dec 2008
    Posts
    77
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
            public static void SetFacing(float angle)
            {
                string[] asm = new string[]
                {
                    "mov ecx, " + Bot.Player.BaseAddress,
                    "push " + angle,
                    "call " + 0x989B70,
                    "retn",
                };
    
                Hook.InjectAndExecute(asm);
            }
    I was wrong, pushing the stack directly gives an assembly error (-109) no client crash.

Page 1 of 2 12 LastLast

Similar Threads

  1. SetFacing issues (continued)
    By namreeb in forum WoW Memory Editing
    Replies: 19
    Last Post: 05-31-2009, 10:38 AM
  2. Trouble Calling SetFacing from VMT (I think)
    By BraveSoul in forum WoW Memory Editing
    Replies: 1
    Last Post: 03-24-2009, 08:47 AM
  3. Problems calling VMT Function 47
    By djvoid in forum WoW Memory Editing
    Replies: 16
    Last Post: 01-14-2009, 08:22 AM
  4. VMT 36 in ... AutoIt !
    By Robske in forum WoW Memory Editing
    Replies: 12
    Last Post: 11-14-2008, 08:33 PM
  5. Object.Interact() VMT 34
    By Nesox in forum WoW Memory Editing
    Replies: 15
    Last Post: 10-28-2008, 11:00 PM
All times are GMT -5. The time now is 04:10 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