Results 1 to 1 of 1
  1. #1
    Contributor

    CoreCoins User


    Reputation
    216
    Join Date
    Sep 2008
    Location
    Hawaii
    Posts
    712
    CoreCoins
    261

    Trade Feedbacks

    Status
    n/a
    Positive
    0 (0%)
    Negative
    0 (0%)

    updated DumpDescriptors.idc



    Donate to Remove Ads, Get ShoutBawx - Elite Forum Access
    Updated this script to work for my purposes. Thanks wraithZX.

    Code:
    // Visit http://forum.gamedeception.net/
    #include <ida.idc>
    #include <Wow/Util_WoWVersion.idc>
    
    static ExtractPath( sPath )
    {
    	auto dwIndex;
    	for( dwIndex = strlen( sPath ); strstr( substr( sPath, dwIndex, -1 ), "\\" ); dwIndex-- );
    	return substr( sPath, 0, dwIndex + 1 );
    }
    
    static DumpField( szName, szPrefix, dwPointer, dwIndexOffset, hFile )
    {
    	auto dwEnumId, dwFieldCount;
    	
    	dwEnumId = AddEnum( -1, szName, 0x1100000 );
    	
    	fprintf( hFile, "// Descriptors: 0x%08X\nenum %s\n{\n", dwPointer, szName );
    
    	while( 1 )
    	{
    		auto pszName, dwIndex;
    	
    		pszName = GetString( Dword( dwPointer ), -1, ASCSTR_C );
    	
    		if( pszName == "" )
    			break;
    
    		if( ( strstr( szPrefix, "GAMEOBJECT" ) != -1 && strstr( pszName, "OBJECT_FIELD" ) != -1 ) || strstr( pszName, szPrefix ) == 0 )
    		{
    			dwIndex = Dword( dwPointer + 4 ) + dwIndexOffset;
    
    			fprintf( hFile, "\t%s = 0x%X,\n", pszName, dwIndex * 4 );
    			
    			dwFieldCount = dwFieldCount + 1;
    		}
    
    		dwPointer = dwPointer + 0x14;
    	}
    	
    	fprintf( hFile, "\tTOTAL_%s_FIELDS = 0x%X\n", szPrefix, dwFieldCount );
    	fprintf( hFile, "};\n" );
    
    	return dwIndex;
    }
    
    static main()
    {
    	auto sPath, hFile, dwStartFunc, dwFuncPtrCheck, s_objectDescriptors, s_unitDescriptors, s_itemDescriptors, s_playerDescriptors, s_containerDescriptors, s_gameobjectDescriptors, s_dynamicobjectDescriptors, s_corpseDescriptors;
    	auto DescriptorsSize;
    
    	sPath = ExtractPath( GetIdbPath() ) + "Objects_Enum.h";
    	hFile = fopen( sPath, "w" );
    
    	DescriptorsSize = 0;
    
    	if( hFile != -1 )
    	{
    		fprintf( hFile, "#ifndef __OBJECTS_ENUM_H__\n#define __OBJECTS_ENUM_H__\n" );
    		fprintf( hFile, "// %s\n", GetWoWVersionString() );
    		fprintf( hFile, "/*----------------------------------\n" );
    		fprintf( hFile, "WoW Offset Dumper 0.1 - IDC Script\n" );
    		fprintf( hFile, "by kynox, updated by namreeb\n\n" );
    		fprintf( hFile, "Credits:\n" );
    		fprintf( hFile, "bobbysing, Patrick, Dominik, Azorbix\n" );
    		fprintf( hFile, "-----------------------------------*/\n\n" );
    
    		dwStartFunc = FindBinary( INF_BASEADDR, SEARCH_DOWN, "56 57 68 ? ? ? ? B8 05" );
    
    		Message( "dwStartFunc: 0x%08X\n", dwStartFunc );
    	
    		s_objectDescriptors = Dword( dwStartFunc + 0xD );
    		s_itemDescriptors = Dword( dwStartFunc + 0x32 );
    		s_containerDescriptors = Dword( dwStartFunc + 0x57 );
    		s_unitDescriptors = Dword( dwStartFunc + 0x7C );
    		s_playerDescriptors = Dword( dwStartFunc + 0xA1 );
    		s_gameobjectDescriptors	= Dword( dwStartFunc + 0xC6 );
    		s_dynamicobjectDescriptors = Dword( dwStartFunc + 0xEB );
    		s_corpseDescriptors = Dword( dwStartFunc + 0x110 );
    
    		MakeName( s_objectDescriptors, "s_objectDescriptors" );
    		MakeName( s_unitDescriptors, "s_unitDescriptors" );
    		MakeName( s_itemDescriptors, "s_itemDescriptors" );
    		MakeName( s_playerDescriptors, "s_playerDescriptors" );
    		MakeName( s_containerDescriptors, "s_containerDescriptors" );
    		MakeName( s_gameobjectDescriptors, "s_gameobjectDescriptors" );
    		MakeName( s_dynamicobjectDescriptors, "s_dynamicobjectDescriptors" );
    		MakeName( s_corpseDescriptors, "s_corpseDescriptors" );
    
    		DescriptorsSize = DumpField( "eObjectFields", "OBJECT", s_objectDescriptors, 0, hFile ) + 1;
    		DumpField( "eItemFields", "ITEM", s_itemDescriptors, DescriptorsSize, hFile );
    		DumpField( "eContainerFields", "CONTAINER", s_containerDescriptors, DescriptorsSize, hFile );
    		DumpField( "eGameObjectFields",	 "GAMEOBJECT", s_gameobjectDescriptors, DescriptorsSize, hFile );
    		DumpField( "eDynamicObjectFields", "DYNAMICOBJECT", s_dynamicobjectDescriptors, DescriptorsSize, hFile );
    		DumpField( "eCorpseFields", "CORPSE", s_corpseDescriptors, DescriptorsSize, hFile );
    
    		DescriptorsSize = DumpField( "eUnitFields", "UNIT", s_unitDescriptors, DescriptorsSize, hFile ) + 1;
    		DumpField( "ePlayerFields", "PLAYER", s_playerDescriptors, DescriptorsSize, hFile );
    
    		fprintf( hFile, "#endif //__OBJECTS_ENUM_H__\n" );
    		fclose( hFile );
    	}
    	else
    		Message( "Failed to open file %s.\n", sPath );
    
    	Message( "Successfully dumped %s.\n", sPath );
    }

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -4. The time now is 04:54 AM. Powered by vBulletin® Version 4.2.0
Copyright © 2014 vBulletin Solutions, Inc. All rights reserved. Resources saved on this page: MySQL 5.88%
vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search