FrameScript_RegisterFunction callback return strange value menu

User Tag List

Results 1 to 6 of 6
  1. #1
    Wildbreath's Avatar Contributor
    Reputation
    162
    Join Date
    Feb 2012
    Posts
    121
    Thanks G/R
    2/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    FrameScript_RegisterFunction callback return strange value

    [solved]

    Hi there!

    Have a "fun" with subject.
    PHP Code:
    [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
    private 
    delegate int LuaFunctionDelegate(string args);
    private static 
    readonly LuaFunctionDelegate callback LuaRegisterCallbackHandler;

    [
    UnmanagedFunctionPointer(CallingConvention.Cdecl)]
    private 
    delegate void LuaRegisterFunction(string szNameIntPtr pFunc);
    private static 
    readonly LuaRegisterFunction RegisterCommandHandler;

    LuaRegisterFunctionHandler Memory.Instance.RegisterDelegate<LuaRegisterFunction>(Offsets.RegisterFunction);
    LuaRegisterFunctionHandler(commandNamePatchInvalidPtr(callback));

    public static 
    int LuaRegisterCallbackHandler(string args){
       return 
    0;

    callback work as intended, but args return a strange values (not as in sender lua function), where i missed?
    (made a CastSpellByID, HandleTerrainClick and etc funcs wrapper, new pqr )
    Last edited by Wildbreath; 03-01-2014 at 06:05 AM. Reason: solved

    FrameScript_RegisterFunction callback return strange value
  2. #2
    namreeb's Avatar Legendary

    Reputation
    658
    Join Date
    Sep 2008
    Posts
    1,023
    Thanks G/R
    7/215
    Trade Feedback
    0 (0%)
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    I'm not entirely sure what you're asking, but I'm pretty sure that the FrameScript::Register function also needs a luaState pointer.

  3. #3
    Wildbreath's Avatar Contributor
    Reputation
    162
    Join Date
    Feb 2012
    Posts
    121
    Thanks G/R
    2/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    register console command - yes, but not register function.
    or you about luaState in callback? (gettop, tonumber arg and etc)
    btw lua_tolstring in callback still crashing wow. dunno why - lua_tonumber working as intended

    http://www.ownedcore.com/forums/worl...tolstring.html (lua_tolstring)
    same trouble ^

  4. #4
    KillerBunnyx's Avatar Private
    Reputation
    1
    Join Date
    Mar 2014
    Posts
    3
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh wow o .o

  5. #5
    xalcon's Avatar Contributor ふたなり
    Authenticator enabled
    Reputation
    198
    Join Date
    Oct 2008
    Posts
    291
    Thanks G/R
    20/58
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    as far as I know, your LuaRegisterCallbackHandler needs to accept an integer (the lua vm handle), so you can get your stuff from/onto the lua stack o.o"
    "Threads should always commit suicide - they should never be murdered" - DirectX SDK

  6. #6
    Wildbreath's Avatar Contributor
    Reputation
    162
    Join Date
    Feb 2012
    Posts
    121
    Thanks G/R
    2/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    just done it, i was trying to return char* as string - fail
    now i research how to create trampoline for c#, patching invalidptrcheck is stupid - it need rewrites for every callback and it detectable (but anyway i should write a jmp to my trampoline... any ideas?)
    Last edited by Wildbreath; 03-03-2014 at 03:39 AM.

Similar Threads

  1. [Question] Lua Callback: Return table of values
    By DrakeFish in forum WoW Memory Editing
    Replies: 6
    Last Post: 06-18-2011, 10:44 PM
  2. LuaStack returning null values
    By miceiken in forum WoW Memory Editing
    Replies: 5
    Last Post: 06-24-2010, 06:25 AM
  3. How to make Checksum return the correct Value
    By Xaser in forum Programming
    Replies: 2
    Last Post: 02-12-2009, 06:30 PM
  4. Getting the return value of Lua_DoString()
    By Nesox in forum WoW Memory Editing
    Replies: 43
    Last Post: 01-15-2009, 06:06 AM
All times are GMT -5. The time now is 02:15 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