本文整理汇总了C++中DataExtractor::ExtractBytes方法的典型用法代码示例。如果您正苦于以下问题:C++ DataExtractor::ExtractBytes方法的具体用法?C++ DataExtractor::ExtractBytes怎么用?C++ DataExtractor::ExtractBytes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataExtractor
的用法示例。
在下文中一共展示了DataExtractor::ExtractBytes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetSize
Error
ELFLinuxPrPsInfo::Parse(DataExtractor &data, ArchSpec &arch)
{
Error error;
ByteOrder byteorder = data.GetByteOrder();
if (GetSize(arch) > data.GetByteSize())
{
error.SetErrorStringWithFormat("NT_PRPSINFO size should be %lu, but the remaining bytes are: %lu",
GetSize(arch), data.GetByteSize());
return error;
}
switch(arch.GetCore())
{
case ArchSpec::eCore_s390x_generic:
case ArchSpec::eCore_x86_64_x86_64:
data.ExtractBytes(0, sizeof(ELFLinuxPrPsInfo), byteorder, this);
break;
case ArchSpec::eCore_x86_32_i386:
case ArchSpec::eCore_x86_32_i486:
{
// Parsing from a 32 bit ELF core file, and populating/reusing the structure
// properly, because the struct is for the 64 bit version
size_t size = 0;
offset_t offset = 0;
pr_state = data.GetU8(&offset);
pr_sname = data.GetU8(&offset);
pr_zomb = data.GetU8(&offset);
pr_nice = data.GetU8(&offset);
pr_flag = data.GetU32(&offset);
pr_uid = data.GetU16(&offset);
pr_gid = data.GetU16(&offset);
pr_pid = data.GetU32(&offset);
pr_ppid = data.GetU32(&offset);
pr_pgrp = data.GetU32(&offset);
pr_sid = data.GetU32(&offset);
size = 16;
data.ExtractBytes(offset, size, byteorder, pr_fname);
offset += size;
size = 80;
data.ExtractBytes(offset, size, byteorder, pr_psargs);
offset += size;
break;
}
default:
error.SetErrorStringWithFormat("ELFLinuxPrPsInfo::%s Unknown architecture", __FUNCTION__);
break;
}
return error;
}
示例2: GetGPRSize
RegisterContextCorePOSIX_x86_64::RegisterContextCorePOSIX_x86_64(
Thread &thread, RegisterInfoInterface *register_info,
const DataExtractor &gpregset, const DataExtractor &fpregset)
: RegisterContextPOSIX_x86(thread, 0, register_info) {
size_t size, len;
size = GetGPRSize();
m_gpregset.reset(new uint8_t[size]);
len =
gpregset.ExtractBytes(0, size, lldb::eByteOrderLittle, m_gpregset.get());
if (len != size)
m_gpregset.reset();
size = sizeof(FXSAVE);
m_fpregset.reset(new uint8_t[size]);
len =
fpregset.ExtractBytes(0, size, lldb::eByteOrderLittle, m_fpregset.get());
if (len != size)
m_fpregset.reset();
}
示例3: switch
bool
ELFLinuxPrPsInfo::Parse(DataExtractor &data, ArchSpec &arch)
{
ByteOrder byteorder = data.GetByteOrder();
size_t len;
switch(arch.GetCore())
{
case ArchSpec::eCore_x86_64_x86_64:
len = data.ExtractBytes(0, ELFLINUXPRPSINFO64_SIZE, byteorder, this);
return len == ELFLINUXPRPSINFO64_SIZE;
default:
return false;
}
}