本文整理汇总了C++中HostAddress::value方法的典型用法代码示例。如果您正苦于以下问题:C++ HostAddress::value方法的具体用法?C++ HostAddress::value怎么用?C++ HostAddress::value使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HostAddress
的用法示例。
在下文中一共展示了HostAddress::value方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getSectionByAddr
Byte BinaryImage::readNative1(Address addr) const
{
const BinarySection *section = getSectionByAddr(addr);
if (section == nullptr || section->getHostAddr() == HostAddress::INVALID) {
LOG_WARN("Invalid read at address %1: Address is not mapped to a section", addr);
return 0xFF;
}
HostAddress host = section->getHostAddr() - section->getSourceAddr() + addr;
return *reinterpret_cast<Byte *>(host.value());
}
示例2: if
QWord BinaryImage::readNative8(Address addr) const
{
const BinarySection *si = getSectionByAddr(addr);
if (si == nullptr || si->getHostAddr() == HostAddress::INVALID) {
LOG_WARN("Invalid read at address %1: Address is not mapped to a section", addr.toString());
return 0x0000000000000000;
}
else if (addr + 8 > si->getSourceAddr() + si->getSize()) {
LOG_WARN("Invalid read at address %1: Read extends past section boundary", addr);
return 0x0000000000000000;
}
else if (si->isAddressBss(addr)) {
return 0x0000000000000000;
}
HostAddress host = si->getHostAddr() - si->getSourceAddr() + addr;
return Util::readQWord(reinterpret_cast<const Byte *>(host.value()), si->getEndian());
}