your feedback send to: debugger@fyzor.com     
C++ debugger
Navigator
Main
Screenshots
Docs
Download
Sources
Plugins
API
History
Legend
Contacts
Links
Mail
Search
Search Site With Google
Надежный хостинг по доступным ценам!

API of plug-in modules:

Functions list:

ZD_Assemble / ZD_DefineArray / ZD_DefineEntry / ZD_DefineEnum / ZD_DefineFrame / ZD_DefineFunction / ZD_DefineMember / ZD_DefinePointer / ZD_DefineSource / ZD_DefineStruct / ZD_DerefType / ZD_Disasm / ZD_Dump / ZD_EnumTypeMember / ZD_FindEntry / ZD_FindEqualEntry / ZD_FindNearestEntry / ZD_FindType / ZD_FindTypeMember / ZD_GetAddress / ZD_GetEntryAddress / ZD_GetEntryName / ZD_GetEntryType / ZD_GetFullPath / ZD_GetModule / ZD_GetModulePath / ZD_GetPosition / ZD_GetSelection / ZD_GetType / ZD_GetTypeName / ZD_GetTypeServer / ZD_GetTypeSize / ZD_Goto / ZD_Input / ZD_LoadGIF / ZD_LoadProgram / ZD_MapFile / ZD_Message / ZD_Pause / ZD_Printf / ZD_Read / ZD_RegisterCommand / ZD_ReloadProgram / ZD_Run / ZD_RunTo / ZD_SetBreakpoint / ZD_SetTitle / ZD_ShellCommand / ZD_UnloadProgram / ZD_UnmapFile / ZD_Write

Functions description:

DWORD ZD_Assemble (DWORD adr, char*text)

Assembles a single instruction and writes it to the specified address. The function prevents all breakpoints from being erased.
return value: Returns the size of assembled instruction.


HTYPE ZD_DefineArray (HTYPE type, DWORD size)

Defines an array type of size size. If such an array already exists, returns its handle.


HENTRY ZD_DefineEntry (char*name, DWORD adr, HTYPE type, HSOURCE src)

Defines an entry of type type. The type must be created first and then passed to this function.
parameters: name - name of the symbol to create, adr - address in the space of the debugged process, type - type of the symbol, src - source file handle for local symbols, or NULL otherwise.


HTYPE ZD_DefineEnum (char*name, HTYPE elem)

Defines enumuration type with elements having type elem.
parameters: name - the name of a new enumuration, or NULL for unnamed, elem - type of each element.


HTYPE ZD_DefineFrame (char*name, HTYPE func, DWORD start, DWORD end)

Defines a frame type. The frame is a structure used to keep function's automatic variables and its arguments during its execution.
parameters: name - name of the function for wich the frame is being defined, func - type of the function, consisting of its arguments and its return value, start - starting address of the function body, end - ending address of the function body.


HTYPE ZD_DefineFunction (HTYPE args, HTYPE rettype, int call)

Defines a function type. This type keeps function's arguments and its return value.
parameters: args - type of arguments (not used yet), rettype - type of return value, call - type of call (not used yet, always used __cdecl)


void ZD_DefineMember (HTYPE type, char*name, int shift, HTYPE elem)

Adds a new member to the structure/union type. Old members with the same name are not removed. Members also can have shifts that overwite one another like in C/C++ unions.
parameters: type - type of the structure to add member to, name - name of the created member, shift - field's shift from the begining of the structue/union, elem - type of the member.


HTYPE ZD_DefinePointer (HTYPE type)

Defines a pointer type of type type. If such a pointer already exists, returns its handle.


HSOURCE ZD_DefineSource (char*fname, int num, WORD*lines, DWORD*adrs)

Defines a new source file and returns its handle. Source file contains information about line numbers.
parameters: fname - source file name, num - number of line numbers, lines - array of line numbers, adrs - array of addresses for each line in lines.


HTYPE ZD_DefineStruct (char*name, int size)

Defines a structure type. If size is zero, then the structure is only declared, and its size must be defined later by calling this function again with the size greater than zero.


HTYPE ZD_DerefType (HTYPE type)

For pointers, arrays and enums retrieves the type of their elements. Returns NULL if the type has no elements.


DWORD ZD_Disasm (DWORD adr, char dest[])

Disassembles a single instruction from specified address.
return value: Returns the size of disassembled instruction.


void ZD_Dump (BYTE* data, DWORD size)

Outputs the data dump into debugger's log-file.


char* ZD_EnumTypeMember (HTYPE type, int index, int *shift, HTYPE*elem)

Enumurates all members of the complex type like stucture, union or frame. Call this function with pos starting from zero.
parameters: pos - index of the field to get type
return value: Returns the type of the field at the specified index, or NULL if the index is out of bounds.


HENTRY ZD_FindEntry (char*name)

Finds the entry with specified name. RETURN VALUE: NULL if no entry with this name was found.
return value: NULL if no entry with this name was found.


HENTRY ZD_FindEqualEntry (DWORD adr)

Finds an entry that is equal to the specified address.


HENTRY ZD_FindNearestEntry (DWORD adr)

Finds an entry that is equal or below to the specified address.


HTYPE ZD_FindType (char*name)

Searches for the specified type.
return value: Handle of the found type, or NULL otherwize.


BOOL ZD_FindTypeMember (HTYPE type, char*name, int *shift, HTYPE*elem)

Finds the member by its name in the complex type like strucure, union or frame.
parameters: type - type of the complex type, name - name of the field to find, shift - pointer to variable that recieves the shift of the member, elem - pointer to variable that recieves the type of the member
return value: TRUE if the member is found. FALSE otherwise.


DWORD ZD_GetAddress (WORD section, DWORD offset)

Caclculates the effective address for section and offset in this section. Section index is taken from the last loaded module.


DWORD ZD_GetEntryAddress (HENTRY handle)

Retrieves the entry's address.


BOOL ZD_GetEntryName (HENTRY handle, char dest[], int len)

Copies the entry's name to the buffer.


HTYPE ZD_GetEntryType (HENTRY handle)

Retrieves the entry's type.


void ZD_GetFullPath (char*fname, char dst[])

Calculates and retrieves the full path of the specified filename. If the filename is absolute, then just copys without changes.


HMODULE ZD_GetModule (DWORD adr)

Retrievs the module handle which resides at the specified address. The handle is not WinAPI-compatible.


BOOL ZD_GetModulePath (HMODULE mod, char dest[])

Retieves a full path of the specified module. If the handle is NULL, returns the path to the executable itself. The handle is not WinAPI-compatible.


DWORD ZD_GetPosition (void)

Retrieves the current position. The position is taken either from code or data panel, depending which of them was active the last time.


BOOL ZD_GetSelection (DWORD*L, DWORD*R)

Retrieves the selection address range of the data or code panel, depending on which of them was active the last time.
return value: Returns the length of the selection.


HTYPE ZD_GetType (char*spec)

Retrieves the type of a C-like type specification.


BOOL ZD_GetTypeName (HTYPE type, char dst[])

Retrieves the name of the type, if any.
return value: TRUE if the type has name. FALSE otherwise.


int ZD_GetTypeServer (HTYPE type)

Retrieves the identifier of the type server. It can be one of the following values: 'base' - for basic types, 'enum' - for enums, '*' - for pointers, '[]' - for arrays, '{}' - for strucures and unions, '()' - for functions, 'bp' - for frames
return value: -1 in case of error.


int ZD_GetTypeSize (HTYPE type)

Retieves the size of the type.


void ZD_Goto (DWORD adr)

Moves current positions of the code panels to the specified address.


BOOL ZD_Input (char* titles, char value[], char history[], ...)

Queries the user to edit or enter a new string.
parameters: titles - two strings delimited by \n. First of them is a title, and the second is a prompting text. value - destination buffer for result. It must be set to initial value. history - history strings delimited by \n.
return value: TRUE if the user has changed the string.


HBITMAP ZD_LoadGIF (char*fname)

Creates a bitmap from the specified GIF file.
return value: Returns the handle of a newly created bitmap. Use DeleteObject procedure to delete such bitmaps after use.


BOOL ZD_LoadProgram (char*filename)

Loads debugged program into debugger.
parameters: filename - the path of filename of the program.
return value: TRUE on success.


BYTE* ZD_MapFile (char*fname)

Maps specified file into the address space of the debugger. You can use then returned address to analyze the contents of the file. When done, call ZD_UnmapFile to unmap the region and free all resources.


void ZD_Message (char*msg, ...)

Shows a message box with user defined message.


BOOL ZD_Pause (void)

Stops execution of process.
return value: TRUE on success.


void ZD_Printf (char*msg, ...)

Outputs the string msg into debugger's log-file.


DWORD ZD_Read (DWORD adr, DWORD size, BYTE dst[])

Reads a block of bytes from debugged process's memory.
return value: Number of bytes successfully read.


void ZD_RegisterCommand (char*title, HPROC hproc)

Adds command to the debugger. This command can be then run from the Plug-in dialog.
parameters:


BOOL ZD_ReloadProgram (void)

Reloads debugged program.


BOOL ZD_Run (void)

Runs the debugged process if it was paused before.
return value: TRUE on success.


BOOL ZD_RunTo (DWORD adr)

Runs the process to the specified point.
return value: TRUE on success.


void ZD_SetBreakpoint (DWORD adr, BOOL flag)

Creates/deletes breakpoint at the specified address.
parameters: flag - if TRUE, a new breakpoint is set; if FALSE - the old is erased, if any.


void ZD_SetTitle (char*str)

Sets a title of the current executing plugin module. This title is used in the plugins manager to describe plugin's purpose. You can change it at any time.


int ZD_ShellCommand (char*cmd)

Executes the specified shell command line. Returns TRUE if ok.


BOOL ZD_UnloadProgram (void)

Unloads already loaded program, if any.


void ZD_UnmapFile (BYTE*base)

Frees resources allocated by ZD_MapFile.


DWORD ZD_Write (DWORD adr, DWORD size, BYTE*src)

Writes a block of bytes into debugged process's memory. This is a safe method to write memory, because it prevents all breakpoints from being erased.
return value: Number of bytes successfully written.


Project and site author: Sapunov Vladimir
(c) Copyright 2005-2008