Maintenance: Centralize EncryptedName: delete 44 per-unit copies (incl. GameModeEncryptedName) and 4 EncryptedSource copies; units in
Batch #16852 by ragnarok-clanker: no function's compiled code changes; checked with 44 compiled unit(s), including every includer of Source/Utility/Cipher/LocalEncryptedName.h.
This commit is contained in:
parent
7a8d4523f1
commit
d074dedcd7
45 changed files with 125 additions and 1528 deletions
|
|
@ -5,6 +5,7 @@
|
|||
#include "Render/Renderer.h"
|
||||
#include "Resource/Bitmap/BitmapResource.h"
|
||||
#include "Utility/Cipher/XorBytes.h"
|
||||
#include "Utility/Cipher/LocalEncryptedName.h"
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
|
|
@ -12,40 +13,6 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace {
|
||||
|
||||
template <std::size_t Length, std::uint64_t Key>
|
||||
class EncryptedName {
|
||||
public:
|
||||
// INLINED
|
||||
explicit EncryptedName(const char (&source)[Length]) : m_encrypted(true) {
|
||||
for (std::uint64_t index = 0; index < Length; ++index) {
|
||||
this->m_text[index] = source[index];
|
||||
}
|
||||
}
|
||||
|
||||
~EncryptedName() {
|
||||
for (std::uint64_t index = 0; index < Length; ++index) {
|
||||
this->m_text[index] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
const char* Text() {
|
||||
if (this->m_encrypted) {
|
||||
utility::XorBytes(this->m_text, Length, Key);
|
||||
this->m_encrypted = false;
|
||||
}
|
||||
|
||||
return reinterpret_cast<const char*>(this->m_text);
|
||||
}
|
||||
|
||||
private:
|
||||
std::uint8_t m_text[Length];
|
||||
bool m_encrypted;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
// OFFSET: 0x00DE8740
|
||||
// FUNCTION: fn_23498
|
||||
bool CSession::LoadMapNameTable() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue