1 Star 0 Fork 0

linuxmail/unrar-nonfree

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
secpassword.hpp 1.04 KB
一键复制 编辑 原始数据 按行查看 历史
Norbert Preining 提交于 2018-10-24 17:44 +08:00 . Import Upstream version 5.2.7
#ifndef _RAR_SECURE_PASSWORD_
#define _RAR_SECURE_PASSWORD_
// Store a password securely (if data encryption is provided by OS)
// or obfuscated to make search for password in memory dump less trivial.
class SecPassword
{
private:
void Process(const wchar *Src,size_t SrcSize,wchar *Dst,size_t DstSize,bool Encode);
wchar Password[MAXPASSWORD];
// It is important to have this 'bool' value, so if our object is cleaned
// with memset as a part of larger structure, it is handled correctly.
bool PasswordSet;
public:
SecPassword();
~SecPassword();
void Clean();
void Get(wchar *Psw,size_t MaxSize);
void Set(const wchar *Psw);
bool IsSet() {return PasswordSet;}
size_t Length();
bool operator == (SecPassword &psw);
// Set to true if we need to pass a password to another process.
// We use it when transferring parameters to UAC elevated WinRAR.
bool CrossProcess;
};
void cleandata(void *data,size_t size);
void SecHideData(void *Data,size_t DataSize,bool Encode,bool CrossProcess);
#endif
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/linuxmail/unrar-nonfree.git
git@gitee.com:linuxmail/unrar-nonfree.git
linuxmail
unrar-nonfree
unrar-nonfree
master

搜索帮助