MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / run

Method run

examples/triage/baseaddress.cpp:48–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46
47
48void BaseAddressDetectionThread::run()
49{
50 BaseAddressDetectionQtResults results;
51 uint64_t value;
52 string errorStr;
53
54 if (!BinaryNinja::BinaryView::ParseExpression(
55 m_view, m_inputs->AlignmentLineEdit->text().toStdString(), value, 0, errorStr))
56 {
57 results.Status = "Invalid alignment value (" + errorStr + ")";
58 emit ResultReady(results);
59 return;
60 }
61 uint32_t alignment = value;
62
63 if (!BinaryNinja::BinaryView::ParseExpression(
64 m_view, m_inputs->StrlenLineEdit->text().toStdString(), value, 0, errorStr))
65 {
66 results.Status = "Invalid minimum string length (" + errorStr + ")";
67 emit ResultReady(results);
68 return;
69 }
70 uint32_t minStrlen = value;
71
72 uint64_t upperBoundary;
73 if (!BinaryNinja::BinaryView::ParseExpression(
74 m_view, m_inputs->UpperBoundary->text().toStdString(), upperBoundary, 0, errorStr))
75 {
76 results.Status = "Invalid upper boundary address (" + errorStr + ")";
77 emit ResultReady(results);
78 return;
79 }
80
81 uint64_t lowerBoundary;
82 if (!BinaryNinja::BinaryView::ParseExpression(
83 m_view, m_inputs->LowerBoundary->text().toStdString(), lowerBoundary, 0, errorStr))
84 {
85 results.Status = "Invalid lower boundary address (" + errorStr + ")";
86 emit ResultReady(results);
87 return;
88 }
89
90 if (lowerBoundary >= upperBoundary)
91 {
92 results.Status = "Upper boundary address is less than lower";
93 emit ResultReady(results);
94 return;
95 }
96
97 if (!BinaryNinja::BinaryView::ParseExpression(
98 m_view, m_inputs->MaxPointersPerCluster->text().toStdString(), value, 0, errorStr))
99 {
100 results.Status = "Invalid max pointers (" + errorStr + ")";
101 emit ResultReady(results);
102 return;
103 }
104
105 uint32_t maxPointersPerCluster = value;

Callers

nothing calls this directly

Calls 5

textMethod · 0.80
GetScoresMethod · 0.80
DetectBaseAddressMethod · 0.45

Tested by

no test coverage detected