Window functions

OllyDbg Plugin API

Window functions

All MDI windows in OllyDbg are the so called table windows. They have up to 17 resizable columns, unlimited number of rows and hideable bar which can act as a string of buttons. OllyDbg supports resizing of columns and scrolling of table windows. For simple table windows, it automatically adds possibility to copy whole table, row or single element to clipboard without extra code. Table windows support UNICODE, highlighting and selection and several pseudographical symbols. User can select font and colour scheme, and so on.

Ordinary table windows display contents of sorted data. OllyDbg makes it especially easy for the programmer, one only needs to supply several relatively simple functions. For example, function that implements WM_PAINT functionality simply returns text to be drawn in specified cell, and function that allows to sort contents of window just compares two elements of sorted data.

Custom (user-defined) table windows may display any data. Disassembler and Dump are good examples of custom windows. They also obtain plenty of support from OllyDbg, but require significantly more programming.

Table windows are described by structure t_table. It is on the responsibility of the programmer to maintain data in custom windows. Registerpluginclass allocates 8 additional longwords accessible by SetWindowLong and GetWindowLong. First two longwords (with offsets 0 and 4) are reserved for internal use. You can freely use remaining offsets 8, 12, ..., 28.

typedef int DRAWFUNC(char *s,char *mask,int *select,t_sortheader *ps,int column);

void Defaultbar(t_bar *pb);

int Tablefunction(t_table *pt,HWND hw,UINT msg,WPARAM wp,LPARAM lp);

void Painttable(HWND hw,t_table *pt,DRAWFUNC getline);

void Selectandscroll(t_table *pt,int index,int mode);

void Sendshortcut(int where,ulong addr,int msg,int ctrl,int shift,int vkcode);

HWND Newtablewindow(t_table *pt,int nlines,int maxcolumns,char *winclass,char *wintitle);

HWND Quicktablewindow(t_table *pt,int nlines,int maxcolumns,char *winclass,char *wintitle);

int Broadcast (UINT msg,WPARAM wp,LPARAM lp);

HWND Createdumpwindow(char *name,ulong base,ulong size,ulong addr,int type,SPECFUNC *specdump);

void Setdumptype(t_dump *pd,int type);

void Dumpbackup(t_dump *pd,int action);

HWND Createwatchwindow(void);

HWND Createwinwindow(void);

HWND Creatertracewindow(void);

HWND Createthreadwindow(void);

HWND Createpatchwindow(void);