mirror of
https://github.com/jakcron/nstool
synced 2024-11-14 17:56:39 +00:00
[libhac] Misc.
This commit is contained in:
parent
696cd481e3
commit
735ace1749
2 changed files with 6 additions and 5 deletions
|
@ -84,12 +84,12 @@ void nn::hac::KernelCapabilityControl::fromBytes(const byte_t * data, size_t len
|
||||||
fnd::List<KernelCapabilityEntry> handleTableSizeCaps;
|
fnd::List<KernelCapabilityEntry> handleTableSizeCaps;
|
||||||
fnd::List<KernelCapabilityEntry> miscFlagsCaps;
|
fnd::List<KernelCapabilityEntry> miscFlagsCaps;
|
||||||
|
|
||||||
const uint32_t* raw_caps = (const uint32_t*)mRawBinary.data();
|
const le_uint32_t* raw_caps = (const le_uint32_t*)mRawBinary.data();
|
||||||
size_t cap_num = mRawBinary.size() / sizeof(uint32_t);
|
size_t cap_num = mRawBinary.size() / sizeof(uint32_t);
|
||||||
KernelCapabilityEntry cap;
|
KernelCapabilityEntry cap;
|
||||||
for (size_t i = 0; i < cap_num; i++)
|
for (size_t i = 0; i < cap_num; i++)
|
||||||
{
|
{
|
||||||
cap.setCap(le_word(raw_caps[i]));
|
cap.setCap(raw_caps[i].get());
|
||||||
switch (cap.getType())
|
switch (cap.getType())
|
||||||
{
|
{
|
||||||
case (kc::KC_THREAD_INFO) :
|
case (kc::KC_THREAD_INFO) :
|
||||||
|
|
|
@ -74,11 +74,12 @@ void nn::hac::KernelInitialProcessHeader::toBytes()
|
||||||
throw fnd::Exception(kModuleName, "Too many kernel capabilities");
|
throw fnd::Exception(kModuleName, "Too many kernel capabilities");
|
||||||
}
|
}
|
||||||
memcpy(hdr->capabilities, mKernelCapabilities.getBytes().data(), mKernelCapabilities.getBytes().size());
|
memcpy(hdr->capabilities, mKernelCapabilities.getBytes().data(), mKernelCapabilities.getBytes().size());
|
||||||
|
|
||||||
|
// stub remaining entries
|
||||||
if (mKernelCapabilities.getBytes().size() < kip::kKernCapabilitySize)
|
if (mKernelCapabilities.getBytes().size() < kip::kKernCapabilitySize)
|
||||||
{
|
{
|
||||||
|
memset(hdr->capabilities + mKernelCapabilities.getBytes().size(), 0xff, kip::kKernCapabilitySize - mKernelCapabilities.getBytes().size());
|
||||||
}
|
}
|
||||||
memset(hdr->capabilities + mKernelCapabilities.getBytes().size(), 0xff, kip::kKernCapabilitySize - mKernelCapabilities.getBytes().size());
|
|
||||||
|
|
||||||
// flags
|
// flags
|
||||||
for (size_t i = 0; i < mFlagList.size(); i++)
|
for (size_t i = 0; i < mFlagList.size(); i++)
|
||||||
|
|
Loading…
Reference in a new issue