mirror of https://github.com/infosecn1nja/C3.git
Merge branch 'master' into Shellcode
commit
474662bc8e
|
@ -329,11 +329,7 @@ namespace MWR
|
|||
if (lhs.size() != rhs.size())
|
||||
return false;
|
||||
|
||||
for (size_t i = 0; i < lhs.size(); ++i)
|
||||
if (lhs[i] != rhs[i])
|
||||
return false;
|
||||
|
||||
return true;
|
||||
return !memcmp(lhs.data(), rhs.data(), lhs.size());
|
||||
}
|
||||
|
||||
/// Checks if the contents of lhs and rhs are equal.
|
||||
|
|
|
@ -135,6 +135,8 @@ namespace MWR
|
|||
using Super::find_last_not_of;
|
||||
using Super::npos;
|
||||
using Super::value_type;
|
||||
friend inline bool operator==(ByteView const& lhs, ByteView const& rhs);
|
||||
friend inline bool operator!=(ByteView const& lhs, ByteView const& rhs);
|
||||
|
||||
/// Read bytes and move ByteView to position after parsed data.
|
||||
/// @param byteCount. How many bytes should be read.
|
||||
|
@ -231,6 +233,25 @@ namespace MWR
|
|||
return { reinterpret_cast<const uint8_t*>(data), size * sizeof(wchar_t) };
|
||||
}
|
||||
}
|
||||
|
||||
/// Checks if the contents of lhs and rhs are equal.
|
||||
/// @param lhs. Left hand side of operator.
|
||||
/// @param rhs. Right hand side of operator.
|
||||
inline bool operator==(MWR::ByteView const& lhs, MWR::ByteView const& rhs)
|
||||
{
|
||||
if (lhs.size() != rhs.size())
|
||||
return false;
|
||||
|
||||
return !memcmp(lhs.data(), rhs.data(), lhs.size());
|
||||
}
|
||||
|
||||
/// Checks if the contents of lhs and rhs are equal.
|
||||
/// @param lhs. Left hand side of operator.
|
||||
/// @param rhs. Right hand side of operator.
|
||||
inline bool operator!=(MWR::ByteView const& lhs, MWR::ByteView const& rhs)
|
||||
{
|
||||
return !(lhs == rhs);
|
||||
}
|
||||
}
|
||||
|
||||
namespace std
|
||||
|
|
Loading…
Reference in New Issue