Update private master program code

This commit is contained in:
yuanyuanxiang
2025-06-08 15:38:41 +08:00
parent 15e03bd18a
commit 46f7dc1790
40 changed files with 5380 additions and 435 deletions

View File

@@ -7,6 +7,8 @@ class Buffer {
private:
PBYTE buf;
ULONG len;
ULONG padding;
std::string md5;
ULONG *ref;
void AddRef() {
(*ref)++;
@@ -30,10 +32,11 @@ public:
ref = NULL;
}
}
Buffer():buf(NULL), len(0), ref(new ULONG(1)) {
Buffer():buf(NULL), len(0), ref(new ULONG(1)), padding(0) {
}
Buffer(const BYTE * b, int n):len(n), ref(new ULONG(1)){
Buffer(const BYTE * b, int n, int padding=0, const std::string& md5="") :
len(n), ref(new ULONG(1)), padding(padding), md5(md5){
buf = new BYTE[n];
memcpy(buf, b, n);
}
@@ -53,8 +56,11 @@ public:
char* c_str() const {
return (char*)buf;
}
ULONG length()const {
return len;
ULONG length(bool noPadding=false)const {
return noPadding ? len - padding : len;
}
std::string MD5() const {
return md5;
}
};
@@ -66,10 +72,11 @@ public:
ULONG ReadBuffer(PBYTE Buffer, ULONG ulLength);
ULONG GetBufferLength(); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD>
ULONG GetBufferLen() { return GetBufferLength(); }
VOID ClearBuffer();
BOOL WriteBuffer(PBYTE Buffer, ULONG ulLength);
BOOL Write(PBYTE Buffer, ULONG ulLength) { return WriteBuffer(Buffer, ulLength); }
LPBYTE GetBuffer(ULONG ulPos);
LPBYTE GetBuffer(ULONG ulPos=0);
Buffer GetMyBuffer(ULONG ulPos);
BYTE GetBYTE(ULONG ulPos);
BOOL CopyBuffer(PVOID pDst, ULONG nLen, ULONG ulPos);