diff --git a/include/dollop.h b/include/dollop.h index 8619c70f102715f67dd88bf426e4958888b3d1d7..597a76171c971e5ca91c51c22dd14f6115807936 100644 --- a/include/dollop.h +++ b/include/dollop.h @@ -36,6 +36,8 @@ namespace Zipr_SDK { +class DollopManager_t; + class Placeable_t { public: Placeable_t() : m_is_placed(false), m_placed_address(0) {} @@ -86,16 +88,20 @@ class DollopEntry_t : public Placeable_t { class Dollop_t : public Placeable_t, public std::list<DollopEntry_t*> { public: - static Dollop_t *CreateNewDollop(libIRDB::Instruction_t *start); + static Dollop_t *CreateNewDollop(libIRDB::Instruction_t *start, + DollopManager_t *mgr = NULL); - Dollop_t(libIRDB::Instruction_t *start); + Dollop_t(libIRDB::Instruction_t *start, DollopManager_t *); Dollop_t() : m_size(0), m_fallthrough_dollop(NULL), m_fallback_dollop(NULL), m_fallthrough_patched(false), m_coalesced(false), - m_was_truncated(false) {} + m_was_truncated(false), + m_dollop_mgr(NULL) {} + + void SetDollopManager(DollopManager_t *mgr) { m_dollop_mgr = mgr; } size_t GetSize() const { return m_size; @@ -141,6 +147,7 @@ class Dollop_t : public Placeable_t, public std::list<DollopEntry_t*> { bool m_fallthrough_patched; bool m_coalesced; bool m_was_truncated; + DollopManager_t *m_dollop_mgr; }; } #endif diff --git a/include/dollop_man.h b/include/dollop_man.h index e143e428dcb6861f49b4d73173680bb4124e9f6d..e177e17f48cb5c54acc723392d47be010d8fb3bd 100644 --- a/include/dollop_man.h +++ b/include/dollop_man.h @@ -50,6 +50,8 @@ class DollopManager_t { public: DollopManager_t() {}; + virtual int DetermineWorstCaseInsnSize(libIRDB::Instruction_t *insn)=0; + /* * Add a dollop and all its fallthrough dollops * to the dollop manager. diff --git a/include/zipr.h b/include/zipr.h index 5dccca2e715d90891dbe581a4ae38d0a83e62e71..300ebe6a95653b5eb774f64bfc2b19aa11332d33 100644 --- a/include/zipr.h +++ b/include/zipr.h @@ -49,6 +49,7 @@ class Zipr_t * These are public functions that the SDK user way want to use. */ virtual int DetermineWorstCaseInsnSize(libIRDB::Instruction_t*, bool account_for_jump = true) = 0; + virtual int PluginDetermineWorstCaseInsnSize(libIRDB::Instruction_t*, bool account_for_jump = true) = 0; virtual Zipr_SDK::RangeAddress_t PlopDollopEntry( DollopEntry_t *,