mirror of
https://github.com/jakcron/nstool
synced 2024-11-23 05:59:29 +00:00
[hac] Add IdConverter.
This commit is contained in:
parent
b6a451442e
commit
c6847808a8
4 changed files with 45 additions and 0 deletions
21
lib/libhac/include/nn/hac/IdConverter.h
Normal file
21
lib/libhac/include/nn/hac/IdConverter.h
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
#pragma once
|
||||||
|
#include <fnd/types.h>
|
||||||
|
|
||||||
|
namespace nn
|
||||||
|
{
|
||||||
|
namespace hac
|
||||||
|
{
|
||||||
|
class IdConverter
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static uint64_t convertToAocBaseId(uint64_t application_id);
|
||||||
|
static uint64_t convertToDeltaId(uint64_t application_id);
|
||||||
|
static uint64_t convertToPatchId(uint64_t application_id);
|
||||||
|
|
||||||
|
private:
|
||||||
|
static const uint64_t kAocBaseId = 0x1000;
|
||||||
|
static const uint64_t kDeltaId = 0xc00;
|
||||||
|
static const uint64_t kPatchId = 0x800;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
|
@ -39,6 +39,7 @@
|
||||||
<ClInclude Include="include\nn\hac\HierarchicalIntegrityHeader.h" />
|
<ClInclude Include="include\nn\hac\HierarchicalIntegrityHeader.h" />
|
||||||
<ClInclude Include="include\nn\hac\hierarchicalsha256.h" />
|
<ClInclude Include="include\nn\hac\hierarchicalsha256.h" />
|
||||||
<ClInclude Include="include\nn\hac\HierarchicalSha256Header.h" />
|
<ClInclude Include="include\nn\hac\HierarchicalSha256Header.h" />
|
||||||
|
<ClInclude Include="include\nn\hac\IdConverter.h" />
|
||||||
<ClInclude Include="include\nn\hac\IKernelCapabilityHandler.h" />
|
<ClInclude Include="include\nn\hac\IKernelCapabilityHandler.h" />
|
||||||
<ClInclude Include="include\nn\hac\InteruptEntry.h" />
|
<ClInclude Include="include\nn\hac\InteruptEntry.h" />
|
||||||
<ClInclude Include="include\nn\hac\InteruptHandler.h" />
|
<ClInclude Include="include\nn\hac\InteruptHandler.h" />
|
||||||
|
@ -90,6 +91,7 @@
|
||||||
<ClCompile Include="source\HandleTableSizeHandler.cpp" />
|
<ClCompile Include="source\HandleTableSizeHandler.cpp" />
|
||||||
<ClCompile Include="source\HierarchicalIntegrityHeader.cpp" />
|
<ClCompile Include="source\HierarchicalIntegrityHeader.cpp" />
|
||||||
<ClCompile Include="source\HierarchicalSha256Header.cpp" />
|
<ClCompile Include="source\HierarchicalSha256Header.cpp" />
|
||||||
|
<ClCompile Include="source\IdConverter.cpp" />
|
||||||
<ClCompile Include="source\InteruptEntry.cpp" />
|
<ClCompile Include="source\InteruptEntry.cpp" />
|
||||||
<ClCompile Include="source\InteruptHandler.cpp" />
|
<ClCompile Include="source\InteruptHandler.cpp" />
|
||||||
<ClCompile Include="source\KernelCapabilityBinary.cpp" />
|
<ClCompile Include="source\KernelCapabilityBinary.cpp" />
|
||||||
|
|
|
@ -183,6 +183,9 @@
|
||||||
<ClInclude Include="include\nn\hac\XciUtils.h">
|
<ClInclude Include="include\nn\hac\XciUtils.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\nn\hac\IdConverter.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="source\AccessControlInfoBinary.cpp">
|
<ClCompile Include="source\AccessControlInfoBinary.cpp">
|
||||||
|
@ -296,5 +299,8 @@
|
||||||
<ClCompile Include="source\XciUtils.cpp">
|
<ClCompile Include="source\XciUtils.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="source\IdConverter.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
16
lib/libhac/source/IdConverter.cpp
Normal file
16
lib/libhac/source/IdConverter.cpp
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
#include <nn/hac/IdConverter.h>
|
||||||
|
|
||||||
|
uint64_t nn::hac::IdConverter::convertToAocBaseId(uint64_t application_id)
|
||||||
|
{
|
||||||
|
return application_id + kAocBaseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint64_t nn::hac::IdConverter::convertToDeltaId(uint64_t application_id)
|
||||||
|
{
|
||||||
|
return application_id + kDeltaId;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint64_t nn::hac::IdConverter::convertToPatchId(uint64_t application_id)
|
||||||
|
{
|
||||||
|
return application_id + kPatchId;
|
||||||
|
}
|
Loading…
Reference in a new issue