Ida script for rename lua functions (wow 64) menu

Shout-Out

User Tag List

Results 1 to 1 of 1
  1. #1
    RivaLfr's Avatar Contributor CoreCoins Purchaser Authenticator enabled
    Reputation
    221
    Join Date
    Sep 2010
    Posts
    258
    Thanks G/R
    2/25
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Ida script for rename lua functions (wow 64)

    Hey,

    I share code for rename lua functions in wow 64 bit:

    Code:
    #include <idc.idc>
    
    /************************************************************************
       Desc:		Label each lua function based on its appropriate name
       Author:  kynox (droidz for wow 64 bit version)
       Credit:	bobbysing for RenameFunc
       Website: http://www.gamedeception.net
    *************************************************************************/
    
    // 1 = Success, 0 = Failure
    static RenameFunc( dwAddress, sFunction )
    {
    	auto dwRet;
    
    	dwRet = MakeNameEx( dwAddress, sFunction, SN_NOWARN );
    
    	if( dwRet == 0 )
    	{
    		auto sTemp, i;
    		for( i = 0; i < 32; i++ )
    		{
    			sTemp = form( "%s_%i", sFunction, i );
    
    			if( ( dwRet = MakeNameEx( dwAddress, sTemp, SN_NOWARN ) ) != 0 )
    			{
    				Message( "Info: Renamed to %s instead of %s\n", sTemp, sFunction );
    				break;
    			}
    		}
    	}
    	return dwRet;	
    }
    
    static Luafunc_GetName( structAddr )
    {
    	return GetString( Qword( structAddr ), -1, ASCSTR_C );
    }
    
    static Luafunc_GetFunc( structAddr )
    {
    	return Qword( structAddr + 8 );
    }
    
    static HandleLuaFunc( structBase )
    {
     	auto funcName, funcAddr;
    	funcName = Luafunc_GetName( structBase );
    	funcAddr = Luafunc_GetFunc( structBase );	
        Message( "Found: %s\n" funcName );
    	RenameFunc( funcAddr, form( "Script_%s", funcName ) );
    }
    
    static main()
    {
    	auto registerFunc, xRef;
    	registerFunc = 0x000000014008A7F0; // FrameScript_RegisterFunction Wow 64 bit 16769
    	
    	for( xRef = RfirstB( registerFunc ); xRef != BADADDR; xRef = RnextB( registerFunc, xRef ) )
    	{
    		auto baseFunc, structBase;
    
    		baseFunc = xRef - 0x27;
    		
    		structBase = Dword(baseFunc + 0xD) + baseFunc + 0xD + 4;
    
    		auto numFuncs, i;
    		numFuncs = Dword( baseFunc + 0x12 );
    		if (numFuncs < 500)
    		{
    			Message( "Found 0x%x, count: 0x%x\n" structBase,  numFuncs);
    			for ( i = 0; i < numFuncs; i++ )
    			{
    				HandleLuaFunc( structBase );
    				
    				structBase = structBase + 0x10;
    			}	
    		}
    	}
    }

    Don't forget to change FrameScript_RegisterFunction address (no rebased):
    Code:
    registerFunc = 0x000000014008A7F0; // FrameScript_RegisterFunction Wow 64 bit 16769
    Last edited by RivaLfr; 03-27-2013 at 02:23 PM.

    Ida script for rename lua functions (wow 64)

Similar Threads

  1. IDA how to rename lua function ?
    By windhuan in forum WoW Memory Editing
    Replies: 3
    Last Post: 12-16-2016, 03:23 PM
  2. IDA Script to Label DB2 for Wow 7 Legion
    By counted in forum WoW Memory Editing
    Replies: 0
    Last Post: 07-25-2016, 07:42 AM
  3. [IDA Script][Mac][4.1] Marking LUA functions
    By Tanaris4 in forum WoW Memory Editing
    Replies: 2
    Last Post: 04-23-2011, 12:37 AM
  4. Addresses for core lua functions
    By ggg898 in forum WoW Memory Editing
    Replies: 4
    Last Post: 06-04-2009, 05:24 PM
  5. Replies: 22
    Last Post: 05-29-2008, 03:52 PM
All times are GMT -5. The time now is 04:52 PM. 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