diff options
Diffstat (limited to 'protocols/WhatsApp/src/utils.h')
-rw-r--r-- | protocols/WhatsApp/src/utils.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/protocols/WhatsApp/src/utils.h b/protocols/WhatsApp/src/utils.h index 778732e312..4b1d61a69e 100644 --- a/protocols/WhatsApp/src/utils.h +++ b/protocols/WhatsApp/src/utils.h @@ -153,6 +153,7 @@ public: }; ///////////////////////////////////////////////////////////////////////////////////////// +// WAJid struct WAJid { @@ -171,11 +172,38 @@ struct WAJid }; ///////////////////////////////////////////////////////////////////////////////////////// +// LT_HASH + +struct LT_HASH +{ + LT_HASH() + { + init(); + }; + + uint16_t hash[64]; + + void add(const void *pData, size_t len); + void sub(const void *pData, size_t len); + + void init() + { + SecureZeroMemory(hash, sizeof(hash)); + } +}; + +///////////////////////////////////////////////////////////////////////////////////////// +// functions void bin2file(const MBinBuffer &buf, const wchar_t *pwszFileName); + void string2file(const std::string &str, const wchar_t *pwszFileName); +CMStringA file2string(const wchar_t *pwszFileName); + CMStringA directPath2url(const char *pszDirectPath); +std::string decodeBinStr(const std::string &buf); + MBinBuffer aesDecrypt( const EVP_CIPHER *cipher, const uint8_t *key, @@ -186,6 +214,8 @@ MBinBuffer aesDecrypt( uint32_t decodeBigEndian(const std::string &buf); std::string encodeBigEndian(uint32_t num, size_t len = sizeof(uint32_t)); +void rtrim(std::string &str); + void generateIV(uint8_t *iv, int &pVar); __forceinline bool operator<<(MessageLite &msg, const MBinBuffer &buf) |