t_table

Describes table - a collection of data that can be represented as a list or table on the screen. Most OllyDbg windows are tables. Table windows may be embedded into other windows or grouped into the frame or tab collection.

Note that tampering with the members of this structure may have undesired effects of lead to crash. Use API functions to manipulate t_table.


typedef struct t_table {               // Window with sorted data and bar
  // These variables must be filled before table window is created.
  wchar_t        name[SHORTNAME];      // Name used to save/restore position
  int            mode;                 // Combination of bits TABLE_xxx
  t_sorted       sorted;               // Sorted data
  int            subtype;              // User-defined subtype
  t_bar          bar;                  // Description of bar
  int            bottomspace;          // Height of free space on the bottom
  int            minwidth;             // Minimal width of the table, pixels
  TABFUNC        *tabfunc;             // Custom message function or NULL
  UPDATEFUNC     *updatefunc;          // Data update function or NULL
  DRAWFUNC       *drawfunc;            // Drawing function
  TABSELFUNC     *tableselfunc;        // Callback indicating selection change
  t_menu         *menu;                // Menu descriptor
  // Table functions neither initialize nor use these variables.
  ulong          custommode;           // User-defined custom data
  void           *customdata;          // Pointer to more custom data
  // These variables are initialized and/or used by table functions.
  HWND           hparent;              // Handle of MDI container or NULL
  HWND           hstatus;              // Handle of status bar or NULL
  HWND           hw;                   // Handle of child table or NULL
  HWND           htooltip;             // Handle of tooltip window or NULL
  int            font;                 // Index of font used by window
  int            scheme;               // Colour scheme used by window
  int            hilite;               // Highlighting scheme used by window
  int            hscroll;              // Whether horizontal scroll visible
  int            xshift;               // Shift in X direction, pixels
  int            offset;               // First displayed row
  int            colsel;               // Column in TABLE_COLSEL window
  ulong          version;              // Version of sorted on last update
  ulong          timerdraw;            // Timer redraw is active (period, ms)
  RECT           rcprev;               // Temporary storage for old position
  int            rtback;               // Back step in run trace, 0 - actual
} t_table;


Members:

name
Short unique class name of the table, used to save and restore appearance of the table. OllyDbg keeps this data in the main initialization file in the section [name]. Which parts of appearance are preserved is determined by the mode bits TABLE_SAVEPOS, TABLE_SAVECOL, TABLE_SAVESORT and TABLE_SAVECUST. Empty name turns saving off
mode
Table properties, combination of bits TABLE_xxx:
TABLE_USERDEF - non-standard user-defined custom table. Its sorted data is a placeholder without any records. Dump and register windows are custom tables
TABLE_STDSCR - for user-defined tables only, automatically processes most scrolling and selection messages (
WM_USER_VINC, WM_USER_SETS etc.) when custom table function returns 0. Table must keep valid total number of lines in sorted.n, first visible line in offset and currently selected line in sorted.selected. Multiline selection is not supported
TABLE_SIMPLE - table without sorted data, similar to TABLE_USERDEF|TABLE_STDSCR. Item's address is simultaneously the line number. Scrolling and selection are done automatically. Log window is an example of simple table
TABLE_DIR - bottom-to-top table, i.e. first visible line is on the bottom and lines are counted and drawn upstairs. Log window is a bottom-to-top table
TABLE_COLSEL - table supports column-wide selection. Index of selected column is kept in colsel. If flag is not set, standard table selects complete row through all available columns
TABLE_BYTE - informs that custom table supports bytewise scrolling and should receive WM_USER_VBYTE if up/down arrow keys or arrows on the vertical scrollbar are pressed simultaneously with Ctrl key. If flag is not set, table receives WM_USER_MOVS instead
TABLE_FASTSEL - requests instant repainting when when window scrolls or selection changes. If flag is not set, OllyDbg posts WM_PAINT
TABLE_RIGHTSEL -if right mouse button is clicked in the window, custom table receives WM_USER_SETS (request to start new selection). Standard tables allow right button selection by default 
TABLE_RFOCUS - if right mouse button is clicked in the window, sets focus to the window. Standard windows and custom windows with flag TABLE_RIGHTSEL allow focus on right click by default
TABLE_NOHSCR - table window contains no horizontal scroll
TABLE_NOVSCR
table window contains no vertical scroll
TABLE_NOBAR - bar is always hidden, dependless on bar.visible
TABLE_STATUS - container window gets status bar hstatus at the bottom. Has no effect if table is part of the frame window
TABLE_MMOVX - contents of custom window is moveable by mouse horizontally. Window with TABLE_MMOVX or TABLE_MMOVY receives WM_USER_MMOV instead of WM_USER_CNTS. Simple tables (TABLE_SIMPLE) don't support mouse moving
TABLE_MMOVY
contents of custom window is moveable by mouse vertically. Window with TABLE_MMOVX or TABLE_MMOVY receives WM_USER_MMOV instead of WM_USER_CNTS. Simple tables (TABLE_SIMPLE) don't support mouse moving
TABLE_WANTCHAR - WM_CHAR is passed to the tabfunc (but only when both Ctrl and Alt keys are released)
TABLE_SAVEAPP - when table window is destroyed, its appearance (fontscheme, bar.visible, hscroll, hilite) is saved to the main initialization file to the section [name] and is automatically restored next time the window is created. If different instances of the same table must support different appearances, index them by subtype (no indexing if subtype is 0)
TABLE_SAVEPOS -
when table window is destroyed, its size and position are saved to the main initialization file (section [name]) and are automatically restored next time the window is created
TABLE_SAVECOL - when table window is destroyed, width of its columns is saved to the main initialization file (section [name]) and is automatically restored next time the window is created. If different instances of the same table must support different sets of columns, index them by subtype (no indexing if subtype is 0)
TABLE_SAVESORT - when table window is destroyed, sorting criterium (index of the column used to sort data) is saved to the main initialization file (section [name]) and is automatically restored next time the window is created. If different instances of the same table must support different sorting criteriums, index them by subtype (no indexing if subtype is 0)
TABLE_SAVECUST - for custom tables, hints that table-specific data should be saved to the main initialization file (section [name], keyword "Local"). If several items to be saved, table should use keywords "Local_xxx". Saving of local data is in full responsibility of the table. Best time to save data is when WM_DESTROY is passed to the table procedure. Standard tables do not use keywords beginning with "Local"
TABLE_GRAYTEXT - table is grayed by adding DRAW_INACTIVE to each displayed line. This reduces color of normal text and graphical symbols to gray
TABLE_NOGRAY - when table window is part of the frame and this flag is set, frame doesn't set TABLE_GRAYTEXT even if table is inactive
TABLE_UPDFOCUS - when table window is part of the frame, this flag requests it to redraw the window each time it receives or looses focus
TABLE_AUTOUPD - table supports periodical autoupdate (activated by Setautoupdate()). Table function must process WM_USER_UPD. Tables with this flag set do not support delayed redraw
TABLE_SYNTAX - table supports syntax highlighting. If this flag is not set, hilite is ignored
TABLE_PROPWID - if flag is set, columns fill the whole width of the window and their widths are proportional to the default widths (bar.defdx[])
TABLE_INFRAME - table is part of the frame window or tab collection. Structure t_table is supplied externally by the frame. Table windows that are parts of the frame must not descroy their t_table structure (or structure that embraces t_table) on WM_DESTROY
TABLE_BORDER - draws sunken border around the table, useful if table is embedded into the custom window
TABLE_KEEPOFFS - don't reset xshift, offset and colsel when creating table window
sorted
Structure of type t_sorted, descriptor of sorted data displayed in the table window. User-defined (TABLE_USERDEF) and simple (TABLE_SIMPLE) table windows do not have associated sorted data but may use members sorted.n and sorted.selected to automate scrolling and selection.
subtype
Arbitrary user-defined integer that distinguishes between different versions of the table, like different kinds of search results in Search window. When table is requested to save appearance of the table window to the initialization file, it uses subtype as an index
bar
Structure of type t_bar, describes number of columns in the table window, column names, default column widths etc.
bottomspace
Reserves area of the specified height, in pixels, in the parent of the table window, just beneath the table. Use Createtablechild() to create controls. Note that OllyDbg automatically moves and/or resizes these controls when table is resized.
Standard OllyDbg windows don't use bottom space, it is intended solelly for use by plugins. This feature is not supported by frames and tab collections
minwidth
Minimal width of the table window, pixels. Set minwidth to zero if width control is not necessary
tabfunc
Pointer to the callback of type TABFUNC that processes messages and notifications sent to the table, or NULL if default processing is sufficient
updatefunc
Pointer to the optional callback of type UPDATEFUNC that actualizes contents of the whole table. This may include recalculation of some fields, adding or deletion of table entries, or both. OllyDbg may call this function in the following cases:
  - when window is created;
  - in WM_PAINT when version of the associated sorted data is changed;
  - when debugged application is paused by the user or due to the debugging request, but not when debugging event is continued immediately

drawfunc
Pointer to the mandatory callback of type DRAWFUNC that prepares contents of table cells displayed on the screen
tableselfunc
Pointer to the optional callback of type TABSELFUNC that is called each time the selection in the table window is changed
menu
Pointer to the array of type t_menu that describes pop-up menu associated with the table, or NULL if menu is not necessary
customode
Used by tab collection to keep tab index. Tables created by plugins which are not parts of the tab collection are free to use this variable for any purposes
customdata
Used by tab collection to keep internal data. Tables created by plugins which are not parts of the tab collection are free to use this variable for any purposes
hparent
Handle of the window that owns table window (MDI container, overlapped window, tab collection, frame etc.), or NULL if table is not displayed
hstatus
Handle of the optional status bar at the bottom of the parent window. Absent if table is part of the frame or tab collection
hw
Handle of the table window (window that displays table data), or NULL if table is not displayed
htooltip
Handle of the optional window of class TOOLTIPS_CLASS that displays bar tooltips. This window is fully controlled by the OllyDbg, Don't tamper with it unless you are really, really sure!
font
Index of the font (0..NFIXFONTS-1) used in the table
scheme
Index of the colour scheme (0..NSCHEMES-1) used in the table
hilite
If table supports highlighting (flag TABLE_SYNTAX is set), this is the index of the highlighting scheme (1..NHILITE-1) used in the table, or NOHILITE if syntax highlighting is turned off
hscroll
Flag indicating whether horizontal scroll will be displayed in the table window if sum of the horizontal column extents exceeds width of the client area
xshift
Zero-based index of the leftmost visible table pixel displayed in the table window
offset
Zero-based index of the first line visible in the table window. Note that if flag TABLE_DIR is set, this line is displayed at the bottom of the window
colsel
Zero-based index of the selected column. Applies only to tables of type TABLE_COLSEL
version
Version of the associated sorted data during the last processed WM_PAINT, allows to determine whether displayed data is changed and should be repainted
timerdraw
Period of automatic redraw in milliseconds, or 0 if this feature is turned off
rcprev
Used internally by OllyDbg
rtback
Used internally by OllyDbg


See also:
Tables, Frames and tab collections, t_bar, t_sorted, DRAWFUNC, MENUFUNC, TABFUNC, TABSELFUNC, UPDATEFUNC, WM_USER_xxx messages, Createottablewindow(), Createtablechild(), Createtablewindow(), Setautoupdate()