Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cspell.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ words:
- Opfer
- Pixmap
- Polyline
- PTRACE_POKEDATA
- qcommonstyle
- qgetenv
- qlonglong
Expand Down
70 changes: 35 additions & 35 deletions plugins/Analyzer/Analyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace {

constexpr int MinRefCount = 2;
/**
* @brief will_return
* @brief Returns true if the function at the given address is not marked as non-returning.
* @param address
* @return
*/
Expand All @@ -68,7 +68,7 @@ bool will_return(edb::address_t address) {
}

/**
* @brief is_entrypoint
* @brief Returns true if the given symbol represents the ELF process entry point (_start).
* @param sym
* @return
*/
Expand All @@ -81,7 +81,7 @@ bool is_entrypoint(const Symbol &sym) {
}

/**
* @brief is_thunk
* @brief Returns true if the function at the given address begins with an unconditional jump, indicating a thunk.
* @param address
* @return true if the first instruction of the function is a jmp
*/
Expand All @@ -97,7 +97,7 @@ bool is_thunk(edb::address_t address) {
}

/**
* @brief set_function_types
* @brief Classifies each function in the map as either a thunk or a standard function based on its entry instruction.
* @param results
*/
void set_function_types(IAnalyzer::FunctionMap *results) {
Expand All @@ -123,7 +123,7 @@ void set_function_types(IAnalyzer::FunctionMap *results) {
}

/**
* @brief module_entry_point
* @brief Returns the entry point address of the binary module that contains the given memory region.
* @param region
* @return
*/
Expand All @@ -150,23 +150,23 @@ edb::address_t module_entry_point(const std::shared_ptr<IRegion> &region) {
}

/**
* @brief Analyzer::Analyzer
* @brief Constructs the Analyzer plugin object.
* @param parent
*/
Analyzer::Analyzer(QObject *parent)
: QObject(parent) {
}

/**
* @brief Analyzer::optionsPage
* @brief Returns the plugin's configuration options widget.
* @return
*/
QWidget *Analyzer::optionsPage() {
return new OptionsPage;
}

/**
* @brief Analyzer::menu
* @brief Creates and returns the Analyzer plugin menu, adding toolbar and dock widgets on first call.
* @param parent
* @return
*/
Expand Down Expand Up @@ -208,22 +208,22 @@ QMenu *Analyzer::menu(QWidget *parent) {
}

/**
* @brief Analyzer::privateInit
* @brief Registers this instance as the global active analyzer.
*/
void Analyzer::privateInit() {
edb::v1::set_analyzer(this);
}

/**
* @brief Analyzer::showSpecified
* @brief Opens or raises the dialog listing user-specified function start addresses.
*/
void Analyzer::showSpecified() {
static auto dialog = new SpecifiedFunctions(edb::v1::debugger_ui);
dialog->show();
}

/**
* @brief Analyzer::doIpAnalysis
* @brief Analyzes the memory region containing the current instruction pointer.
*/
void Analyzer::doIpAnalysis() {
if (IProcess *process = edb::v1::debugger_core->process()) {
Expand All @@ -240,14 +240,14 @@ void Analyzer::doIpAnalysis() {
}

/**
* @brief Analyzer::doViewAnalysis
* @brief Analyzes the memory region currently visible in the CPU disassembly view.
*/
void Analyzer::doViewAnalysis() {
doAnalysis(edb::v1::current_cpu_view_region());
}

/**
* @brief Analyzer::markFunctionStart
* @brief Marks the currently selected address as a known function start and invalidates the region's analysis.
*/
void Analyzer::markFunctionStart() {

Expand All @@ -260,7 +260,7 @@ void Analyzer::markFunctionStart() {
}

/**
* @brief Analyzer::showXrefs
* @brief Opens a dialog listing all cross-references that target the currently selected address.
*/
void Analyzer::showXrefs() {

Expand All @@ -284,7 +284,7 @@ void Analyzer::showXrefs() {
dialog->show();
}
/**
* @brief Analyzer::gotoFunctionStart
* @brief Jumps the disassembly view to the entry address of the function containing the selected address.
*/
void Analyzer::gotoFunctionStart() {

Expand All @@ -303,7 +303,7 @@ void Analyzer::gotoFunctionStart() {
}

/**
* @brief Analyzer::gotoFunctionEnd
* @brief Jumps the disassembly view to the last instruction of the function containing the selected address.
*/
void Analyzer::gotoFunctionEnd() {

Expand All @@ -321,7 +321,7 @@ void Analyzer::gotoFunctionEnd() {
tr("The selected instruction is not inside of a known function. Have you run an analysis of this region?"));
}
/**
* @brief Analyzer::cpuContextMenu
* @brief Returns the list of CPU context menu actions contributed by the Analyzer plugin.
* @return
*/
QList<QAction *> Analyzer::cpuContextMenu() {
Expand All @@ -346,7 +346,7 @@ QList<QAction *> Analyzer::cpuContextMenu() {
}

/**
* @brief Analyzer::doAnalysis
* @brief Runs a full analysis pass on the given region, showing progress and repainting the CPU view on completion.
* @param region
*/
void Analyzer::doAnalysis(const std::shared_ptr<IRegion> &region) {
Expand All @@ -361,7 +361,7 @@ void Analyzer::doAnalysis(const std::shared_ptr<IRegion> &region) {
}

/**
* @brief Analyzer::bonusMain
* @brief Seeds the known-function list with the address of main() if it can be located in the region.
* @param data
*/
void Analyzer::bonusMain(RegionData *data) const {
Expand All @@ -381,7 +381,7 @@ void Analyzer::bonusMain(RegionData *data) const {
}

/**
* @brief Analyzer::bonusSymbols
* @brief Seeds the known-function list with all code symbol addresses that fall within the region.
* @param data
*/
void Analyzer::bonusSymbols(RegionData *data) {
Expand All @@ -406,7 +406,7 @@ void Analyzer::bonusSymbols(RegionData *data) {
}

/**
* @brief Analyzer::bonusMarkedFunctions
* @brief Seeds the known-function list with all user-specified function addresses that fall within the region.
* @param data
*/
void Analyzer::bonusMarkedFunctions(RegionData *data) {
Expand All @@ -422,7 +422,7 @@ void Analyzer::bonusMarkedFunctions(RegionData *data) {
}

/**
* @brief Analyzer::identHeader
* @brief Hook for identifying executable header information within the region; currently a no-op.
* @param data
*/
void Analyzer::identHeader(Analyzer::RegionData *data) {
Expand Down Expand Up @@ -481,7 +481,7 @@ void Analyzer::computeNonReturning(Analyzer::RegionData *data) {
}

/**
* @brief Analyzer::collectFunctions
* @brief Performs recursive disassembly from all known entry points to build the complete function and basic block maps.
* @param data
*/
void Analyzer::collectFunctions(Analyzer::RegionData *data) {
Expand Down Expand Up @@ -632,7 +632,7 @@ void Analyzer::collectFunctions(Analyzer::RegionData *data) {
}

/**
* @brief Analyzer::collectFuzzyFunctions
* @brief Heuristically discovers additional function entry points by scanning for call targets and ENDBR instructions.
* @param data
*/
void Analyzer::collectFuzzyFunctions(RegionData *data) {
Expand Down Expand Up @@ -694,7 +694,7 @@ void Analyzer::collectFuzzyFunctions(RegionData *data) {
}

/**
* @brief Analyzer::analyze
* @brief Runs all analysis pipeline steps on the given region, caching results and emitting progress updates.
* @param region
*/
void Analyzer::analyze(const std::shared_ptr<IRegion> &region) {
Expand Down Expand Up @@ -770,7 +770,7 @@ void Analyzer::analyze(const std::shared_ptr<IRegion> &region) {
}

/**
* @brief Analyzer::category
* @brief Returns the role of the given address (function start, body, end, or unknown) relative to known functions.
* @param address
* @return
*/
Expand All @@ -792,7 +792,7 @@ IAnalyzer::AddressCategory Analyzer::category(edb::address_t address) const {
}

/**
* @brief Analyzer::functions
* @brief Returns the map of all functions found within the given memory region.
* @param region
* @return
*/
Expand All @@ -801,7 +801,7 @@ IAnalyzer::FunctionMap Analyzer::functions(const std::shared_ptr<IRegion> &regio
}

/**
* @brief Analyzer::functions
* @brief Returns the combined map of all functions across every analyzed region.
* @return
*/
IAnalyzer::FunctionMap Analyzer::functions() const {
Expand All @@ -813,7 +813,7 @@ IAnalyzer::FunctionMap Analyzer::functions() const {
}

/**
* @brief Analyzer::findContainingFunction
* @brief Finds the function that contains the given address and stores it in the output parameter.
* @param address
* @param function
* @return
Expand Down Expand Up @@ -853,7 +853,7 @@ bool Analyzer::findContainingFunction(edb::address_t address, Function *function
}

/**
* @brief Analyzer::forFuncsInRange
* @brief Invokes a callback for each known function whose body overlaps the given address range.
*
* Calls functor once for every function that exists between the start and end
* addresses. This includes functions whose bodies include the start address.
Expand Down Expand Up @@ -893,7 +893,7 @@ bool Analyzer::forFuncsInRange(edb::address_t start, edb::address_t end, std::fu
}

/**
* @brief Analyzer::bonusEntryPoint
* @brief Seeds the known-function list with the module's binary entry point address.
* @param data
*/
void Analyzer::bonusEntryPoint(RegionData *data) const {
Expand All @@ -917,7 +917,7 @@ void Analyzer::bonusEntryPoint(RegionData *data) const {
}

/**
* @brief Analyzer::invalidateAnalysis
* @brief Clears cached analysis for the given region and removes any user-specified functions within it.
* @param region
*/
void Analyzer::invalidateAnalysis(const std::shared_ptr<IRegion> &region) {
Expand All @@ -931,7 +931,7 @@ void Analyzer::invalidateAnalysis(const std::shared_ptr<IRegion> &region) {
}

/**
* @brief Analyzer::invalidateDynamicAnalysis
* @brief Resets the dynamically-computed analysis data for the given region without affecting user-specified functions.
* @param region
*/
void Analyzer::invalidateDynamicAnalysis(const std::shared_ptr<IRegion> &region) {
Expand All @@ -944,15 +944,15 @@ void Analyzer::invalidateDynamicAnalysis(const std::shared_ptr<IRegion> &region)
}

/**
* @brief Analyzer::invalidateAnalysis
* @brief Clears all cached analysis data and all user-specified function addresses.
*/
void Analyzer::invalidateAnalysis() {
analysisInfo_.clear();
specifiedFunctions_.clear();
}

/**
* @brief Analyzer::findContainingFunction
* @brief Returns the entry point of the function containing the given address, or an error if none is found.
* @param address
* @return the entry point of the function which contains <address>
*/
Expand Down
10 changes: 5 additions & 5 deletions plugins/Analyzer/AnalyzerWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
namespace AnalyzerPlugin {

/**
* @brief AnalyzerWidget::AnalyzerWidget
* @brief Constructs the analyzer overview bar widget and connects it to the disassembly scroll view.
* @param parent
* @param f
*/
Expand Down Expand Up @@ -55,7 +55,7 @@ AnalyzerWidget::AnalyzerWidget(QWidget *parent, Qt::WindowFlags f)
}

/**
* @brief AnalyzerWidget::paintEvent
* @brief Renders a proportional color-coded map of analyzed functions across the current memory region.
* @param event
*/
void AnalyzerWidget::paintEvent(QPaintEvent *event) {
Expand Down Expand Up @@ -138,7 +138,7 @@ void AnalyzerWidget::paintEvent(QPaintEvent *event) {
}

/**
* @brief AnalyzerWidget::mousePressEvent
* @brief Handles a click on the overview bar by jumping the disassembly view to the corresponding address.
* @param event
*/
void AnalyzerWidget::mousePressEvent(QMouseEvent *event) {
Expand All @@ -162,7 +162,7 @@ void AnalyzerWidget::mousePressEvent(QMouseEvent *event) {
}

/**
* @brief AnalyzerWidget::mouseReleaseEvent
* @brief Clears the mouse-pressed tracking state when the mouse button is released.
* @param event
*/
void AnalyzerWidget::mouseReleaseEvent(QMouseEvent *event) {
Expand All @@ -171,7 +171,7 @@ void AnalyzerWidget::mouseReleaseEvent(QMouseEvent *event) {
}

/**
* @brief AnalyzerWidget::mouseMoveEvent
* @brief Forwards mouse drag events to mousePressEvent to keep the disassembly view in sync with the cursor.
* @param event
*/
void AnalyzerWidget::mouseMoveEvent(QMouseEvent *event) {
Expand Down
6 changes: 3 additions & 3 deletions plugins/Analyzer/DialogXRefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace AnalyzerPlugin {

/**
* @brief DialogXRefs::DialogXRefs
* @brief Constructs the cross-references dialog and sets up its UI.
* @param parent
*/
DialogXRefs::DialogXRefs(QWidget *parent, Qt::WindowFlags f)
Expand All @@ -18,7 +18,7 @@ DialogXRefs::DialogXRefs(QWidget *parent, Qt::WindowFlags f)
}

/**
* @brief DialogXRefs::on_listReferences_itemDoubleClicked
* @brief Jumps the disassembly view to the source address of the double-clicked cross-reference entry.
* @param item
*/
void DialogXRefs::on_listReferences_itemDoubleClicked(QListWidgetItem *item) {
Expand All @@ -28,7 +28,7 @@ void DialogXRefs::on_listReferences_itemDoubleClicked(QListWidgetItem *item) {
}

/**
* @brief DialogXRefs::addReference
* @brief Adds a new cross-reference to the dialog, formatting the source symbol name and target address.
* @param ref
*/
void DialogXRefs::addReference(const std::pair<edb::address_t, edb::address_t> &ref) {
Expand Down
Loading
Loading