mirror of
https://github.com/zeldaret/botw
synced 2026-06-10 04:53:37 -04:00
18c60323a9
git subrepo clone https://github.com/open-ead/sead lib/sead subrepo: subdir: "lib/sead" merged: "1b66e825d" upstream: origin: "https://github.com/open-ead/sead" branch: "master" commit: "1b66e825d" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" git subrepo clone (merge) https://github.com/open-ead/nnheaders lib/NintendoSDK subrepo: subdir: "lib/NintendoSDK" merged: "9ee21399f" upstream: origin: "https://github.com/open-ead/nnheaders" branch: "master" commit: "9ee21399f" git-subrepo: version: "0.4.3" origin: "ssh://git@github.com/ingydotnet/git-subrepo" commit: "2f68596" git subrepo clone https://github.com/open-ead/agl lib/agl subrepo: subdir: "lib/agl" merged: "7c063271b" upstream: origin: "https://github.com/open-ead/agl" branch: "master" commit: "7c063271b" git-subrepo: version: "0.4.3" origin: "ssh://git@github.com/ingydotnet/git-subrepo" commit: "2f68596" git subrepo clone https://github.com/open-ead/EventFlow lib/EventFlow subrepo: subdir: "lib/EventFlow" merged: "c35d21b34" upstream: origin: "https://github.com/open-ead/EventFlow" branch: "master" commit: "c35d21b34" git-subrepo: version: "0.4.3" origin: "ssh://git@github.com/ingydotnet/git-subrepo" commit: "2f68596"
61 lines
1.3 KiB
C++
61 lines
1.3 KiB
C++
/**
|
|
* @file encryption.h
|
|
* @brief NEX Encryption Algorithm.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <nn/nex/RootObject.h>
|
|
|
|
namespace nn {
|
|
namespace nex {
|
|
class Buffer;
|
|
class Key;
|
|
|
|
class EncryptionAlgorithm : public nn::nex::RootObject {
|
|
public:
|
|
EncryptionAlgorithm(u32, u32);
|
|
|
|
virtual ~EncryptionAlgorithm();
|
|
|
|
virtual bool Encrypt(nn::nex::Buffer const&, nn::nex::Buffer*) = 0;
|
|
virtual bool Encrypt(nn::nex::Buffer*);
|
|
virtual bool Decrypt(nn::nex::Buffer const&, nn::nex::Buffer*) = 0;
|
|
virtual bool Decrypt(nn::nex::Buffer*);
|
|
virtual bool GetErrorString(u32, char* destStr, u64 errLen);
|
|
virtual void KeyHasChanged();
|
|
|
|
bool SetKey(nn::nex::Key const& key);
|
|
|
|
u64 _8;
|
|
u64 _10;
|
|
u64 _18;
|
|
u64 _20;
|
|
u64 _28;
|
|
u64 _30;
|
|
u64 _38;
|
|
u64 _40;
|
|
};
|
|
|
|
class RC4Encryption : public nn::nex::EncryptionAlgorithm {
|
|
public:
|
|
RC4Encryption();
|
|
|
|
virtual ~RC4Encryption();
|
|
|
|
virtual bool Encrypt(nn::nex::Buffer const&, nn::nex::Buffer*);
|
|
virtual bool Encrypt(nn::nex::Buffer*);
|
|
virtual bool Decrypt(nn::nex::Buffer const&, nn::nex::Buffer*);
|
|
virtual bool Decrypt(nn::nex::Buffer*);
|
|
|
|
virtual void KeyHasChanged();
|
|
|
|
void GetDefaultKey();
|
|
void PrepareEncryption();
|
|
void ReinitStateArray();
|
|
void SetReinitEverytime(bool);
|
|
|
|
u8 _48[0x298 - 0x48];
|
|
};
|
|
}; // namespace nex
|
|
}; // namespace nn
|