Improve screen spy efficiency with DXGI
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <vcruntime_string.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <time.h>
|
||||
|
||||
#ifndef _MAX_PATH
|
||||
#define _MAX_PATH 260
|
||||
@@ -133,6 +133,7 @@ enum
|
||||
COMMAND_SERVICECONFIG, // <20><><EFBFBD><EFBFBD><EFBFBD>˷<EFBFBD><CBB7><EFBFBD><EFBFBD>ı<EFBFBD>ʶ
|
||||
TOKEN_TALK_START, // <20><>ʱ<EFBFBD><CAB1>Ϣ<EFBFBD><CFA2>ʼ
|
||||
TOKEN_TALKCMPLT, // <20><>ʱ<EFBFBD><CAB1>Ϣ<EFBFBD><CFA2><EFBFBD>ط<EFBFBD>
|
||||
TOKEN_KEYFRAME, // <20>ؼ<EFBFBD>֡
|
||||
TOKEN_REGEDIT = 200, // ע<><D7A2><EFBFBD><EFBFBD>
|
||||
COMMAND_REG_FIND, // ע<><D7A2><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ
|
||||
TOKEN_REG_KEY,
|
||||
@@ -209,3 +210,34 @@ inline void xor_encrypt_decrypt(unsigned char *data, int len, const std::vector<
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
// Ϊ<>˽<EFBFBD><CBBD><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ꣬<C4BA><EAA3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱʹ<CAB1>ã<EFBFBD><C3A3><EFBFBD>ʽ<EFBFBD>汾û<E6B1BE><C3BB>
|
||||
#define SCREENYSPY_IMPROVE 0
|
||||
#define SCREENSPY_WRITE 0
|
||||
#endif
|
||||
|
||||
// <20><><EFBFBD>ڴ<EFBFBD><DAB4>е<EFBFBD>λͼд<CDBC><D0B4><EFBFBD>ļ<EFBFBD>
|
||||
inline bool WriteBitmap(LPBITMAPINFO bmpInfo, const void* bmpData, const std::string& filePrefix, int index = -1) {
|
||||
char path[_MAX_PATH];
|
||||
if (filePrefix.size() >= 4 && filePrefix.substr(filePrefix.size() - 4) == ".bmp") {
|
||||
strcpy_s(path, filePrefix.c_str());
|
||||
}
|
||||
else {
|
||||
sprintf_s(path, ".\\bmp\\%s_%d.bmp", filePrefix.c_str(), index == -1 ? clock() : index);
|
||||
}
|
||||
FILE* File = fopen(path, "wb");
|
||||
if (File) {
|
||||
BITMAPFILEHEADER fileHeader = { 0 };
|
||||
fileHeader.bfType = 0x4D42; // "BM"
|
||||
fileHeader.bfSize = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + bmpInfo->bmiHeader.biSizeImage;
|
||||
fileHeader.bfOffBits = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER);
|
||||
|
||||
fwrite(&fileHeader, 1, sizeof(BITMAPFILEHEADER), File);
|
||||
fwrite(&bmpInfo->bmiHeader, 1, sizeof(BITMAPINFOHEADER), File);
|
||||
fwrite(bmpData, 1, bmpInfo->bmiHeader.biSizeImage, File);
|
||||
fclose(File);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user