The idc script I used to get this info. May not work with current patch
x86 version
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;
auto part = substr( GetFunctionName( dwAddress ), 0, 7 );
if ( part != "Script_" )
{
auto oldName = GetFunctionName( dwAddress );
dwRet = MakeNameEx( dwAddress, sFunction, SN_NOWARN );
if( dwRet == 0 )
{
auto sTemp, i;
for( i = 1; 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;
}
}
if( i == 31)
Message( "-- Error --: Failed to rename %s -> %s\n", oldName, sFunction );
}
else
Message( "-- Renamed --: %s -> %s\n", oldName, sFunction );
}
return dwRet;
}
static Luafunc_GetName( structAddr )
{
return GetString( Dword( structAddr ), -1, ASCSTR_C );
}
static Luafunc_GetFunc( structAddr )
{
return Dword( structAddr + 4 );
}
static HandleLuaFunc( structBase )
{
auto funcName, funcAddr;
funcName = Luafunc_GetName( structBase );
funcAddr = Luafunc_GetFunc( structBase );
RenameFunc( funcAddr, form( "Script_%s", funcName ) );
}
static main()
{
//
// Wipe existing Script_ functions
//
/*auto curEA = NextFunction(0);
for( ; curEA != BADADDR; curEA = NextFunction(curEA) )
{
auto name = GetFunctionName(curEA);
auto part = substr(name, 0, 7);
if ( part == "Script_" )
{
auto oldName = GetFunctionName( curEA );
MakeNameEx( curEA, "", SN_NOWARN );
auto newName = GetFunctionName( curEA );
Message( "-- Wiped -- %s -> %s\n", oldName, newName );
}
}
*/
auto registerFunc, xRef;
registerFunc = LocByName( "FrameScript_RegisterFunction" );
if(registerFunc == BADADDR)
{
Warning("Can't find FrameScript_RegisterFunction");
return;
}
for( xRef = RfirstB( registerFunc ); xRef != BADADDR; xRef = RnextB( registerFunc, xRef ) )
{
auto structBase;
auto numFuncs, i;
structBase = Dword(xRef - 4);
if(Byte( xRef + 5 ) == 0x83 )
numFuncs = GetOperandValue( xRef + 10, 1 ) / 8;
else
numFuncs = 1;
if ( numFuncs < 1000 && numFuncs > 0)
{
//Message( "Found 0x%x, count: 0x%x\n", structBase, numFuncs);
for ( i = 0; i < numFuncs; i++ )
{
HandleLuaFunc( structBase );
structBase = structBase + 0x8;
}
}
}
}
And x64 version
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;
auto part = substr( GetFunctionName( dwAddress ), 0, 7 );
if ( part != "Script_" )
{
auto oldName = GetFunctionName( dwAddress );
dwRet = MakeNameEx( dwAddress, sFunction, SN_NOWARN );
if( dwRet == 0 )
{
auto sTemp, i;
for( i = 1; 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;
}
}
if( i == 31)
Message( "-- Error --: Failed to rename %s -> %s\n", oldName, sFunction );
}
else
Message( "-- Renamed --: %s -> %s\n", oldName, sFunction );
}
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 );
RenameFunc( funcAddr, form( "Script_%s", funcName ) );
}
static main()
{
//
// Wipe existing Script_ functions
//
/*auto curEA = NextFunction(0);
for( ; curEA != BADADDR; curEA = NextFunction(curEA) )
{
auto name = GetFunctionName(curEA);
auto part = substr(name, 0, 7);
if ( part == "Script_" )
{
auto oldName = GetFunctionName( curEA );
MakeNameEx( curEA, "", SN_NOWARN );
auto newName = GetFunctionName( curEA );
Message( "-- Wiped -- %s -> %s\n", oldName, newName );
}
}
*/
auto registerFunc, xRef;
registerFunc = LocByName("FrameScript_RegisterFunction");
if( registerFunc == BADADDR )
{
Warning("Can't find FrameScript_RegisterFunction");
return;
}
for( xRef = RfirstB( registerFunc ); xRef != BADADDR; xRef = RnextB( registerFunc, xRef ) )
{
auto structBase;
auto numFuncs, i;
if( Byte( xRef + 5 ) == 0x48 && Byte( xRef + 6 ) == 0x83 )
{
structBase = GetOperandValue( xRef - 15, 1 );
numFuncs = GetOperandValue( xRef - 8, 1 );
}
else
{
structBase = GetOperandValue( xRef - 7, 1 );
numFuncs = 1;
}
if ( numFuncs < 1000 && numFuncs > 0 )
{
//Message( "Found 0x%x, count: 0x%x\n", structBase, numFuncs);
for ( i = 0; i < numFuncs; i++ )
{
HandleLuaFunc( structBase );
structBase = structBase + 0x10;
}
}
}
}