Feature: Support adding client to watch list
This commit is contained in:
Binary file not shown.
@@ -304,6 +304,7 @@ CMy2015RemoteDlg::CMy2015RemoteDlg(CWnd* pParent): CDialogEx(CMy2015RemoteDlg::I
|
|||||||
m_bmOnline[10].LoadBitmap(IDB_BITMAP_AUTHORIZE);
|
m_bmOnline[10].LoadBitmap(IDB_BITMAP_AUTHORIZE);
|
||||||
m_bmOnline[11].LoadBitmap(IDB_BITMAP_UNAUTH);
|
m_bmOnline[11].LoadBitmap(IDB_BITMAP_UNAUTH);
|
||||||
m_bmOnline[12].LoadBitmap(IDB_BITMAP_ASSIGNTO);
|
m_bmOnline[12].LoadBitmap(IDB_BITMAP_ASSIGNTO);
|
||||||
|
m_bmOnline[13].LoadBitmap(IDB_BITMAP_ADDWATCH);
|
||||||
|
|
||||||
for (int i = 0; i < PAYLOAD_MAXTYPE; i++) {
|
for (int i = 0; i < PAYLOAD_MAXTYPE; i++) {
|
||||||
m_ServerDLL[i] = nullptr;
|
m_ServerDLL[i] = nullptr;
|
||||||
@@ -420,6 +421,9 @@ BEGIN_MESSAGE_MAP(CMy2015RemoteDlg, CDialogEx)
|
|||||||
ON_COMMAND(ID_TOOL_INPUT_PASSWORD, &CMy2015RemoteDlg::OnToolInputPassword)
|
ON_COMMAND(ID_TOOL_INPUT_PASSWORD, &CMy2015RemoteDlg::OnToolInputPassword)
|
||||||
ON_COMMAND(ID_TOOL_GEN_SHELLCODE, &CMy2015RemoteDlg::OnToolGenShellcode)
|
ON_COMMAND(ID_TOOL_GEN_SHELLCODE, &CMy2015RemoteDlg::OnToolGenShellcode)
|
||||||
ON_COMMAND(ID_ONLINE_ASSIGN_TO, &CMy2015RemoteDlg::OnOnlineAssignTo)
|
ON_COMMAND(ID_ONLINE_ASSIGN_TO, &CMy2015RemoteDlg::OnOnlineAssignTo)
|
||||||
|
ON_NOTIFY(NM_CUSTOMDRAW, IDC_MESSAGE, &CMy2015RemoteDlg::OnNMCustomdrawMessage)
|
||||||
|
ON_COMMAND(ID_ONLINE_ADD_WATCH, &CMy2015RemoteDlg::OnOnlineAddWatch)
|
||||||
|
ON_NOTIFY(NM_CUSTOMDRAW, IDC_ONLINE, &CMy2015RemoteDlg::OnNMCustomdrawOnline)
|
||||||
END_MESSAGE_MAP()
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
|
||||||
@@ -1281,6 +1285,7 @@ void CMy2015RemoteDlg::OnNMRClickOnline(NMHDR *pNMHDR, LRESULT *pResult)
|
|||||||
Menu.SetMenuItemBitmaps(ID_ONLINE_AUTHORIZE, MF_BYCOMMAND, &m_bmOnline[10], &m_bmOnline[10]);
|
Menu.SetMenuItemBitmaps(ID_ONLINE_AUTHORIZE, MF_BYCOMMAND, &m_bmOnline[10], &m_bmOnline[10]);
|
||||||
Menu.SetMenuItemBitmaps(ID_ONLINE_UNAUTHORIZE, MF_BYCOMMAND, &m_bmOnline[11], &m_bmOnline[11]);
|
Menu.SetMenuItemBitmaps(ID_ONLINE_UNAUTHORIZE, MF_BYCOMMAND, &m_bmOnline[11], &m_bmOnline[11]);
|
||||||
Menu.SetMenuItemBitmaps(ID_ONLINE_ASSIGN_TO, MF_BYCOMMAND, &m_bmOnline[12], &m_bmOnline[12]);
|
Menu.SetMenuItemBitmaps(ID_ONLINE_ASSIGN_TO, MF_BYCOMMAND, &m_bmOnline[12], &m_bmOnline[12]);
|
||||||
|
Menu.SetMenuItemBitmaps(ID_ONLINE_ADD_WATCH, MF_BYCOMMAND, &m_bmOnline[13], &m_bmOnline[13]);
|
||||||
|
|
||||||
// 创建一个新的子菜单
|
// 创建一个新的子菜单
|
||||||
CMenu newMenu;
|
CMenu newMenu;
|
||||||
@@ -3024,3 +3029,68 @@ void CMy2015RemoteDlg::OnOnlineAssignTo()
|
|||||||
memcpy(bToken + 2 + dlg.m_str.GetLength() + 1, dlg.m_sSecondInput, dlg.m_sSecondInput.GetLength());
|
memcpy(bToken + 2 + dlg.m_str.GetLength() + 1, dlg.m_sSecondInput, dlg.m_sSecondInput.GetLength());
|
||||||
SendSelectedCommand(bToken, sizeof(bToken));
|
SendSelectedCommand(bToken, sizeof(bToken));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CMy2015RemoteDlg::OnNMCustomdrawMessage(NMHDR* pNMHDR, LRESULT* pResult)
|
||||||
|
{
|
||||||
|
LPNMLVCUSTOMDRAW pLVCD = reinterpret_cast<LPNMLVCUSTOMDRAW>(pNMHDR);
|
||||||
|
*pResult = 0;
|
||||||
|
|
||||||
|
switch (pLVCD->nmcd.dwDrawStage)
|
||||||
|
{
|
||||||
|
case CDDS_PREPAINT:
|
||||||
|
*pResult = CDRF_NOTIFYITEMDRAW;
|
||||||
|
return;
|
||||||
|
|
||||||
|
case CDDS_ITEMPREPAINT:{
|
||||||
|
int nRow = static_cast<int>(pLVCD->nmcd.dwItemSpec);
|
||||||
|
int nLastRow = m_CList_Message.GetItemCount() - 1;
|
||||||
|
if (nRow == nLastRow && nLastRow >= 0){
|
||||||
|
pLVCD->clrText = RGB(255, 0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CMy2015RemoteDlg::OnOnlineAddWatch()
|
||||||
|
{
|
||||||
|
EnterCriticalSection(&m_cs);
|
||||||
|
POSITION Pos = m_CList_Online.GetFirstSelectedItemPosition();
|
||||||
|
while (Pos)
|
||||||
|
{
|
||||||
|
int iItem = m_CList_Online.GetNextSelectedItem(Pos);
|
||||||
|
context* ctx = (context*)m_CList_Online.GetItemData(iItem);
|
||||||
|
auto f = m_ClientMap.find(ctx->GetClientID());
|
||||||
|
int r = f != m_ClientMap.end() ? f->second.GetLevel() : 0;
|
||||||
|
m_ClientMap[ctx->GetClientID()].UpdateLevel(++r >= 4 ? 0 : r);
|
||||||
|
}
|
||||||
|
SaveToFile(m_ClientMap, GetDbPath());
|
||||||
|
LeaveCriticalSection(&m_cs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CMy2015RemoteDlg::OnNMCustomdrawOnline(NMHDR* pNMHDR, LRESULT* pResult)
|
||||||
|
{
|
||||||
|
LPNMLVCUSTOMDRAW pLVCD = reinterpret_cast<LPNMLVCUSTOMDRAW>(pNMHDR);
|
||||||
|
*pResult = 0;
|
||||||
|
|
||||||
|
switch (pLVCD->nmcd.dwDrawStage)
|
||||||
|
{
|
||||||
|
case CDDS_PREPAINT:
|
||||||
|
*pResult = CDRF_NOTIFYITEMDRAW;
|
||||||
|
return;
|
||||||
|
|
||||||
|
case CDDS_ITEMPREPAINT:{
|
||||||
|
int nRow = static_cast<int>(pLVCD->nmcd.dwItemSpec);
|
||||||
|
EnterCriticalSection(&m_cs);
|
||||||
|
context* ctx = (context*)m_CList_Online.GetItemData(nRow);
|
||||||
|
auto f = m_ClientMap.find(ctx->GetClientID());
|
||||||
|
int r = f != m_ClientMap.end() ? f->second.GetLevel() : 0;
|
||||||
|
LeaveCriticalSection(&m_cs);
|
||||||
|
if (r >= 1) pLVCD->clrText = RGB(0, 0, 255); // 字体蓝
|
||||||
|
if (r >= 2) pLVCD->clrText = RGB(255, 0, 0); // 字体红
|
||||||
|
if (r >= 3) pLVCD->clrTextBk = RGB(255, 160, 160); // 背景红
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -30,13 +30,15 @@ typedef struct DllInfo {
|
|||||||
enum {
|
enum {
|
||||||
MAP_NOTE,
|
MAP_NOTE,
|
||||||
MAP_LOCATION,
|
MAP_LOCATION,
|
||||||
|
MAP_LEVEL,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _ClientValue
|
struct _ClientValue
|
||||||
{
|
{
|
||||||
char Note[64];
|
char Note[64];
|
||||||
char Location[64];
|
char Location[64];
|
||||||
char Reserved[128]; // Ԥ<><D4A4>
|
char Level;
|
||||||
|
char Reserved[127]; // Ԥ<><D4A4>
|
||||||
_ClientValue() {
|
_ClientValue() {
|
||||||
memset(this, 0, sizeof(_ClientValue));
|
memset(this, 0, sizeof(_ClientValue));
|
||||||
}
|
}
|
||||||
@@ -51,12 +53,18 @@ struct _ClientValue
|
|||||||
void UpdateLocation(const CString& loc) {
|
void UpdateLocation(const CString& loc) {
|
||||||
strcpy_s(Location, loc.GetString());
|
strcpy_s(Location, loc.GetString());
|
||||||
}
|
}
|
||||||
|
void UpdateLevel(int level) {
|
||||||
|
Level = level;
|
||||||
|
}
|
||||||
const char* GetNote() const {
|
const char* GetNote() const {
|
||||||
return Note;
|
return Note;
|
||||||
}
|
}
|
||||||
const char* GetLocation() const {
|
const char* GetLocation() const {
|
||||||
return Location;
|
return Location;
|
||||||
}
|
}
|
||||||
|
int GetLevel() const {
|
||||||
|
return Level;
|
||||||
|
}
|
||||||
int GetLength() const {
|
int GetLength() const {
|
||||||
return sizeof(_ClientValue);
|
return sizeof(_ClientValue);
|
||||||
}
|
}
|
||||||
@@ -105,7 +113,7 @@ protected:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EnterCriticalSection(&m_cs);
|
LeaveCriticalSection(&m_cs);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
void SetClientMapData(ClientKey key, int typ, const char* value) {
|
void SetClientMapData(ClientKey key, int typ, const char* value) {
|
||||||
@@ -121,7 +129,7 @@ protected:
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
EnterCriticalSection(&m_cs);
|
LeaveCriticalSection(&m_cs);
|
||||||
}
|
}
|
||||||
// <20><><EFBFBD><EFBFBD>
|
// <20><><EFBFBD><EFBFBD>
|
||||||
public:
|
public:
|
||||||
@@ -196,7 +204,7 @@ public:
|
|||||||
CRITICAL_SECTION m_cs;
|
CRITICAL_SECTION m_cs;
|
||||||
BOOL isClosed;
|
BOOL isClosed;
|
||||||
CMenu m_MainMenu;
|
CMenu m_MainMenu;
|
||||||
CBitmap m_bmOnline[13];
|
CBitmap m_bmOnline[14];
|
||||||
uint64_t m_superID;
|
uint64_t m_superID;
|
||||||
bool CheckValid(int trail = 14);
|
bool CheckValid(int trail = 14);
|
||||||
afx_msg void OnTimer(UINT_PTR nIDEvent);
|
afx_msg void OnTimer(UINT_PTR nIDEvent);
|
||||||
@@ -269,4 +277,7 @@ public:
|
|||||||
afx_msg LRESULT OnShowMessage(WPARAM wParam, LPARAM lParam);
|
afx_msg LRESULT OnShowMessage(WPARAM wParam, LPARAM lParam);
|
||||||
afx_msg void OnToolGenShellcode();
|
afx_msg void OnToolGenShellcode();
|
||||||
afx_msg void OnOnlineAssignTo();
|
afx_msg void OnOnlineAssignTo();
|
||||||
|
afx_msg void OnNMCustomdrawMessage(NMHDR* pNMHDR, LRESULT* pResult);
|
||||||
|
afx_msg void OnOnlineAddWatch();
|
||||||
|
afx_msg void OnNMCustomdrawOnline(NMHDR* pNMHDR, LRESULT* pResult);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -389,6 +389,7 @@
|
|||||||
<Text Include="..\..\ReadMe.md" />
|
<Text Include="..\..\ReadMe.md" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Image Include="res\Bitmap\AddWatch.bmp" />
|
||||||
<Image Include="res\Bitmap\AssignTo.bmp" />
|
<Image Include="res\Bitmap\AssignTo.bmp" />
|
||||||
<Image Include="res\Bitmap\authorize.bmp" />
|
<Image Include="res\Bitmap\authorize.bmp" />
|
||||||
<Image Include="res\Bitmap\DxgiDesktop.bmp" />
|
<Image Include="res\Bitmap\DxgiDesktop.bmp" />
|
||||||
|
|||||||
@@ -154,6 +154,7 @@
|
|||||||
<Image Include="res\file\Icon_G.ico" />
|
<Image Include="res\file\Icon_G.ico" />
|
||||||
<Image Include="res\DrawingBoard.ico" />
|
<Image Include="res\DrawingBoard.ico" />
|
||||||
<Image Include="res\Bitmap\AssignTo.bmp" />
|
<Image Include="res\Bitmap\AssignTo.bmp" />
|
||||||
|
<Image Include="res\Bitmap\AddWatch.bmp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="..\..\Release\ghost.exe" />
|
<None Include="..\..\Release\ghost.exe" />
|
||||||
|
|||||||
BIN
server/2015Remote/res/Bitmap/AddWatch.bmp
Normal file
BIN
server/2015Remote/res/Bitmap/AddWatch.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 822 B |
Binary file not shown.
Reference in New Issue
Block a user