ODBG2_Plugindump

Optional plugin callback function, called when OllyDbg redraws any dump window. Extends table drawing function of the dump windows.

OllyDbg makes first call to this function with the parameter column set to DF_FILLCACHE. Plugin must decide whether it wants to modify the dump window. If it retuns 0, there will be no modifications and this time plugin will get no other calls. If plugin returns 1 (or any other non-zero value), it will be able to change contents or appearance of some cells in the dump table. This is the best opportunity for plugin to allocate resources or cache data.

Then, for each visible table line and each visible column, OllyDbg calls ODBG2_Plugindump() with column set to the 0-based index of the column. Note that invisible columns (minimized or completely outside the window) are excluded from the sequence. Plugin must update displayed text s, text attributes mask and cell appearance select and return new length of the text. If no modifications are necessary, it must return n.

After dump is processed, plugin receives final call with column set to DF_FREECACHE. Plugin must free resources allocated for the drawing. Returned value is ignored.

Note that calls to
ODBG2_Plugindump() may significantly slow down OllyDbg, therefore don't declare this callback unnecessarily. Maximal number of simultaneously loaded plugins that export ODBG2_Plugindump() is limited to 32.


int ODBG2_Plugindump(t_dump *pd,wchar_t *s,uchar *mask,int n,int *select,ulong addr,int column);


Parameters:

pd
(in) Pointer to the structure of type t_dump, descriptor of the dump window
s
(in/out) Pointer to the UNICODE string, n wide characters long, that contains the contents of the dump cell (possibly modified by other plugins). Null character at the end of this string is not required. Maximal length of the string is limited to TEXTLEN wide characters
mask
(in/out) Pointer to the byte array, n bytes long, that contains individual drawing attributes of the corresponding characters in s as a combinations of flags DRAW_xxx with numerical values not exceeding 0xFF. mask is in effect only if flag DRAW_MASK in *select is set. Maximal length of the mask is limited to TEXTLEN bytes
n
(in) Length of s and mask at entry to ODBG2_Plugindump()
select
(in/out) Pointer to the drawing attributes that apply to the string as a whole, as a combination of flags DRAW_xxx
addr
(in) Address of the first byte displayed in the dump row
column
(in) DF_FILLCACHE on the first call, zero-based index of the column to which the processed cell belongs (column>=0), or DF_FREECACHE when drawing is finished. See Tables for details


Return values:

If column is DF_FILLCACHE, 0 means that dump window is not influenced by plugin and 1 - that plugin wants to modify its contents. If column is non-negative, this is the length of the text s (and optional mask) that will be displayed in the cell of the dump window. Ignored if column is DF_FREECACHE


Example:

See annotated copy of bookmark.c


See also:
Dump windows, plugins, tables, DRAWFUNC