From e8bbd56599bea3bf8100b6f1242923aa2af3c8a6 Mon Sep 17 00:00:00 2001 From: MewX Date: Fri, 20 Mar 2015 01:49:16 +0800 Subject: [PATCH] PatchMonitor update --- PatchMonitor/PatchMonitor.cpp | 40 +++++++++++++++++++++++++--------- PatchMonitor/PatchMonitor.rc | Bin 6942 -> 6988 bytes PatchMonitor/stdafx.h | 2 +- README.md | 2 +- 4 files changed, 32 insertions(+), 12 deletions(-) diff --git a/PatchMonitor/PatchMonitor.cpp b/PatchMonitor/PatchMonitor.cpp index 60fdba0..d49cc82 100644 --- a/PatchMonitor/PatchMonitor.cpp +++ b/PatchMonitor/PatchMonitor.cpp @@ -181,7 +181,8 @@ int APIENTRY WinMain(_In_ HINSTANCE hInstance, // need log } - + + // read current showing text memset( temp, 0, sizeof( temp ) ); b = ReadProcessMemory( ph, @@ -273,7 +274,7 @@ int APIENTRY WinMain(_In_ HINSTANCE hInstance, SetActiveWindow(hWnd); // set Font style - HANDLE hFont = CreateFont(20, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, UNICODE, + HANDLE hFont = CreateFontW(20, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, UNICODE, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, L"MS PGothic"); SendMessageW(GetDlgItem(hTextDlg, IDC_STATICTEXT), WM_SETFONT, WPARAM(hFont), TRUE); // GetDlgItem( hDlg, IDC_DLG_LOGIN_EDIT_USERNAME ) @@ -316,10 +317,25 @@ int APIENTRY WinMain(_In_ HINSTANCE hInstance, while (GetAsyncKeyState('1') < 0) Sleep(50); + // get latest index position + unsigned long latestIndex = 0; + memset(temp, 0, sizeof(temp)); + b = ReadProcessMemory( + ph, + (void*)0x6DB530, // latest index address + temp, + 256, + NULL); + if (b) + latestIndex = *(unsigned long *)temp; // get it + else + latestIndex = 512; // found value is 256, but it can be a little larger + // load all history texts - wstring result; + wstring result, resultBeg, resultEnd; const unsigned long posdelta = 0x1290; unsigned long pos = 0x6DC6D0; + unsigned int index = 0; while (1) { memset(temp, 0, sizeof(temp)); b = ReadProcessMemory( @@ -344,14 +360,18 @@ int APIENTRY WinMain(_In_ HINSTANCE hInstance, const char *fetchResult = 0; int r = tf.find(temp, &fetchResult); - result += r == FDR_W_NXL ? NotFound + StringToWstring(936, temp) : StringToWstring(932, fetchResult) + L"\r\n\r\n"; + if (index++ < latestIndex) + resultBeg += r == FDR_W_NXL ? NotFound + StringToWstring(936, temp) : StringToWstring(932, fetchResult) + L"\r\n\r\n"; + else + resultEnd += r == FDR_W_NXL ? NotFound + StringToWstring(936, temp) : StringToWstring(932, fetchResult) + L"\r\n\r\n"; #ifdef LOG_ON - log << "History Request:" << lpBuffer << endl; + log << "History Request:" << temp << endl; #endif } else break; } + result = resultEnd + resultBeg; // set text SetWindowTextW(GetDlgItem(hHistoryDlg, IDC_EDITHISTORY), result.c_str()); @@ -425,7 +445,9 @@ int APIENTRY WinMain(_In_ HINSTANCE hInstance, } // GC +#ifdef LOG_ON log.close(); +#endif delete[] buff; } else { // Work as uninstaller @@ -438,15 +460,13 @@ int APIENTRY WinMain(_In_ HINSTANCE hInstance, WinExec( "cmd /c del Chip_S.chs", SW_HIDE ); WinExec( "cmd /c del Chip_T.chs", SW_HIDE ); WinExec( "cmd /c del RegFile.chs", SW_HIDE ); - WinExec( "cmd /c del CROSSCHANNEL_alpha20150308.exe", SW_HIDE ); + WinExec( "cmd /c del CROSSCHANNEL_v0.99.exe", SW_HIDE ); #endif - MessageBoxW( NULL, L"卸载完毕,很干净的哦!~ 我们会想你的~~\r\n再来光顾一下http://crosschannel.cn吧~~", L"卸载完毕", MB_OK ); + MessageBoxW( NULL, L"卸载完毕,很干净的哦!~ 我们会想你的~~\r\n再来光顾一下http://crosschannel.cn吧~~\r\n哦对了,如果这个卸载程序没有自删除还请手动删除一下~", L"卸载完毕", MB_OK ); ShellExecuteA(NULL, "open", "http://www.crosschannel.cn", NULL, NULL, SW_SHOWNORMAL); // Delete self - - // del char buf[MAX_PATH]; HMODULE module; @@ -614,7 +634,7 @@ LRESULT CALLBACK HistoryProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPar case WM_LBUTTONDOWN: SendMessage(hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0); break; - /* + /*// This will cause refresh shadows, I didn't process with this problem case WM_CTLCOLORSTATIC: // Set Text Color, and its background hdc = (HDC)wParam; diff --git a/PatchMonitor/PatchMonitor.rc b/PatchMonitor/PatchMonitor.rc index e5dcb2a4beef28f8a7761796e226aa1265d2de1d..c7e361d3be7e7ff34ba86e18e447d59aef4929d0 100644 GIT binary patch delta 16 YcmbPdcE)VOI^M}sxE(eh;Em%206s$op8x;= delta 16 YcmX?OHqUIsI^M~LxP>;qV!Z diff --git a/PatchMonitor/stdafx.h b/PatchMonitor/stdafx.h index c07b06f..8336d0b 100644 --- a/PatchMonitor/stdafx.h +++ b/PatchMonitor/stdafx.h @@ -7,7 +7,7 @@ #include "targetver.h" #define RELEASE_DELETE -#define LOG_ON // turn on log +//#define LOG_ON // turn on log #define WIN32_LEAN_AND_MEAN // Windows ͷļųʹõϢ // Windows ͷļ: diff --git a/README.md b/README.md index 9bad1ad..3b48d91 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ 其他的一些小工具,零散的代码。 -- /EngineWorkOut +- EngineWorkOut/ 本来准备把整个引擎脚本给逆掉的,结果还是没有完成,里面是测试的一些动画效果截图。