本文整理汇总了C++中BinaryStream::Read方法的典型用法代码示例。如果您正苦于以下问题:C++ BinaryStream::Read方法的具体用法?C++ BinaryStream::Read怎么用?C++ BinaryStream::Read使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BinaryStream
的用法示例。
在下文中一共展示了BinaryStream::Read方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: operator
bool operator()(BinaryStream const& rBinStrm, TOffset Offset, Operand* pOprd)
{
u16 Seg;
OffType Off;
rBinStrm.Read(Offset + sizeof(OffType), Seg);
rBinStrm.Read(Offset, Off);
pOprd->SetValue(Off);
pOprd->SetSegValue(Seg);
pOprd->SetType(OpType | O_SEG_VAL);
return true;
}
示例2: IsCompatible
bool GameBoyLoader::IsCompatible(BinaryStream const& rBinStrm)
{
if (rBinStrm.GetSize() < GAMEBOY_HEADER_OFFSET + sizeof m_GameBoyRom)
return false;
if (!rBinStrm.Read(GAMEBOY_HEADER_OFFSET, reinterpret_cast<u8*>(&m_GameBoyRom), sizeof m_GameBoyRom))
return false;
if (memcmp(m_GameBoyRom.NintendoLogo, s_NintendoLogo, NINTENDO_LOGO_LEN))
return false;
return true;
}
示例3: operator
bool operator()(BinaryStream const& rBinStrm, X86_Bit Bit, TOffset Offset, Instruction& rInsn, Operand* pOprd)
{
ConstType ct;
rBinStrm.Read(Offset, ct);
pOprd->SetValue(SignExtend<ConstType, Pos>(ct));
switch (Bit)
{
case X86_Bit_16: pOprd->SetType(O_REL16); break;
case X86_Bit_32: pOprd->SetType(O_REL32); break;
case X86_Bit_64: pOprd->SetType(O_REL64); break;
default: pOprd->SetType(O_NONE); break;
}
pOprd->SetOffset(static_cast<u8>(rInsn.GetLength()));
rInsn.Length() += sizeof(ct);
return true;
}
示例4: FormatCharacter
bool Architecture::FormatCharacter(
Document const& rDoc,
BinaryStream const& rBinStrm,
Address const& rAddr,
Character const& rChar,
std::string & rStrCell,
Cell::Mark::List & rMarks) const
{
std::ostringstream oss;
TOffset Off;
if (!rDoc.ConvertAddressToFileOffset(rAddr, Off))
return false;
switch (rChar.GetSubType())
{
case Character::AsciiCharacterType: default:
{
s8 Char;
if (!rBinStrm.Read(Off, Char))
return false;
switch (Char)
{
case '\0': oss << "\\0"; break;
case '\a': oss << "\\a"; break;
case '\b': oss << "\\b"; break;
case '\t': oss << "\\t"; break;
case '\n': oss << "\\n"; break;
case '\v': oss << "\\v"; break;
case '\f': oss << "\\f"; break;
case '\r': oss << "\\r"; break;
default: oss << Char; break;
}
}
}
rMarks.push_back(Cell::Mark(Cell::Mark::StringType, 1));
rStrCell = oss.str();
return true;
}
示例5: GetModRm
static x86::ModRM GetModRm(BinaryStream const& rBinStrm, TOffset Offset)
{
u8 ModRmByte;
rBinStrm.Read(Offset, ModRmByte);
return ModRmByte;
}