| 219 | |
| 220 | |
| 221 | void TriageView::navigateToFileOffset(uint64_t offset) |
| 222 | { |
| 223 | if (!m_byteView) |
| 224 | { |
| 225 | uint64_t addr = 0; |
| 226 | bool hasAddr = m_data->GetAddressForDataOffset(offset, addr); |
| 227 | ViewFrame* frame = ViewFrame::viewFrameForWidget(this); |
| 228 | if (!frame) |
| 229 | return; |
| 230 | if (!hasAddr) |
| 231 | frame->navigate("Hex:Raw", offset); |
| 232 | else if (BinaryNinja::Settings::Instance()->Get<bool>("ui.view.graph.preferred") && |
| 233 | frame->getCurrentBinaryView() && |
| 234 | frame->getCurrentBinaryView()->GetAnalysisFunctionsForAddress(offset).size() > 0) |
| 235 | { |
| 236 | frame->navigate("Graph:" + frame->getCurrentDataType(), offset); |
| 237 | } |
| 238 | else |
| 239 | { |
| 240 | frame->navigate("Linear:" + frame->getCurrentDataType(), offset); |
| 241 | } |
| 242 | } |
| 243 | else |
| 244 | { |
| 245 | uint64_t addr; |
| 246 | bool hasAddr; |
| 247 | if (m_data == m_data->GetFile()->GetViewOfType("Raw")) |
| 248 | { |
| 249 | addr = offset; |
| 250 | hasAddr = true; |
| 251 | } |
| 252 | else |
| 253 | { |
| 254 | hasAddr = m_data->GetAddressForDataOffset(offset, addr); |
| 255 | } |
| 256 | if (!hasAddr) |
| 257 | { |
| 258 | ViewFrame* frame = ViewFrame::viewFrameForWidget(this); |
| 259 | if (frame) |
| 260 | frame->navigate("Hex:Raw", offset); |
| 261 | } |
| 262 | else |
| 263 | { |
| 264 | m_byteView->navigate(addr); |
| 265 | m_byteView->setFocus(Qt::OtherFocusReason); |
| 266 | } |
| 267 | } |
| 268 | } |
| 269 | |
| 270 | |
| 271 | void TriageView::focusInEvent(QFocusEvent*) |
no test coverage detected