Skip to content
Snippets Groups Projects
Commit 12dd79b0 authored by whh8b's avatar whh8b
Browse files

Yet newer SDK semantics

1. There are now two functions to identify
   the size of the dollop entry.
2. The plugin must identify whether or not
   it plopped the actual instruction as 
	 opposed to just bytes in the dollop entry's
	 opening and/or closing.
parent 366e9c50
No related branches found
No related tags found
No related merge requests found
......@@ -45,14 +45,19 @@ class ZiprPluginInterface_t
return 0;
}
/*
* InsnPaddingSize()
* DollopEntryOpeningSize()
* DollopEntryClosingSize()
*
* A plugin that wants to put padding into a
* dollop entry before/after an instruction
* should return the size of that padding in this
* function.
* should return the size of that padding in
* these functions.
*/
virtual size_t InsnPaddingSize(libIRDB::Instruction_t*, Zipr_t *)
virtual size_t DollopEntryOpeningSize(DollopEntry_t*, Zipr_t *)
{
return 0;
}
virtual size_t DollopEntryClosingSize(DollopEntry_t*, Zipr_t *)
{
return 0;
}
......@@ -66,24 +71,34 @@ class ZiprPluginInterface_t
* it's Place() function to determine the beginning
* of the space allocated for this dollop entry.
*
* Because multiple plugins may want to plop the same
* dollop entry, the current address of the instruction
* within the entry is passed as the second parameter.
* If the plugin moves that instruction, it must update
* the parameter. In order to know the length of the
* instruction, there is the third parameter.
* entry: A pointer to the dollop entry to be plopped.
*
* instruction_address: Because multiple plugins
* may want to plop the same dollop entry, the current
* address of the instruction within the entry is
* passed in this parameter. If the plugin moves that
* instruction, it must update the parameter.
*
* instruction_size: The size of the instruction itself.
*
* placed_instruction: A flag that the plugin sets
* to tell Zipr whether this plugin placed the
* instruction or whether it just wrote into the entry
* surrounding the instruction. The plugin should set
* this value appropriately. The default is false.
*
* Finally, to access the other functions that Zipr
* provides, the fourth parameter is available.
* zipr: Pointer to a Zipr object for plugin access to
* functionality provided by zipr.
*
* As output, the implementation must provide the
* address of the memory that "concludes" the
* dollop entry.
*/
virtual RangeAddress_t PlopDollopEntry(Zipr_SDK::DollopEntry_t *,
RangeAddress_t &,
size_t,
Zipr_t *)
virtual RangeAddress_t PlopDollopEntry(Zipr_SDK::DollopEntry_t *entry,
RangeAddress_t &instruction_address,
size_t instruction_size,
bool &placed_instruction,
Zipr_t *zipr)
{
return 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment