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