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
|
|
@ -24,6 +24,7 @@
|
|||
#include "Utility/Math/AffineMatrix.h"
|
||||
#include "Utility/Cipher/XorBytes.h"
|
||||
#include "Utility/Text/FormatString.h"
|
||||
#include "Utility/Cipher/LocalEncryptedName.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
|
|
@ -31,40 +32,8 @@
|
|||
#include <timeapi.h>
|
||||
#include <windows.h>
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
// INLINED
|
||||
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;
|
||||
};
|
||||
|
||||
// INLINED
|
||||
__forceinline const char* TimeFontActionName() {
|
||||
const char source[] = {'\xB1', '\x4F', '\xAD', '\xDA', '\xD7', '\xA1', '\x01', '\x29', '\x18', '\xEE', '\x0E', '\x4D', '\x7E', '\x61', '\x29', '\x53', '\x10', '\xE0', '\x1F', '\x0B'};
|
||||
|
|
@ -86,7 +55,6 @@ __forceinline const char* TimeFontSpriteName() {
|
|||
// GLOBAL: gl_25107
|
||||
CFile g_whisperFile;
|
||||
|
||||
|
||||
// OFFSET: 0x00CCFCE0
|
||||
// FUNCTION: fn_21246
|
||||
void MiniMapNoOp() {
|
||||
|
|
@ -581,7 +549,6 @@ int g_minimapCoordinateDigits;
|
|||
// GLOBAL: gl_25046
|
||||
int g_minimapCoordinateDigitValues[4];
|
||||
|
||||
|
||||
// OFFSET: 0x00CD2A10
|
||||
// FUNCTION: fn_21261
|
||||
void CGameMode::DrawMiniMapNumber() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue