DisassemblyView Class Reference

Public Member Functions

 DisassemblyView (DisassemblyContainer *parent, BinaryViewRef data, FunctionRef func=nullptr, bool navToAddr=false, uint64_t addr=0)
 
virtual void updateFonts () override
 
virtual bool navigate (uint64_t pos) override
 
virtual bool navigateToFunction (FunctionRef func, uint64_t pos) override
 
virtual bool navigateToViewLocation (const ViewLocation &viewLocation, bool center=false) override
 
virtual BinaryNinja::Ref< HistoryEntrygetHistoryEntry () override
 
virtual void navigateToHistoryEntry (BinaryNinja::Ref< HistoryEntry > entry) override
 
virtual StatusBarWidgetgetStatusBarWidget () override
 
virtual ViewPaneHeaderSubtypeWidgetgetHeaderSubtypeWidget () override
 
virtual QWidget * getHeaderOptionsWidget () override
 
virtual BNFunctionGraphType getILViewType () override
 
virtual void setILViewType (BNFunctionGraphType ilViewType) override
 
void setOption (BNDisassemblyOption option, bool state=true)
 
void toggleOption (BNDisassemblyOption option)
 
virtual DisassemblySettingsRef getDisassemblySettings () override
 
virtual void setDisassemblySettings (DisassemblySettingsRef settings) override
 
virtual void notifyUpdateInProgress (FunctionRef func) override
 
virtual void onFunctionSelected (FunctionRef func) override
 
virtual void onHighlightChanged (const HighlightTokenState &highlight) override
 
- Public Member Functions inherited from FlowGraphWidget
 FlowGraphWidget (QWidget *parent, BinaryViewRef view, FlowGraphRef graph=FlowGraphRef())
 
 ~FlowGraphWidget ()
 
virtual void OnAnalysisFunctionUpdated (BinaryNinja::BinaryView *data, BinaryNinja::Function *func) override
 
virtual void OnAnalysisFunctionUpdateRequested (BinaryNinja::BinaryView *data, BinaryNinja::Function *func) override
 
virtual void OnDataMetadataUpdated (BinaryNinja::BinaryView *data, uint64_t offset) override
 
virtual void OnTagUpdated (BinaryNinja::BinaryView *data, const BinaryNinja::TagReference &tagRef) override
 
void setInitialGraph (FlowGraphRef graph)
 
void setInitialGraph (FlowGraphRef graph, uint64_t addr)
 
void setGraph (FlowGraphRef graph)
 
void setGraph (FlowGraphRef graph, uint64_t addr)
 
void setGraphAtIndex (FlowGraphRef graph, size_t index)
 
void setGraph (FlowGraphRef graph, BinaryNinja::Ref< FlowGraphHistoryEntry > entry)
 
void setRelatedGraph (FlowGraphRef graph)
 
void setRelatedGraph (FlowGraphRef graph, uint64_t addr)
 
void updateToGraph (FlowGraphRef graph)
 
virtual void updateFonts () override
 
virtual BinaryViewRef getData () override
 
virtual uint64_t getCurrentOffset () override
 
virtual BNAddressRange getSelectionOffsets () override
 
virtual SelectionInfoForXref getSelectionForXref () override
 
virtual void setSelectionOffsets (BNAddressRange range) override
 
virtual bool navigate (uint64_t pos) override
 
virtual bool navigateToFunction (FunctionRef func, uint64_t pos) override
 
virtual bool navigateToViewLocation (const ViewLocation &viewLocation, bool center=false) override
 
bool navigateWithHistoryEntry (uint64_t addr, BinaryNinja::Ref< FlowGraphHistoryEntry > entry)
 
bool navigateWithHistoryEntry (FunctionRef func, uint64_t addr, BinaryNinja::Ref< FlowGraphHistoryEntry > entry)
 
void setNavigationTarget (View *target)
 
virtual void clearRelatedHighlights () override
 
virtual void setRelatedIndexHighlights (FunctionRef func, const std::set< size_t > &related) override
 
virtual void setRelatedInstructionHighlights (FunctionRef func, const std::set< uint64_t > &related) override
 
virtual void zoom (bool direction)
 
virtual void zoomActual ()
 
virtual bool event (QEvent *event) override
 
void disableZoom ()
 
virtual void sendWheelEvent (QWheelEvent *event) override
 
virtual void cut () override
 
virtual void copy (TransformRef xform) override
 
virtual void paste (TransformRef xform) override
 
virtual bool canAssemble () override
 
virtual bool canCompile () override
 
virtual bool canPaste () override
 
virtual void closing () override
 
virtual BinaryNinja::Ref< HistoryEntrygetHistoryEntry () override
 
void populateDefaultHistoryEntry (FlowGraphHistoryEntry *entry)
 
virtual void navigateToHistoryEntry (BinaryNinja::Ref< HistoryEntry > entry) override
 
virtual FunctionRef getCurrentFunction () override
 
virtual BasicBlockRef getCurrentBasicBlock () override
 
virtual ArchitectureRef getCurrentArchitecture () override
 
virtual LowLevelILFunctionRef getCurrentLowLevelILFunction () override
 
virtual MediumLevelILFunctionRef getCurrentMediumLevelILFunction () override
 
virtual HighLevelILFunctionRef getCurrentHighLevelILFunction () override
 
virtual size_t getCurrentILInstructionIndex () override
 
void scrollToCursor (bool center=false)
 
bool isUpdating ()
 
QFont getFont () override
 
virtual HighlightTokenState getHighlightTokenState () override
 
void paintMiniGraphAndViewport (QWidget *owner, QRect &miniRenderRect)
 
bool paintMiniGraph (QWidget *owner, QPainter &p, QRect &miniRenderRect)
 
void paintNode (QPainter &p, FlowGraphNodeRef &node, int minY, int maxY)
 
void paintHighlight (QPainter &p, const std::vector< BinaryNinja::DisassemblyTextLine > &lines, int nodeX, int nodeWidth, int x, int y, size_t line, int tagIndent)
 
void paintEdge (QPainter &p, const FlowGraphNodeRef &node, const BinaryNinja::FlowGraphEdge &edge)
 
void showAddress (uint64_t addr, bool select=false, bool center=false)
 
void showIndex (size_t index, bool center=false)
 
void showTopNode ()
 
void showNode (FlowGraphNodeRef node)
 
void showLineInNode (FlowGraphNodeRef node, size_t lineIndex)
 
void ensureCursorVisible ()
 
void viewInTypesView (std::string typeName, uint64_t offset=0)
 
void setInstructionHighlight (BNHighlightColor color)
 
void setBlockHighlight (BNHighlightColor color)
 
virtual bool goToReference (FunctionRef func, uint64_t source, uint64_t target) override
 
void setHighlightToken (const HighlightTokenState &state, bool notify=true)
 
virtual void notifyUpdateInProgress (FunctionRef func)
 
virtual void onFunctionSelected (FunctionRef func)
 
virtual void onHighlightChanged (const HighlightTokenState &highlight)
 
bool getNodeForMouseEvent (QMouseEvent *event, FlowGraphNodeRef &node)
 
bool getLineForMouseEvent (QMouseEvent *event, CursorPosition &pos)
 
bool getEdgeForMouseEvent (QMouseEvent *event, FlowGraphNodeRef &source, BinaryNinja::FlowGraphEdge &edge, bool &incoming)
 
FlowGraphWidgetduplicate ()
 
- Public Member Functions inherited from View
 View ()
 
virtual ~View ()
 
void setupView (QWidget *widget)
 
virtual bool canAssemble ()
 
virtual bool canCompile ()
 
virtual bool findNextData (uint64_t start, uint64_t end, const BinaryNinja::DataBuffer &data, uint64_t &addr, BNFindFlag flags, const std::function< bool(size_t current, size_t total)> &cb)
 
virtual bool findNextText (uint64_t start, uint64_t end, const std::string &text, uint64_t &addr, DisassemblySettingsRef settings, BNFindFlag flags, BNFunctionGraphType graph, const std::function< bool(size_t current, size_t total)> &cb)
 
virtual bool findNextConstant (uint64_t start, uint64_t end, uint64_t constant, uint64_t &addr, DisassemblySettingsRef settings, BNFunctionGraphType graph, const std::function< bool(size_t current, size_t total)> &cb)
 
virtual bool findAllData (uint64_t start, uint64_t end, const BinaryNinja::DataBuffer &data, BNFindFlag flags, const std::function< bool(size_t current, size_t total)> &cb, const std::function< bool(uint64_t addr, const BinaryNinja::DataBuffer &match)> &matchCallback)
 
virtual bool findAllText (uint64_t start, uint64_t end, const std::string &data, DisassemblySettingsRef settings, BNFindFlag flags, BNFunctionGraphType graph, const std::function< bool(size_t current, size_t total)> &cb, const std::function< bool(uint64_t addr, const std::string &match, const BinaryNinja::LinearDisassemblyLine &line)> &matchCallback)
 
virtual bool findAllConstant (uint64_t start, uint64_t end, uint64_t constant, DisassemblySettingsRef settings, BNFunctionGraphType graph, const std::function< bool(size_t current, size_t total)> &cb, const std::function< bool(uint64_t addr, const BinaryNinja::LinearDisassemblyLine &line)> &matchCallback)
 
virtual BinaryViewRef getData ()=0
 
virtual uint64_t getCurrentOffset ()=0
 
virtual BNAddressRange getSelectionOffsets ()
 
virtual SelectionInfoForXref getSelectionForXref ()
 
virtual void setSelectionOffsets (BNAddressRange range)=0
 
virtual bool navigate (uint64_t offset)=0
 
virtual bool navigateToFunction (FunctionRef func, uint64_t offset)
 
virtual bool goToReference (FunctionRef func, uint64_t source, uint64_t target)
 
virtual bool navigateToViewLocation (const ViewLocation &viewLocation, bool center=false)
 
bool navigateOnOtherPane (uint64_t offset)
 
bool navigateToFunctionOnOtherPane (FunctionRef func, uint64_t offset)
 
bool isBinaryDataNavigable ()
 
void setBinaryDataNavigable (bool navigable)
 
virtual bool closeRequest ()
 
virtual void closing ()
 
virtual void updateFonts ()
 
virtual void updateTheme ()
 
virtual void undo ()
 
virtual void redo ()
 
virtual bool canUndo ()
 
virtual bool canRedo ()
 
virtual void cut ()
 
virtual void copy (TransformRef xform=nullptr)
 
virtual void copyAddress ()
 
virtual void paste (TransformRef xform=nullptr)
 
virtual bool canCut ()
 
virtual bool canCopy ()
 
virtual bool canCopyWithTransform ()
 
virtual bool canCopyAddress ()
 
virtual bool canPaste ()
 
virtual bool canPasteWithTransform ()
 
virtual void transform (TransformRef xform, bool encode)
 
virtual bool canTransform ()
 
virtual void writeData (const BinaryNinja::DataBuffer &data, uint64_t addr)
 
virtual bool canDisplayAs (const UIActionContext &context, const BNIntegerDisplayType)
 
virtual void displayAs (const UIActionContext &context, BNIntegerDisplayType type)
 
virtual BinaryNinja::Ref< HistoryEntrygetHistoryEntry ()
 
virtual void navigateToHistoryEntry (BinaryNinja::Ref< HistoryEntry > entry)
 
virtual StatusBarWidgetgetStatusBarWidget ()
 
virtual ViewPaneHeaderSubtypeWidgetgetHeaderSubtypeWidget ()
 
virtual QWidget * getHeaderOptionsWidget ()
 
virtual FunctionRef getCurrentFunction ()
 
virtual BasicBlockRef getCurrentBasicBlock ()
 
virtual ArchitectureRef getCurrentArchitecture ()
 
virtual LowLevelILFunctionRef getCurrentLowLevelILFunction ()
 
virtual MediumLevelILFunctionRef getCurrentMediumLevelILFunction ()
 
virtual HighLevelILFunctionRef getCurrentHighLevelILFunction ()
 
virtual BNFunctionGraphType getILViewType ()
 
virtual void setILViewType (BNFunctionGraphType ilViewType)
 
virtual size_t getCurrentILInstructionIndex ()
 
virtual QFont getFont ()=0
 
virtual DisassemblySettingsRef getDisassemblySettings ()
 
virtual void setDisassemblySettings (DisassemblySettingsRef settings)
 
virtual HighlightTokenState getHighlightTokenState ()
 
virtual UIActionContext actionContext ()
 
MenucontextMenu ()
 
UIActionHandleractionHandler ()
 
QWidget * widget ()
 
QString viewType ()
 
void updateCrossReferenceSelection (ViewFrame *frame=nullptr)
 
void forceSyncFromView (ViewFrame *frame=nullptr)
 
virtual void clearRelatedHighlights ()
 
virtual void setRelatedIndexHighlights (FunctionRef func, const std::set< size_t > &related)
 
virtual void setRelatedInstructionHighlights (FunctionRef func, const std::set< uint64_t > &related)
 
- Public Member Functions inherited from PreviewScrollHandler
virtual ~PreviewScrollHandler ()
 
virtual void sendWheelEvent (QWheelEvent *event)=0
 
- Public Member Functions inherited from BinaryNinja::BinaryDataNotification
 BinaryDataNotification ()
 
virtual ~BinaryDataNotification ()
 
BNBinaryDataNotificationGetCallbacks ()
 
virtual void OnBinaryDataWritten (BinaryView *view, uint64_t offset, size_t len)
 
virtual void OnBinaryDataInserted (BinaryView *view, uint64_t offset, size_t len)
 
virtual void OnBinaryDataRemoved (BinaryView *view, uint64_t offset, uint64_t len)
 
virtual void OnAnalysisFunctionAdded (BinaryView *view, Function *func)
 
virtual void OnAnalysisFunctionRemoved (BinaryView *view, Function *func)
 
virtual void OnAnalysisFunctionUpdated (BinaryView *view, Function *func)
 
virtual void OnAnalysisFunctionUpdateRequested (BinaryView *view, Function *func)
 
virtual void OnDataVariableAdded (BinaryView *view, const DataVariable &var)
 
virtual void OnDataVariableRemoved (BinaryView *view, const DataVariable &var)
 
virtual void OnDataVariableUpdated (BinaryView *view, const DataVariable &var)
 
virtual void OnDataMetadataUpdated (BinaryView *view, uint64_t offset)
 
virtual void OnTagTypeUpdated (BinaryView *view, Ref< TagType > tagTypeRef)
 
virtual void OnTagAdded (BinaryView *view, const TagReference &tagRef)
 
virtual void OnTagUpdated (BinaryView *view, const TagReference &tagRef)
 
virtual void OnTagRemoved (BinaryView *view, const TagReference &tagRef)
 
virtual void OnSymbolAdded (BinaryView *view, Symbol *sym)
 
virtual void OnSymbolUpdated (BinaryView *view, Symbol *sym)
 
virtual void OnSymbolRemoved (BinaryView *view, Symbol *sym)
 
virtual void OnStringFound (BinaryView *data, BNStringType type, uint64_t offset, size_t len)
 
virtual void OnStringRemoved (BinaryView *data, BNStringType type, uint64_t offset, size_t len)
 
virtual void OnTypeDefined (BinaryView *data, const QualifiedName &name, Type *type)
 
virtual void OnTypeUndefined (BinaryView *data, const QualifiedName &name, Type *type)
 
virtual void OnTypeReferenceChanged (BinaryView *data, const QualifiedName &name, Type *type)
 
virtual void OnTypeFieldReferenceChanged (BinaryView *data, const QualifiedName &name, uint64_t offset)
 

Static Public Member Functions

static void registerActions ()
 
- Static Public Member Functions inherited from View
static ViewgetViewFromWidget (QWidget *widget)
 
static void registerActions ()
 
static void registerLateActions ()
 

Friends

class DisassemblyFunctionHeader
 

Additional Inherited Members

- Signals inherited from FlowGraphWidget
void layoutComplete ()
 
void updateMiniGraph ()
 
- Protected Member Functions inherited from FlowGraphWidget
virtual void paintEvent (QPaintEvent *event) override
 
virtual void resizeEvent (QResizeEvent *event) override
 
virtual void mousePressEvent (QMouseEvent *event) override
 
virtual void mouseReleaseEvent (QMouseEvent *event) override
 
virtual void mouseMoveEvent (QMouseEvent *event) override
 
virtual void mouseDoubleClickEvent (QMouseEvent *event) override
 
virtual void wheelEvent (QWheelEvent *event) override
 
virtual void customEvent (QEvent *event) override
 
virtual void scrollContentsBy (int dx, int dy) override
 
HighlightTokenState getTokenForMouseEvent (QMouseEvent *event)
 
virtual void contextMenuEvent (QContextMenuEvent *) override
 
void bindActions ()
 
void navigateToAddress (uint64_t addr)
 
void navigateToGotoLabel (uint64_t label)
 
void setGraphInternal (FlowGraphRef graph, BinaryNinja::Ref< FlowGraphHistoryEntry > entry, bool useAddr, uint64_t addr, bool notify, bool recenterWithPreviousGraph, size_t index=BN_INVALID_EXPR)
 
void up (bool selecting, size_t count=1)
 
void down (bool selecting, size_t count=1)
 
void left (bool selecting)
 
void right (bool selecting)
 
void leftToSymbol (bool selecting)
 
void rightToSymbol (bool selecting)
 
void pageUp (bool selecting)
 
void pageDown (bool selecting)
 
void moveToStartOfLine (bool selecting)
 
void moveToEndOfLine (bool selecting)
 
void moveToStartOfView ()
 
void moveToEndOfView ()
 
void selectAll ()
 
void selectNone ()
 
void navigateToHighlightedToken ()
 
uint64_t getTokenAddress ()
 
- Protected Member Functions inherited from View
bool writeDataToClipboard (const BinaryNinja::DataBuffer &data, bool binary, TransformRef xform)
 
BinaryNinja::DataBuffer readDataFromClipboard (TransformRef xform)
 
virtual std::string getNavigationMode ()
 
virtual void setNavigationMode (std::string mode)
 
virtual std::vector< std::string > getNavigationModes ()
 
- Protected Attributes inherited from View
Menu m_contextMenu
 
UIActionHandler m_actionHandler
 
bool m_binaryDataNavigable = false
 
QPointer< TransformParameterDialogm_transformParamDialog
 

Constructor & Destructor Documentation

◆ DisassemblyView()

DisassemblyView::DisassemblyView ( DisassemblyContainer parent,
BinaryViewRef  data,
FunctionRef  func = nullptr,
bool  navToAddr = false,
uint64_t  addr = 0 
)
explicit

Member Function Documentation

◆ getDisassemblySettings()

virtual DisassemblySettingsRef DisassemblyView::getDisassemblySettings ( )
overridevirtual

Reimplemented from View.

◆ getHeaderOptionsWidget()

virtual QWidget * DisassemblyView::getHeaderOptionsWidget ( )
overridevirtual

Reimplemented from View.

◆ getHeaderSubtypeWidget()

virtual ViewPaneHeaderSubtypeWidget * DisassemblyView::getHeaderSubtypeWidget ( )
overridevirtual

Reimplemented from View.

◆ getHistoryEntry()

virtual BinaryNinja::Ref< HistoryEntry > DisassemblyView::getHistoryEntry ( )
overridevirtual

Reimplemented from FlowGraphWidget.

◆ getILViewType()

virtual BNFunctionGraphType DisassemblyView::getILViewType ( )
inlineoverridevirtual

Reimplemented from View.

◆ getStatusBarWidget()

virtual StatusBarWidget * DisassemblyView::getStatusBarWidget ( )
overridevirtual

Reimplemented from View.

◆ navigate()

virtual bool DisassemblyView::navigate ( uint64_t  pos)
overridevirtual

Reimplemented from FlowGraphWidget.

◆ navigateToFunction()

virtual bool DisassemblyView::navigateToFunction ( FunctionRef  func,
uint64_t  pos 
)
overridevirtual

Reimplemented from FlowGraphWidget.

◆ navigateToHistoryEntry()

virtual void DisassemblyView::navigateToHistoryEntry ( BinaryNinja::Ref< HistoryEntry entry)
overridevirtual

Reimplemented from FlowGraphWidget.

◆ navigateToViewLocation()

virtual bool DisassemblyView::navigateToViewLocation ( const ViewLocation viewLocation,
bool  center = false 
)
overridevirtual

Reimplemented from FlowGraphWidget.

◆ notifyUpdateInProgress()

virtual void DisassemblyView::notifyUpdateInProgress ( FunctionRef  func)
overridevirtual

Reimplemented from FlowGraphWidget.

◆ onFunctionSelected()

virtual void DisassemblyView::onFunctionSelected ( FunctionRef  func)
overridevirtual

Reimplemented from FlowGraphWidget.

◆ onHighlightChanged()

virtual void DisassemblyView::onHighlightChanged ( const HighlightTokenState highlight)
overridevirtual

Reimplemented from FlowGraphWidget.

◆ registerActions()

static void DisassemblyView::registerActions ( )
static

◆ setDisassemblySettings()

virtual void DisassemblyView::setDisassemblySettings ( DisassemblySettingsRef  settings)
overridevirtual

Reimplemented from View.

◆ setILViewType()

virtual void DisassemblyView::setILViewType ( BNFunctionGraphType  ilViewType)
overridevirtual

Reimplemented from View.

◆ setOption()

void DisassemblyView::setOption ( BNDisassemblyOption  option,
bool  state = true 
)

◆ toggleOption()

void DisassemblyView::toggleOption ( BNDisassemblyOption  option)

◆ updateFonts()

virtual void DisassemblyView::updateFonts ( )
overridevirtual

Reimplemented from FlowGraphWidget.

Friends And Related Function Documentation

◆ DisassemblyFunctionHeader

friend class DisassemblyFunctionHeader
friend

The documentation for this class was generated from the following file: