[Sample Code] EndScene Hook with ASM and blackmagic menu

User Tag List

Page 4 of 6 FirstFirst 123456 LastLast
Results 46 to 60 of 90
  1. #46
    Ozius's Avatar Corporal
    Reputation
    1
    Join Date
    Feb 2010
    Posts
    24
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, Hook statut: true
    The problem arises at performance LuaDoString->MyHook.InjectAndExecute(asm).
    There is a cycling in line: while (Memory.ReadInt(addresseInjection) > 0) { Thread.Sleep(5); } // Wait to launch code

    LuaDoString
    Code:
    public static void LuaDoString(string command)
            {
                // Allocate memory
                uint DoStringArg_Codecave = MyHook.Memory.AllocateMemory(Encoding.UTF8.GetBytes(command).Length + 1);
                // offset:
                uint FrameScript__Execute = 0x39D7F0;
    
    
                // Write value:
                MyHook.Memory.WriteBytes(DoStringArg_Codecave, Encoding.UTF8.GetBytes(command));
    
                // Write the asm stuff for Lua_DoString
                String[] asm = new String[] 
                {
                    "mov eax, " + DoStringArg_Codecave,
                    "push 0",
                    "push eax",
                    
                    "push eax",
                    "mov eax, " + (uint)FrameScript__Execute, // Lua_DoString
                    
                    "call eax",
                    "add esp, 0xC",
                    "retn",    
                };
    
                // Inject
                MyHook.InjectAndExecute(asm);
                // Free memory allocated 
                MyHook.Memory.FreeMemory(DoStringArg_Codecave);
            }
    Tried to make so: uint FrameScript__Execute = 0x39D7F0 + BaseAdress;
    Hasn't helped. ..
    Thanks for the help.

    [Sample Code] EndScene Hook with ASM and blackmagic
  2. #47
    CrimeTime's Avatar Active Member
    Reputation
    20
    Join Date
    Dec 2007
    Posts
    83
    Thanks G/R
    16/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    public static void LuaDoString(string command)
            {
                // Allocate memory
                uint DoStringArg_Codecave = MyHook.Memory.AllocateMemory(Encoding.UTF8.GetBytes(command).Length + 1);
                // offset:
                uint FrameScript__Execute = 0x39D7F0;
    
    
                // Write value:
                MyHook.Memory.WriteBytes(DoStringArg_Codecave, Encoding.UTF8.GetBytes(command));
    
                // Write the asm stuff for Lua_DoString
                String[] asm = new String[] 
                {
                    "mov eax, " + DoStringArg_Codecave,
                    "push 0",
                    "push eax",
                    
                    "push eax",
                    "mov eax, " + ((uint)BaseAdress+(uint)FrameScript__Execute), // Lua_DoString
                    
                    "call eax",
                    "add esp, 0xC",
                    "retn",    
                };
    
                // Inject
                MyHook.InjectAndExecute(asm);
                // Free memory allocated 
                MyHook.Memory.FreeMemory(DoStringArg_Codecave);
            }
    should work now fine

  3. #48
    Ozius's Avatar Corporal
    Reputation
    1
    Join Date
    Feb 2010
    Posts
    24
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Doesn't work, already all has tried...
    Program.cs: http://dl.dropbox.com/u/7381029/Program.cs

  4. #49
    CrimeTime's Avatar Active Member
    Reputation
    20
    Join Date
    Dec 2007
    Posts
    83
    Thanks G/R
    16/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    dont use
    uint ENDSCENE_IDX = 0xA8;
    use:
    uint ENDSCENE_IDX = 0xAC;
    ( You have to change it two times!)

  5. #50
    fukmeimbroken's Avatar Member
    Reputation
    1
    Join Date
    Jun 2008
    Posts
    27
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by CrimeTime View Post
    dont use
    uint ENDSCENE_IDX = 0xA8;
    use:
    uint ENDSCENE_IDX = 0xAC;
    ( You have to change it two times!)
    Still the same.

  6. #51
    CrimeTime's Avatar Active Member
    Reputation
    20
    Join Date
    Dec 2007
    Posts
    83
    Thanks G/R
    16/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no if i had use the 0xA8 it doesnt worked for me, then i've tried it with 0xAC and it work for me

  7. #52
    fukmeimbroken's Avatar Member
    Reputation
    1
    Join Date
    Jun 2008
    Posts
    27
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by CrimeTime View Post
    no if i had use the 0xA8 it doesnt worked for me, then i've tried it with 0xAC and it work for me
    Yes the Hook seems to work with both but Lua Do String doesn't works with both. Must be a mistake somewhere.

  8. #53
    Millow's Avatar Member
    Reputation
    5
    Join Date
    Mar 2007
    Posts
    49
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The address of endscene in the VMT is 42, 42*4 = 168 = 0xA8. I will have to try when I get home, but if it works with 0xAC and 0xA8, then there's something wrong for sure with the hook. CrimeTime, do you mean your hook works or that you saw your character dance on the screen ? Because I can't see how that's possible if you use 0xAC.

    Anyhow, I might be wrong.
    "What can be asserted without proof can be dismissed without proof." --- Christopher Hitchens

  9. #54
    CrimeTime's Avatar Active Member
    Reputation
    20
    Join Date
    Dec 2007
    Posts
    83
    Thanks G/R
    16/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    tested before a Minute
    Code:
    LuaDoString("DoEmote(\"Dance\")");
    works for me

  10. #55
    fukmeimbroken's Avatar Member
    Reputation
    1
    Join Date
    Jun 2008
    Posts
    27
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by CrimeTime View Post
    tested before a Minute
    Code:
    LuaDoString("DoEmote(\"Dance\")");
    works for me
    Woot the ****? And if you check his Code http://dl.dropbox.com/u/7381029/Program.cs the only difference is the 0xA8 / 0xAC?

  11. #56
    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)
    Originally Posted by Millow View Post
    The address of endscene in the VMT is 42, 42*4 = 168 = 0xA8. I will have to try when I get home, but if it works with 0xAC and 0xA8, then there's something wrong for sure with the hook. CrimeTime, do you mean your hook works or that you saw your character dance on the screen ? Because I can't see how that's possible if you use 0xAC.

    Anyhow, I might be wrong.
    Because 0xAC is Clear func and can be hooked the same way, and is called every frame too.

  12. #57
    Millow's Avatar Member
    Reputation
    5
    Join Date
    Mar 2007
    Posts
    49
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by JuJuBoSc View Post
    Because 0xAC is Clear func and can be hooked the same way, and is called every frame too.
    All right, thx for the info.
    But I've just tried his code and doesn't work for me, I will have to call this BS (the fact that he got this working) unless someone proves otherwise to me.

    fukme ? Does it work for you ?

  13. #58
    CrimeTime's Avatar Active Member
    Reputation
    20
    Join Date
    Dec 2007
    Posts
    83
    Thanks G/R
    16/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    have someone got the code to get a return of a DoString?

  14. #59
    fukmeimbroken's Avatar Member
    Reputation
    1
    Join Date
    Jun 2008
    Posts
    27
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No millow sry :/.

    Originally Posted by CrimeTime View Post
    have someone got the code to get a return of a DoString?
    Me and millow doesn't even get the DoString to work may you share your Code with us.

  15. #60
    CrimeTime's Avatar Active Member
    Reputation
    20
    Join Date
    Dec 2007
    Posts
    83
    Thanks G/R
    16/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i've post all to fix it all what Millow and you got to do is put it in your code.
    If there are still errors post it here.

    now to my Problem:
    i try to get a Return of the LuaDostring with this
    Code:
                        LuaDoString("test = CanSendAuctionQuery()");
                        test = GetLocalizedText("test");
    here the GetLocalizedText Function:
    Code:
     public static string GetLocalizedText(string Commandline)
            {
                // Command to send using LUA
                String Command = Commandline;
                var proc = Process.GetProcessesByName("Wow");
                IntPtr WoWBase = proc[0].MainModule.BaseAddress;
                // Allocate memory for command
                uint Lua_GetLocalizedText_Space = MyHook.Memory.AllocateMemory(Encoding.UTF8.GetBytes(Command).Length + 1);
    
                // offset:
                uint ClntObjMgrGetActivePlayerObj = 0x93AD0;
                uint FrameScript__GetLocalizedText = 0x1C4190;
    
                // Write command in the allocated memory
                MyHook.Memory.WriteBytes(Lua_GetLocalizedText_Space, Encoding.UTF8.GetBytes(Command));
    
                String[] asm = new String[] 
                {
                "call " + ((uint)WoWBase + ClntObjMgrGetActivePlayerObj),
                "mov ecx, eax",
                "push -1",
                
                "mov edx, " + Lua_GetLocalizedText_Space,
                "push edx",
                
                "call " + ((uint)WoWBase + FrameScript__GetLocalizedText),
                "retn",
                };
    
                // Inject the shit
                string sResult = Encoding.ASCII.GetString(MyHook.InjectAndExecute(asm));
    
                // Free memory allocated for command
                MyHook.Memory.FreeMemory(Lua_GetLocalizedText_Space);
    
                // Uninstall the hook
                return sResult;
            }
    Wow Crashes me after string sResult = Encoding.ASCII.GetString(MyHook.InjectAndExecute(asm));

Page 4 of 6 FirstFirst 123456 LastLast

Similar Threads

  1. [C# DLL] aHook, use ASM through EndScene hook
    By JuJuBoSc in forum WoW Memory Editing
    Replies: 81
    Last Post: 1 Day Ago, 02:55 PM
  2. Sample Code - Another way of getting the EndScene address
    By _Mike in forum WoW Memory Editing
    Replies: 22
    Last Post: 05-14-2011, 08:30 PM
  3. [C#] CLR hosting using C# and BlackMagic (ASM)
    By JuJuBoSc in forum WoW Memory Editing
    Replies: 9
    Last Post: 05-10-2011, 08:44 AM
  4. Replies: 11
    Last Post: 12-23-2010, 09:30 PM
  5. [Test Theory] EndScene hook without Native Code (Kinda)
    By Apoc in forum WoW Memory Editing
    Replies: 7
    Last Post: 09-04-2009, 12:46 PM
All times are GMT -5. The time now is 03:45 AM. 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