[IDAScript] Label Databases menu

User Tag List

Results 1 to 3 of 3
  1. #1
    kynox's Avatar Member
    Reputation
    830
    Join Date
    Dec 2006
    Posts
    888
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [IDAScript] Label Databases

    Some more IDA script from me!

    In this installment of label-that-feature, we focus on databases to easily identify when functions are accessing database information.

    http://dl.getdropbox.com/u/29438/IDA...lDatabases.idc

    Example of productivity enhancement:

    Code:
    signed int __cdecl lua_GetItemIcon(int a1)
    {
      int v1; // esi@1
      int v2; // eax@2
      char *v3; // eax@4
      DWORD v4; // esi@8
      char *v5; // ebx@9
      char v6; // zf@9
      signed int result; // eax@11
      int v8; // eax@11
      char icon[260]; // [sp+8h] [bp-108h]@11
      char *v10; // [sp+10Ch] [bp-4h]@9
    
      v1 = 0;
      if ( lua_isnumber(a1) )
      {
        v2 = lua_tointeger(a1, 1);
    LABEL_5:
        v1 = v2;
        goto LABEL_6;
      }
      if ( lua_isstring(a1, 1) )
      {
        v3 = lua_tostring(a1, 1, 0);
        v2 = GetItemIDByName(v3);
        goto LABEL_5;
      }
    LABEL_6:
      if ( v1 >= g_ItemDB.minIndex && v1 <= g_ItemDB.maxIndex && (v4 = g_ItemDB.Rows[v1 - g_ItemDB.minIndex]) != 0 )
      {
        v5 = ClientDBStringLookup(3);
        v6 = *v5 == 0;
        v10 = "\\";
        if ( v6 )
          v10 = nullString;
        v8 = CGItem_C__GetInventoryArt(*(_DWORD *)(v4 + 20));
        SStrPrintf(icon, 260u, "%s%s%s", v5, v10, v8);
        lua_pushstring(a1, icon);
        result = 1;
      }
      else
      {
        result = 0;
      }
      return result;
    }
    Note: This was written around IDA 5.5, if you have an inferior version; manually insert the struct as follows:

    Code:
    #pragma pack(push, 1)
    struct WoWClientDB
    {
      void *funcTable;
      int isLoaded;
      int numRows;
      int maxIndex;
      int minIndex;
      int stringTable;
      void *funcTable2;
      DWORD FirstRow;
      DWORD *Rows;
    };
    #pragma pack(pop)
    Last edited by kynox; 09-11-2009 at 03:52 PM.

    [IDAScript] Label Databases
  2. #2
    flo8464's Avatar Active Member
    Reputation
    30
    Join Date
    Apr 2009
    Posts
    434
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <3 you.
    Thats just awesome.

  3. #3
    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)
    Works fine with IDA 5.2 with small modifications. Thank you.
    Last edited by TOM_RUS; 09-12-2009 at 06:51 AM.

Similar Threads

  1. Cartogropher Mining/Herbalism Database
    By Muatmessmoko in forum WoW UI, Macros and Talent Specs
    Replies: 2
    Last Post: 07-30-2007, 12:27 PM
  2. Gatherer Database
    By Mendel in forum World of Warcraft General
    Replies: 0
    Last Post: 06-20-2007, 07:46 AM
  3. Quest Database
    By Soulafein in forum World of Warcraft General
    Replies: 4
    Last Post: 04-13-2007, 03:44 AM
  4. WoW - Legends ! Guide and Database!
    By wow_pwner in forum World of Warcraft General
    Replies: 1
    Last Post: 03-18-2007, 03:27 PM
  5. Quests database for horde
    By sabotage3d in forum World of Warcraft Guides
    Replies: 2
    Last Post: 02-13-2007, 05:01 PM
All times are GMT -5. The time now is 05:04 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