[C# DLL] aHook, use ASM through EndScene hook menu

User Tag List

Page 6 of 6 FirstFirst ... 23456
Results 76 to 82 of 82
  1. #76
    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)

    [C# DLL] aHook, use ASM through EndScene hook
  2. #77
    HeroXx's Avatar Member
    Reputation
    1
    Join Date
    Feb 2008
    Posts
    36
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cheers for that

  3. #78
    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)
    Code:
    
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Magic;
    using System.Diagnostics;
    using aHook;
    namespace TestaHook
    {
    class Program
    {
    static uint BaseAdress;
    static void Main(string[] args)
    {
    Hook EndScene = new Hook(aProcess.GetProcessIdByName("Wow"));
    Process[] Processes = Process.GetProcessesByName("Wow");
    ProcessModule pm = Processes[0].MainModule;
    BlackMagic Memory = new BlackMagic(Processes[0].Id);
    BaseAdress = (uint)pm.BaseAddress;
    uint DX_DEVICE = 0x97E7F4 + BaseAdress;
    uint DX_DEVICE_IDX = 0x27C4;
    uint ENDSCENE_IDX = 0xA8;
     
    uint pDevice = Memory.ReadUInt(DX_DEVICE);
    uint pEnd = Memory.ReadUInt(pDevice + DX_DEVICE_IDX);
    uint pScene = Memory.ReadUInt(pEnd);
    uint pEndScene = Memory.ReadUInt(pScene + ENDSCENE_IDX);
    Console.WriteLine(EndScene.Hook_Install(pEndScene).ToString());
     
    // Command to send using LUA
    //String Command = "print(\"EndScene hooked!\");";
    String Command = "DoEmote(\"dance\")";
    // Allocate memory for command
    uint DoString_space = EndScene.BlackMagic.AllocateMemory(Encoding.UTF8.GetBytes(Command).Length + 1);
    // Write command in the allocated memory
    EndScene.BlackMagic.WriteBytes(DoString_space, Encoding.UTF8.GetBytes(Command));
    uint DoString = BaseAdress + 0x39D7F0;
    // Write the asm stuff for Lua_DoString
    EndScene.Hook_AsmAddLine("mov eax, " + DoString_space);
    EndScene.Hook_AsmAddLine("push 0");
    EndScene.Hook_AsmAddLine("push eax");
    EndScene.Hook_AsmAddLine("push eax");
    EndScene.Hook_AsmAddLine("mov eax, " + DoString); // Lua_DoString
    EndScene.Hook_AsmAddLine("call eax");
    EndScene.Hook_AsmAddLine("add esp, 0xC");
    EndScene.Hook_AsmAddLine("retn");
    // Inject the shit
    EndScene.Hook_AsmInject();
    // Free memory allocated for command
    EndScene.BlackMagic.FreeMemory(DoString_space);
    // Uninstall the hook
    EndScene.Hook_Remove();
    Console.ReadLine();
    }
    }
    }
    There you go guys, I finally managed to get my LuaDoString working, updated for 4.0.3, I hope you enjoy it, cause damn, I do !!!! Finally !
    Any questions, I'll try to answer them with my noob knowledge...
    "What can be asserted without proof can be dismissed without proof." --- Christopher Hitchens

  4. #79
    mongoosed's Avatar Member
    Reputation
    1
    Join Date
    Feb 2007
    Posts
    55
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    rapidshare is horrible, suggest reuploading somewhere decent.

  5. #80
    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)
    And how then will look GetLocalizedText? For me don't work:

    Code:
    // Allocate memory for command
                uint Lua_GetLocalizedText_Space = EndScene.BlackMagic.AllocateMemory(Encoding.UTF8.GetBytes(Command).Length + 1);
               
                // offset:
                uint ClntObjMgrGetActivePlayerObj = 0x3550 + BaseAdress;
                uint FrameScript__GetLocalizedText = 0x1C4190 + BaseAdress;
    
                // Write command in the allocated memory
                EndScene.BlackMagic.WriteBytes(Lua_GetLocalizedText_Space, Encoding.UTF8.GetBytes(Command));
    
                EndScene.Hook_AsmAddLine("call " + (uint)ClntObjMgrGetActivePlayerObj);
                EndScene.Hook_AsmAddLine("mov ecx, eax");
                EndScene.Hook_AsmAddLine("push -1");
                EndScene.Hook_AsmAddLine("mov edx, " + Lua_GetLocalizedText_Space);
                EndScene.Hook_AsmAddLine("push edx");
                EndScene.Hook_AsmAddLine("call " + (uint)FrameScript__GetLocalizedText);
                EndScene.Hook_AsmAddLine("retn");
    
                uint inject = EndScene.Hook_AsmInject();
    
                String injectr = "null";
                if (inject != 0)
                {
                    injectr = EndScene.BlackMagic.ReadASCIIString(inject, 20);
                }
    
                // Free memory allocated for command
                EndScene.BlackMagic.FreeMemory(Lua_GetLocalizedText_Space);
                // Uninstall the hook
                EndScene.Hook_Remove();
                Console.WriteLine(injectr);
    Execute in LuaDoString: "freeslots = GetContainerNumFreeSlots(0) + GetContainerNumFreeSlots(1) + GetContainerNumFreeSlots(2) + GetContainerNumFreeSlots(3) + GetContainerNumFreeSlots(4); print(freeslots);";
    Command = "freeslots";
    Display: null
    Last edited by Ozius; 11-21-2010 at 08:21 AM.

  6. #81
    ranassa's Avatar Member
    Reputation
    1
    Join Date
    Oct 2010
    Posts
    37
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that's the same for me running GetLocalizedText,i got nothing.
    i can make it dance ingame but i can't DoLuaString without character logging,however,iHook can do that perfect

    who can give me some point on this two problem?don't say just use iHook is ok

  7. #82
    kanewalker505's Avatar Member
    Reputation
    1
    Join Date
    Apr 2024
    Posts
    1
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Doubt anyone still has these project files laying around but if you do please for the love of god reupload them

Page 6 of 6 FirstFirst ... 23456

Similar Threads

  1. [Sample Code] EndScene Hook with ASM and blackmagic
    By RivaLfr in forum WoW Memory Editing
    Replies: 89
    Last Post: 05-13-2021, 03:26 PM
  2. CEGUI - EndScene Hook - DLL Function Call
    By Orix in forum WoW Memory Editing
    Replies: 5
    Last Post: 02-12-2011, 03:51 PM
  3. [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
  4. EndScene Hook not changing anything
    By lanman92 in forum WoW Memory Editing
    Replies: 32
    Last Post: 06-01-2009, 11:46 PM
  5. Some Useful ASM info
    By Hausmaster in forum WoW Memory Editing
    Replies: 1
    Last Post: 03-23-2008, 06:32 PM
All times are GMT -5. The time now is 07:07 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