FrameScript_RegisterFunction Fail menu

User Tag List

Results 1 to 3 of 3
  1. #1
    Harland's Avatar Member
    Reputation
    8
    Join Date
    Oct 2007
    Posts
    50
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    FrameScript_RegisterFunction Fail

    It's embarrassing posting this but it's been driving me nuts for the past two nights. I can't seem to figure out why my RegisterFunctionHandler never hits 0x004181B0 on a hardware breakpoint in Olly.



    As you can see I'm using the current(3.3.5a) FrameScript_RegisterFunction address at 0x004181B0 with Apoc's Lua Class as per ->.

    To be sure OllyDBG was not being a dill (or me), I HWBP'd the FrameScript_Execute (aka DoString) at 0x00819210, and indeed when I invoke my DoStringHandler, control jumps to OllyDbg.

    Running a trace on the instantiation of the Lua static class it is certainly being called by my EndScene Pulse detour.

    IDA with HexRays shows the function prototype for FrameScript_RegisterFunction has not changed.

    What have a I clearly missed that is causing my RegisterCommandHandler to fail?

    C# Code (Courtesy of Apoc):
    Code:
    Magic _Magic;
    [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
    public delegate uint LuaRegisterCommand(string szName, IntPtr pFunc);
    
    [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
    public delegate int RegisteredLuaCommandHandler(IntPtr pLuaState);
    
    static Lua()
    {
        _Magic = new Magic();
    
        Process.EnterDebugMode();
    
        RegisterCommandHandler = _Magic.RegisterDelegate<LuaRegisterCommand>(0x004181B0);
                
        try
        {
             RegisterCommand("MyInput", CommandParser);
             System.Windows.Forms.MessageBox.Show("Registered");
         }
         catch (Exception e)
         {
             System.Windows.Forms.MessageBox.Show("RegisterCommandFail"+e.Message);
         }
    }
    
    public static void RegisterCommand(string commandName, RegisteredLuaCommandHandler handler)
    {
          RegisterCommandHandler(commandName, WriteLuaCallback(Marshal.GetFunctionPointerForDelegate(handler)));
          return;
    }
    Some code has been removed for brevity. WriteLuaCallback has been omitted; all you need to know is an IntPtr is returned that points to a Jump within the code segment.

    Just so you know a MessageBox appears displaying "Registered" indicating RegisterCommand at least did not raise an exception. Also rendering in Wow halts during the time the MessageBox is active (ie. in process in Wow's main thread).

    Ohwell let me know if anyone has a hint to where it may be failing.

    EDIT: Sorry during my rush to go to the movies last night (BTW Inception = AWESOME. Go see it!), I accidentally hit back on the browser and some of my post had been deleted.
    Last edited by Harland; 07-26-2010 at 09:10 PM.

    FrameScript_RegisterFunction Fail
  2. #2
    caytchen's Avatar Contributor
    Reputation
    138
    Join Date
    Apr 2007
    Posts
    162
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No idea why you don't hit that hardware breakpoint, but for starters your FrameScript_RegisterFunction seems off. Real one is at 0x00817F90. Prototype is
    Code:
    void __cdecl FrameScript_RegisterFunction(char* functionName, int (__cdecl* function)(void*/*LuaState*/))
    but I guess thats in your code already.
    Last edited by caytchen; 07-26-2010 at 12:51 PM.

  3. #3
    Harland's Avatar Member
    Reputation
    8
    Join Date
    Oct 2007
    Posts
    50
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by caytchen View Post
    No idea why you don't hit that hardware breakpoint, but for starters your FrameScript_RegisterFunction seems off. Real one is at 0x00817F90. Prototype is
    Code:
    void __cdecl FrameScript_RegisterFunction(char* functionName, int (__cdecl* function)(void*/*LuaState*/))
    but I guess thats in your code already.
    Correct I have a delegate that handles that, I'll have to do a closer inspection tonight. Although I'm sure Starcraft II is going to distract me.

Similar Threads

  1. Server connection failed!
    By dromeztah in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 10-08-2007, 03:38 PM
  2. How do you fix "The app failed to initialize properly(0xc0150002)"?
    By explode13 in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 08-30-2007, 07:34 PM
  3. My own try,failed...
    By Mysti- in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 07-20-2007, 11:51 PM
  4. funny failed backflips
    By Sacrifice in forum Screenshot & Video Showoff
    Replies: 0
    Last Post: 07-14-2007, 12:18 PM
  5. Few model changes. please help :) , tryed self and failed
    By luddo9 in forum WoW ME Questions and Requests
    Replies: 12
    Last Post: 07-04-2007, 12:32 PM
All times are GMT -5. The time now is 03:49 AM. 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