Is there something wrong with my code?(RegiserFunction related) menu

Shout-Out

User Tag List

Results 1 to 7 of 7
  1. #1
    csoldjb's Avatar Member Authenticator enabled
    Reputation
    7
    Join Date
    Jan 2015
    Posts
    20
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Solved]Is there something wrong with my code?(RegiserFunction related)

    I want to call Framescript_RegisterFunction with a injected dll
    here is my code:

    Code:
    m_pfnFramescript_RegisterFunction = (int(_cdecl *)(char *, int(_cdecl *)(void *)))(dwBase + OFFSET_FRAMESCRIPT_REGISTERFUNCTION);
    Code:
    	gHook->m_bHasInitedTimer = true;
    
    	int regSuccess = gHook->m_pfnFramescript_RegisterFunction("CloseProcess", CustomLua_CloseProcess);
    After called register function,I tried to call the lua function,but it show me the gloabl function is nil(Not Registered)
    Can someone help me to correct the error?
    Last edited by csoldjb; 10-28-2015 at 10:27 PM. Reason: Solved

    Is there something wrong with my code?(RegiserFunction related)
  2. #2
    namreeb's Avatar Legendary

    Reputation
    668
    Join Date
    Sep 2008
    Posts
    1,029
    Thanks G/R
    8/222
    Trade Feedback
    0 (0%)
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Are you sure that you have the correct prototype for FrameScript::Register? It used to be __fastcall.

  3. #3
    Jadd's Avatar 🐸 Premium Seller
    Reputation
    1515
    Join Date
    May 2008
    Posts
    2,433
    Thanks G/R
    81/336
    Trade Feedback
    1 (100%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by namreeb View Post
    Are you sure that you have the correct prototype for FrameScript::Register? It used to be __fastcall.
    It uses __cdecl these days.

    Are you using the correct offset? I get 0x00026ACC for the latest patch (x86).

  4. #4
    TOM_RUS's Avatar Legendary
    Reputation
    914
    Join Date
    May 2008
    Posts
    699
    Thanks G/R
    0/52
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Are you registering it while at glue screen or while in game world?

  5. #5
    csoldjb's Avatar Member Authenticator enabled
    Reputation
    7
    Join Date
    Jan 2015
    Posts
    20
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks guys!I finally got it.
    Code:
    m_pfnFramescript_RegisterFunction = (int(_cdecl *)(const char *, int(_cdecl *)(void *)))(dwBase + OFFSET_REGISTERFUNCTION);
    int FrameScript_RegisterEventHook(const char *pszFunctionName, int pfnFunctionPtr(void *luaState))
    {
    	if (!strcmp(pszFunctionName, "GetItemInfo"))
    	{
    		gHook->m_pfnFramescript_RegisterFunction("GetMyPosition", CustomLua_GetMyPosition);
    	}
    	return gHook->m_pfnFramescript_RegisterFunction(pszFunctionName, pfnFunctionPtr);
    }

  6. #6
    csoldjb's Avatar Member Authenticator enabled
    Reputation
    7
    Join Date
    Jan 2015
    Posts
    20
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yep,I got the correct offset

  7. #7
    csoldjb's Avatar Member Authenticator enabled
    Reputation
    7
    Join Date
    Jan 2015
    Posts
    20
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's the problem..I finally hooked this function and registered my function at this time.

Similar Threads

  1. Is there something wrong with my SQL?
    By tyeeeee1 in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 10-30-2011, 02:47 PM
  2. [Mangos] Is there something wrong with my scriptdev2?
    By brydon10 in forum WoW EMU Questions & Requests
    Replies: 1
    Last Post: 06-26-2010, 12:02 PM
  3. Something Wrong with my Spora Page?
    By Corosive720 in forum World of Warcraft Emulator Servers
    Replies: 8
    Last Post: 01-19-2008, 09:10 AM
  4. something wrong with my head
    By Chango99 in forum WoW ME Questions and Requests
    Replies: 4
    Last Post: 04-07-2007, 04:04 PM
  5. Something wrong with My macro :S
    By Sørensen in forum World of Warcraft General
    Replies: 2
    Last Post: 03-22-2007, 08:38 AM
All times are GMT -5. The time now is 04:27 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