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

Method TryReadBEPointer

binaryreader.cpp:402–443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

400
401
402bool BinaryReader::TryReadBEPointer(uint64_t& result)
403{
404 size_t addressSize = m_view->GetAddressSize();
405 switch (addressSize)
406 {
407 case 1:
408 {
409 uint8_t r;
410 if (!BNRead8(m_stream, &r))
411 return false;
412 result = r;
413 break;
414 }
415 case 2:
416 {
417 uint16_t r;
418 if (!BNReadBE16(m_stream, &r))
419 return false;
420 result = r;
421 break;
422 }
423 case 4:
424 {
425 uint32_t r;
426 if (!BNReadBE32(m_stream, &r))
427 return false;
428 result = r;
429 break;
430 }
431 case 8:
432 {
433 if (!BNReadBE64(m_stream, &result))
434 return false;
435 break;
436 }
437 default:
438 {
439 return false;
440 }
441 }
442 return true;
443}
444
445
446uint64_t BinaryReader::GetOffset() const

Callers

nothing calls this directly

Calls 1

GetAddressSizeMethod · 0.45

Tested by

no test coverage detected