mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-21 10:25:08 -04:00
strat: sha256 s/linux/libnx/g
This commit is contained in:
parent
f44a730a90
commit
a0f3183c79
9 changed files with 3 additions and 642 deletions
|
@ -18,7 +18,6 @@
|
|||
#include <algorithm>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include "sha256.h"
|
||||
#include "lz4.h"
|
||||
#include "ldr_nso.hpp"
|
||||
#include "ldr_map.hpp"
|
||||
|
@ -275,11 +274,7 @@ Result NsoUtils::LoadNsoSegment(u64 title_id, unsigned int index, unsigned int s
|
|||
|
||||
if (check_hash) {
|
||||
u8 hash[0x20] = {0};
|
||||
struct sha256_state sha_ctx;
|
||||
sha256_init(&sha_ctx);
|
||||
sha256_update(&sha_ctx, dst_addr, out_size);
|
||||
sha256_finalize(&sha_ctx);
|
||||
sha256_finish(&sha_ctx, hash);
|
||||
sha256CalculateHash(hash, dst_addr, out_size);
|
||||
|
||||
if (std::memcmp(g_nso_headers[index].section_hashes[segment], hash, sizeof(hash))) {
|
||||
return ResultLoaderInvalidNso;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue