3.9..11.25

This commit is contained in:
TonyPC 2024-08-05 07:23:50 +08:00
parent cea2d3cf71
commit 0b3c085901
28 changed files with 1587 additions and 179 deletions

11
inc/base/memory.h Normal file
View File

@ -0,0 +1,11 @@
#ifndef BASE_MEMORY_H_
#define BASE_MEMORY_H_
#include <windows.h>
#include <vector>
namespace base {
namespace memory {
std::vector<INT64> ScanAndMatchValue(INT64 value, INT64 start,int align);
int Sunday(const byte* total, int tlen, const byte* part, int plen);
}
} // namespace base
#endif

View File

@ -20,7 +20,6 @@ class ChatController : public http::HttpController<ChatController> {
ADD_PATH("/api/forwardMsg", ForwardMsg); ADD_PATH("/api/forwardMsg", ForwardMsg);
ADD_PATH("/api/forwardPublicMsgByMsgId", ForwardPublicMsgByMsgId); ADD_PATH("/api/forwardPublicMsgByMsgId", ForwardPublicMsgByMsgId);
ADD_PATH("/api/forwardPublicMsg", ForwardPublicMsg); ADD_PATH("/api/forwardPublicMsg", ForwardPublicMsg);
PATHS_END PATHS_END
public: public:

View File

@ -1,9 +1,9 @@
#ifndef WXHELPER_HTTP_ROUTER_H_ #ifndef WXHELPER_HTTP_ROUTER_H_
#define WXHELPER_HTTP_ROUTER_H_ #define WXHELPER_HTTP_ROUTER_H_
#include <functional> #include <functional>
#include <map>
#include <string>
#include <unordered_map> #include <unordered_map>
#include <string>
#include "singleton.h" #include "singleton.h"
namespace http { namespace http {

View File

@ -5,6 +5,8 @@ namespace wechat {
#define V_3_9_8_25 39825 #define V_3_9_8_25 39825
#define V_3_9_9_43 39943 #define V_3_9_9_43 39943
#define V_3_9_10_19 391019 #define V_3_9_10_19 391019
#define V_3_9_11_19 391119
#define V_3_9_11_25 391125
#ifndef WECHAT_VERSION #ifndef WECHAT_VERSION
#error " WECHAT_VERSION not defined ." #error " WECHAT_VERSION not defined ."
#endif #endif
@ -349,6 +351,244 @@ const uint64_t kFreeWebViewPageConfig = 0x951520;
const uint64_t kGetWebViewMgr = 0x9412d0; const uint64_t kGetWebViewMgr = 0x9412d0;
const uint64_t kShowWebView = 0x1d236b0; const uint64_t kShowWebView = 0x1d236b0;
const uint64_t kSetUrl = 0x13dd410; const uint64_t kSetUrl = 0x13dd410;
#elif WECHAT_VERSION == V_3_9_11_19
const uint64_t kGetAccountServiceMgr = 0x1b50d00;
const uint64_t kSyncMsg = 0xc39680;
const uint64_t kSyncMsgNext = 0xc39680;
const uint64_t kGetCurrentDataPath = 0x2248ce0;
const uint64_t kGetAppDataSavePath = 0x25dc0e0;
const uint64_t kGetSendMessageMgr = 0x1b4f500;
const uint64_t kSendTextMsg = 0x22c2010;
const uint64_t kFreeChatMsg = 0x1b50d80;
const uint64_t kDoAddMsg = 0x230a3e0;
const uint64_t kSendImageMsg = 0x22b77a0;
const uint64_t kChatMsgInstanceCounter = 0x1b59670;
const uint64_t kSendFileMsg = 0x20cb6f0;
const uint64_t kGetAppMsgMgr = 0x1b544a0;
const uint64_t kGetContactMgr = 0x1b3ccd0;
const uint64_t kGetContactList = 0x219a1c0;
const uint64_t k_sqlite3_exec = 0x3a59b30;
const uint64_t k_sqlite3_prepare = 0x3a617b0;
const uint64_t k_sqlite3_open = 0x3a98fa0;
const uint64_t k_sqlite3_step = 0x3a1db30;
const uint64_t k_sqlite3_column_count = 0x3a1e350;
const uint64_t k_sqlite3_column_name = 0x3a1ed50;
const uint64_t k_sqlite3_column_type = 0x3a1eba0;
const uint64_t k_sqlite3_column_blob = 0x3a1e380;
const uint64_t k_sqlite3_column_bytes = 0x3a1e470;
const uint64_t k_sqlite3_finalize = 0x3a1cbe0;
const uint64_t kGPInstance = 0x58dd300;
const uint64_t kMultiDBMgr = 0x593abf8;
const uint64_t kPublicMsgMgr = 0x5938198;
const uint64_t kFavoriteStorageMgr = 0x593b790;
const uint64_t kHardLinkMgr = 0x593ab28;
const uint64_t kChatRoomMgr = 0x1b7f100;
const uint64_t kGetChatRoomDetailInfo = 0x2160bb0;
const uint64_t kNewChatRoomInfo = 0x2505120;
const uint64_t kFreeChatRoomInfo = 0x2505300;
const uint64_t kDoAddMemberToChatRoom = 0x21505b0;
const uint64_t kDoModChatRoomMemberNickName = 0x215a360;
const uint64_t kDelMemberFromChatRoom = 0x2150bf0;
const uint64_t kGetMemberFromChatRoom = 0x2162400;
const uint64_t kNewChatRoom = 0x2502540;
const uint64_t kFreeChatRoom = 0x2502740;
const uint64_t kTopMsg = 0x1d7d160;
const uint64_t kRemoveTopMsg = 0x2166090;
const uint64_t kInviteMember = 0x214ff90;
const uint64_t kHookLog = 0x1304e60;
const uint64_t kCreateChatRoom = 0x214fc60;
const uint64_t kQuitChatRoom = 0x215ac00;
const uint64_t kForwardMsg = 0x22c1590;
const uint64_t kOnSnsTimeLineSceneFinish = 0x1a73150;
const uint64_t kSNSGetFirstPage = 0x2e1bec0;
const uint64_t kSNSGetNextPageScene = 0x2e41a70;
const uint64_t kSNSDataMgr = 0x21dd6b0;
const uint64_t kSNSTimeLineMgr = 0x2dadf20;
const uint64_t kGetMgrByPrefixLocalId = 0x213afb0;
const uint64_t kAddFavFromMsg = 0x2930e40;
const uint64_t kGetChatMgr = 0x1b82bf0;
const uint64_t kGetFavoriteMgr = 0x1b57ba0;
const uint64_t kAddFavFromImage = 0x293d0f0;
const uint64_t kGetContact = 0x21945d0;
const uint64_t kNewContact = 0x2519300;
const uint64_t kFreeContact = 0x25199b0;
const uint64_t kNewMMReaderItem = 0x8c79a0;
const uint64_t kFreeMMReaderItem = 0x8c6da0;
const uint64_t kForwordPublicMsg = 0xddc6c0;
const uint64_t kParseAppMsgXml = 0x11b0a70;
const uint64_t kNewAppMsgInfo = 0x91a550;
const uint64_t kFreeAppMsgInfo = 0x8fd1a0;
const uint64_t kGetPreDownLoadMgr = 0x1c0a3a0;
const uint64_t kPushAttachTask = 0x1cda920;
const uint64_t kGetCustomSmileyMgr = 0x1ca0320;
const uint64_t kSendCustomEmotion = 0x21b04c0;
const uint64_t kNewJsApiShareAppMessage = 0x26cda20;
const uint64_t kInitJsConfig = 0x137bc00;
const uint64_t kSendApplet = 0x13c0920;
const uint64_t kSendAppletSecond = 0x13c1150;
const uint64_t kGetAppInfoByWaid = 0x13c5790;
const uint64_t kCopyShareAppMessageRequest = 0x13c0670;
const uint64_t kNewWAUpdatableMsgInfo = 0x919ca0;
const uint64_t kFreeWAUpdatableMsgInfo = 0x8fc230;
const uint64_t kSendPatMsg = 0x2ca9790;
const uint64_t kGetOCRManager = 0x999780;
const uint64_t kDoOCRTask = 0x2c53910;
const uint64_t kGetLockWechatMgr = 0x1c85010;
const uint64_t kRequestLockWechat = 0x1c397d0;
const uint64_t kRequestUnLockWechat = 0x1c39a70;
const uint64_t kOnLoginBtnClick = 0x202bc30;
const uint64_t kGetQRCodeLoginMgr = 0x201e350;
const uint64_t kUpdateMsg = 0x21421a0;
const uint64_t kGetVoiceMgr = 0x1e13320;
const uint64_t kChatMsg2NetSceneSendMsg = 0x1b70fd0;
const uint64_t kTranslateVoice = 0x2353d50;
const uint64_t kNewWebViewPageConfig = 0x1b53ae0;
const uint64_t kFreeWebViewPageConfig = 0x1b53d10;
const uint64_t kGetWebViewMgr = 0x1b43950;
const uint64_t kShowWebView = 0x302ed30;
const uint64_t kSetUrl = 0x13dd410;
const uint64_t kNewPayInfo = 0x1bcd930;
const uint64_t kFreePayInfo = 0x1b92450;
const uint64_t kTransferConfirm = 0x2f8c750;
const uint64_t kTransferRefuse = 0x2f8d340;
const uint64_t kAddFriend = 0x1f3a350;
const uint64_t kVerifyApply = 0x1f3a940;
const uint64_t kDoDelContact = 0x2310120;
const uint64_t kGetSearchContactMgr = 0x1f9a730;
const uint64_t kStartSearch = 0x22a4200;
#elif WECHAT_VERSION == V_3_9_11_25
const uint64_t kGetAccountServiceMgr = 0x1b50d00;
const uint64_t kSyncMsg = 0xc39680;
const uint64_t kSyncMsgNext = 0xc39680;
const uint64_t kGetCurrentDataPath = 0x2248ce0;
const uint64_t kGetAppDataSavePath = 0x25dc0e0;
const uint64_t kGetSendMessageMgr = 0x1b4f500;
const uint64_t kSendTextMsg = 0x22c2010;
const uint64_t kFreeChatMsg = 0x1b50d80;
const uint64_t kDoAddMsg = 0x230a3e0;
const uint64_t kSendImageMsg = 0x22b77a0;
const uint64_t kChatMsgInstanceCounter = 0x1b59670;
const uint64_t kSendFileMsg = 0x20cb6f0;
const uint64_t kGetAppMsgMgr = 0x1b544a0;
const uint64_t kGetContactMgr = 0x1b3ccd0;
const uint64_t kGetContactList = 0x219a1c0;
const uint64_t k_sqlite3_exec = 0x3a59b30;
const uint64_t k_sqlite3_prepare = 0x3a617b0;
const uint64_t k_sqlite3_open = 0x3a98fa0;
const uint64_t k_sqlite3_step = 0x3a1db30;
const uint64_t k_sqlite3_column_count = 0x3a1e350;
const uint64_t k_sqlite3_column_name = 0x3a1ed50;
const uint64_t k_sqlite3_column_type = 0x3a1eba0;
const uint64_t k_sqlite3_column_blob = 0x3a1e380;
const uint64_t k_sqlite3_column_bytes = 0x3a1e470;
const uint64_t k_sqlite3_finalize = 0x3a1cbe0;
const uint64_t kGPInstance = 0x58dd300;
const uint64_t kMultiDBMgr = 0x593abf8;
const uint64_t kPublicMsgMgr = 0x5938198;
const uint64_t kFavoriteStorageMgr = 0x593b790;
const uint64_t kHardLinkMgr = 0x593ab28;
const uint64_t kChatRoomMgr = 0x1b7f100;
const uint64_t kGetChatRoomDetailInfo = 0x2160bb0;
const uint64_t kNewChatRoomInfo = 0x2505120;
const uint64_t kFreeChatRoomInfo = 0x2505300;
const uint64_t kDoAddMemberToChatRoom = 0x21505b0;
const uint64_t kDoModChatRoomMemberNickName = 0x215a360;
const uint64_t kDelMemberFromChatRoom = 0x2150bf0;
const uint64_t kGetMemberFromChatRoom = 0x2162400;
const uint64_t kNewChatRoom = 0x2502540;
const uint64_t kFreeChatRoom = 0x2502740;
const uint64_t kTopMsg = 0x1d7d160;
const uint64_t kRemoveTopMsg = 0x2166090;
const uint64_t kInviteMember = 0x214ff90;
const uint64_t kHookLog = 0x1304e60;
const uint64_t kCreateChatRoom = 0x214fc60;
const uint64_t kQuitChatRoom = 0x215ac00;
const uint64_t kForwardMsg = 0x22c1590;
const uint64_t kOnSnsTimeLineSceneFinish = 0x1a73150;
const uint64_t kSNSGetFirstPage = 0x2e1bec0;
const uint64_t kSNSGetNextPageScene = 0x2e41a70;
const uint64_t kSNSDataMgr = 0x21dd6b0;
const uint64_t kSNSTimeLineMgr = 0x2dadf20;
const uint64_t kGetMgrByPrefixLocalId = 0x213afb0;
const uint64_t kAddFavFromMsg = 0x2930e40;
const uint64_t kGetChatMgr = 0x1b82bf0;
const uint64_t kGetFavoriteMgr = 0x1b57ba0;
const uint64_t kAddFavFromImage = 0x293d0f0;
const uint64_t kGetContact = 0x22609B0;
const uint64_t kNewContact = 0x25E4430;
const uint64_t kFreeContact = 0x25E4AE0;
const uint64_t kNewMMReaderItem = 0x8c79a0;
const uint64_t kFreeMMReaderItem = 0x8c6da0;
const uint64_t kForwordPublicMsg = 0xddc6c0;
const uint64_t kParseAppMsgXml = 0x11b0a70;
const uint64_t kNewAppMsgInfo = 0x91a550;
const uint64_t kFreeAppMsgInfo = 0x8fd1a0;
const uint64_t kGetPreDownLoadMgr = 0x1c0a3a0;
const uint64_t kPushAttachTask = 0x1cda920;
const uint64_t kGetCustomSmileyMgr = 0x1ca0320;
const uint64_t kSendCustomEmotion = 0x21b04c0;
const uint64_t kNewJsApiShareAppMessage = 0x26cda20;
const uint64_t kInitJsConfig = 0x137bc00;
const uint64_t kSendApplet = 0x13c0920;
const uint64_t kSendAppletSecond = 0x13c1150;
const uint64_t kGetAppInfoByWaid = 0x13c5790;
const uint64_t kCopyShareAppMessageRequest = 0x13c0670;
const uint64_t kNewWAUpdatableMsgInfo = 0x919ca0;
const uint64_t kFreeWAUpdatableMsgInfo = 0x8fc230;
const uint64_t kSendPatMsg = 0x2ca9790;
const uint64_t kGetOCRManager = 0x999780;
const uint64_t kDoOCRTask = 0x2c53910;
const uint64_t kGetLockWechatMgr = 0x1c85010;
const uint64_t kRequestLockWechat = 0x1c397d0;
const uint64_t kRequestUnLockWechat = 0x1c39a70;
const uint64_t kOnLoginBtnClick = 0x202bc30;
const uint64_t kGetQRCodeLoginMgr = 0x201e350;
const uint64_t kUpdateMsg = 0x21421a0;
const uint64_t kGetVoiceMgr = 0x1e13320;
const uint64_t kChatMsg2NetSceneSendMsg = 0x1b70fd0;
const uint64_t kTranslateVoice = 0x2353d50;
const uint64_t kNewWebViewPageConfig = 0x1b53ae0;
const uint64_t kFreeWebViewPageConfig = 0x1b53d10;
const uint64_t kGetWebViewMgr = 0x1b43950;
const uint64_t kShowWebView = 0x302ed30;
const uint64_t kSetUrl = 0x13dd410;
const uint64_t kNewPayInfo = 0x1bcd930;
const uint64_t kFreePayInfo = 0x1b92450;
const uint64_t kTransferConfirm = 0x2f8c750;
const uint64_t kTransferRefuse = 0x2f8d340;
const uint64_t kAddFriend = 0x1f3a350;
const uint64_t kVerifyApply = 0x1f3a940;
const uint64_t kDoDelContact = 0x2310120;
const uint64_t kGetSearchContactMgr = 0x1f9a730;
const uint64_t kStartSearch = 0x22a4200;
#else #else
#ifdef WECHAT_VERSION #ifdef WECHAT_VERSION
#error "Unsupported WeChat version." #error "Unsupported WeChat version."

View File

@ -7,6 +7,13 @@
namespace base { namespace base {
namespace utils { namespace utils {
#define STRINGIFY(S) #S
#define DEFER_STRINGIFY(S) STRINGIFY(S)
#define PRAGMA_MESSAGE(MSG) _Pragma(STRINGIFY(message(MSG)))
#define FORMATTED_MESSAGE(MSG) "warning [TODO-" DEFER_STRINGIFY(__COUNTER__) "] " MSG " : " __FILE__ "(" DEFER_STRINGIFY(__LINE__) ")"
#define TODO(MSG) PRAGMA_MESSAGE(FORMATTED_MESSAGE(MSG))
std::wstring Utf8ToWstring(const std::string &str); std::wstring Utf8ToWstring(const std::string &str);
std::string WstringToUtf8(const std::wstring &str); std::string WstringToUtf8(const std::wstring &str);

View File

@ -128,6 +128,31 @@ struct ContactProfileInner {
: wxid(""), account(""), v3(""), nickname(""), head_image("") {} : wxid(""), account(""), v3(""), nickname(""), head_image("") {}
}; };
struct SearchContactInner {
std::string big_image;
std::string small_image;
std::string city;
std::string nation;
std::string province;
std::string signature;
std::string v2;
std::string v3;
std::string nickname;
int32_t sex;
SearchContactInner()
: big_image(""),
small_image(""),
city(""),
nation(""),
province(""),
signature(""),
sex(-1),
v2(""),
v3(""),
nickname("") {}
};
namespace function { namespace function {
//hook //hook
typedef uint64_t(*__DoAddMsg)(uint64_t, uint64_t, uint64_t); typedef uint64_t(*__DoAddMsg)(uint64_t, uint64_t, uint64_t);
@ -224,6 +249,15 @@ typedef uint64_t (*__NewWebViewPageConfig)(uint64_t);
typedef uint64_t (*__FreeWebViewPageConfig)(uint64_t); typedef uint64_t (*__FreeWebViewPageConfig)(uint64_t);
typedef uint64_t (*__GetWebViewMgr)(); typedef uint64_t (*__GetWebViewMgr)();
typedef uint64_t (*__SetUrl)(uint64_t,uint64_t,uint64_t); typedef uint64_t (*__SetUrl)(uint64_t,uint64_t,uint64_t);
typedef uint64_t (*__NewWCPayInfo)(uint64_t);
typedef uint64_t (*__FreeWCPayInfo)(uint64_t);
typedef uint64_t (*__PayTransferConfirm)(uint64_t,uint64_t);
typedef uint64_t (*__PayTransferRefuse)(uint64_t,uint64_t);
typedef uint64_t (*__AddFriend)(uint64_t,uint64_t,uint64_t,uint64_t,uint64_t,uint64_t,uint64_t,uint64_t,uint64_t);
typedef uint64_t (*__Verify)(uint64_t,uint64_t,uint64_t,uint64_t,uint64_t,uint64_t,uint64_t,uint64_t,uint64_t);
typedef uint64_t (*__DelContact)(uint64_t);
typedef uint64_t (*__GetSearchContactMgr)();
typedef uint64_t (*__StartSearch)(uint64_t,uint64_t);
} // namespace function } // namespace function

View File

@ -37,7 +37,7 @@ class WeChatService : public base::Singleton<WeChatService> {
int64_t GetMemberFromChatRoom(const std::wstring& room_id, int64_t GetMemberFromChatRoom(const std::wstring& room_id,
ChatRoomMemberInner& member); ChatRoomMemberInner& member);
int64_t SetTopMsg(uint64_t msg_id); int64_t SetTopMsg(uint64_t msg_id);
int64_t RemoveTopMsg(const std::wstring& room_id, ULONG64 msg_id); int64_t RemoveTopMsg(const std::wstring& room_id, uint64_t msg_id);
int64_t InviteMemberToChatRoom(const std::wstring& room_id, int64_t InviteMemberToChatRoom(const std::wstring& room_id,
const std::vector<std::wstring>& wxids); const std::vector<std::wstring>& wxids);
int64_t CreateChatRoom(const std::vector<std::wstring>& wxids); int64_t CreateChatRoom(const std::vector<std::wstring>& wxids);
@ -70,11 +70,11 @@ class WeChatService : public base::Singleton<WeChatService> {
const std::wstring& wxid); const std::wstring& wxid);
int64_t SendApplet(const std::wstring& recv_wxid, int64_t SendApplet(const std::wstring& recv_wxid,
const std::wstring& waid_suff, const std::wstring& waid_w, const std::wstring& waid_suff, const std::wstring& waid_w,
const std::string& waid_s, const std::string& wa_wxid, const std::wstring& waid_s, const std::wstring& wa_wxid,
const std::string& json_param, const std::wstring& json_param,
const std::string& head_image, const std::wstring& head_image,
const std::string& big_image, const std::wstring& big_image,
const std::string& index_page); const std::wstring& index_page);
int64_t SendPatMsg(const std::wstring& room_id, const std::wstring& wxid); int64_t SendPatMsg(const std::wstring& room_id, const std::wstring& wxid);
int64_t DoOCRTask(const std::wstring& img_path, std::string& result); int64_t DoOCRTask(const std::wstring& img_path, std::string& result);
int64_t LockWeChat(); int64_t LockWeChat();
@ -88,6 +88,24 @@ class WeChatService : public base::Singleton<WeChatService> {
int64_t TranslateVoice(uint64_t msg_id); int64_t TranslateVoice(uint64_t msg_id);
std::string GetTranslateVoiceText(uint64_t msg_id); std::string GetTranslateVoiceText(uint64_t msg_id);
int64_t OpenUrlByWeChatBrowser(const std::wstring& url, int flag); int64_t OpenUrlByWeChatBrowser(const std::wstring& url, int flag);
std::wstring GetChatRoomMemberNickname(const std::wstring& room_id,
const std::wstring& member_id);
int64_t DelContact(const std::wstring& wxid);
int64_t SearchContact(const std::wstring& keyword,
wechat::SearchContactInner& contact);
int64_t AddFriendByWxid(const std::wstring& wxid, const std::wstring& msg);
int64_t VerifyApply(const std::wstring& v3, const std::wstring& v4,
int32_t permission);
int64_t DoConfirmReceipt(const std::wstring& wxid,
const std::wstring& transcationid,
const std::wstring& transferid);
int64_t DoRefuseReceipt(const std::wstring& wxid,
const std::wstring& transcationid,
const std::wstring& transferid);
private: private:
uint64_t base_addr_; uint64_t base_addr_;

View File

@ -5,6 +5,11 @@
#include <string> #include <string>
namespace wxhelper { namespace wxhelper {
namespace wxutils { namespace wxutils {
#ifdef _WIN64 #ifdef _WIN64
int64_t GetWeChatWinBase(); int64_t GetWeChatWinBase();
#else #else
@ -18,6 +23,7 @@ std::string ImageXor(std::string buf);
std::wstring ReadWstring(INT64 addr); std::wstring ReadWstring(INT64 addr);
std::string ReadWstringThenConvert(INT64 addr); std::string ReadWstringThenConvert(INT64 addr);
int DecodeImage(const wchar_t* file_path, const wchar_t* save_dir); int DecodeImage(const wchar_t* file_path, const wchar_t* save_dir);
bool FindOrCreateDirectory(const std::wstring &path);
} // namespace wxutils } // namespace wxutils
} // namespace wxhelper } // namespace wxhelper

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

14
resource.h Normal file
View File

@ -0,0 +1,14 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by wxhelper.rc
// 新对象的下一组默认值
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View File

@ -5,6 +5,7 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
#include "wechat_interface.h" #include "wechat_interface.h"
#include "wechat_service.h" #include "wechat_service.h"
#include "utils.h"
namespace jsonutils = wxhelper::jsonutils; namespace jsonutils = wxhelper::jsonutils;
namespace wxhelper { namespace wxhelper {
@ -20,6 +21,7 @@ std::string ChatController::SendTextMsg(std::string params) {
} }
std::string ChatController::SendImageMsg(std::string params) { std::string ChatController::SendImageMsg(std::string params) {
SPDLOG_INFO("SendImageMsg params={}", params);
nlohmann::json jp = nlohmann::json::parse(params); nlohmann::json jp = nlohmann::json::parse(params);
std::wstring wxid = jsonutils::GetWStringParam(jp, "wxid"); std::wstring wxid = jsonutils::GetWStringParam(jp, "wxid");
std::wstring image_path = jsonutils::GetWStringParam(jp, "imagePath"); std::wstring image_path = jsonutils::GetWStringParam(jp, "imagePath");
@ -30,6 +32,7 @@ std::string ChatController::SendImageMsg(std::string params) {
} }
std::string ChatController::SendFileMsg(std::string params) { std::string ChatController::SendFileMsg(std::string params) {
SPDLOG_INFO("SendFileMsg params={}", params);
nlohmann::json jp = nlohmann::json::parse(params); nlohmann::json jp = nlohmann::json::parse(params);
std::wstring wxid = jsonutils::GetWStringParam(jp, "wxid"); std::wstring wxid = jsonutils::GetWStringParam(jp, "wxid");
std::wstring file_path = jsonutils::GetWStringParam(jp, "filePath"); std::wstring file_path = jsonutils::GetWStringParam(jp, "filePath");
@ -40,6 +43,7 @@ std::string ChatController::SendFileMsg(std::string params) {
} }
std::string ChatController::SendAtText(std::string params) { std::string ChatController::SendAtText(std::string params) {
SPDLOG_INFO("SendAtText params={}", params);
nlohmann::json jp = nlohmann::json::parse(params); nlohmann::json jp = nlohmann::json::parse(params);
std::wstring chat_room_id = jsonutils::GetWStringParam(jp, "chatRoomId"); std::wstring chat_room_id = jsonutils::GetWStringParam(jp, "chatRoomId");
std::vector<std::wstring> wxids = jsonutils::GetArrayParam(jp, "wxids"); std::vector<std::wstring> wxids = jsonutils::GetArrayParam(jp, "wxids");
@ -51,6 +55,7 @@ std::string ChatController::SendAtText(std::string params) {
} }
std::string ChatController::SendMultiAtText(std::string params) { std::string ChatController::SendMultiAtText(std::string params) {
SPDLOG_INFO("SendMultiAtText params={}", params);
nlohmann::json jp = nlohmann::json::parse(params); nlohmann::json jp = nlohmann::json::parse(params);
nlohmann::json array = jp["at"]; nlohmann::json array = jp["at"];
std::vector<std::pair<std::wstring, std::wstring>> at; std::vector<std::pair<std::wstring, std::wstring>> at;
@ -67,19 +72,39 @@ std::string ChatController::SendMultiAtText(std::string params) {
return ret.dump(); return ret.dump();
} }
std::string ChatController::SendCustomEmotion(std::string params) { std::string ChatController::SendCustomEmotion(std::string params) {
nlohmann::json ret = { SPDLOG_INFO("SendCustomEmotion params={}", params);
{"code", 200}, {"data", {}}, {"msg", "Not Implemented"}}; nlohmann::json jp = nlohmann::json::parse(params);
std::wstring wxid = jsonutils::GetWStringParam(jp, "wxid");
std::wstring file_path = jsonutils::GetWStringParam(jp, "filePath");
int64_t success =
wechat::WeChatService::GetInstance().SendCustomEmotion(file_path, wxid);
nlohmann::json ret = {{"code", success}, {"data", {}}, {"msg", "success"}};
return ret.dump(); return ret.dump();
} }
TODO("")
std::string ChatController::SendApplet(std::string params) { std::string ChatController::SendApplet(std::string params) {
nlohmann::json ret = { SPDLOG_INFO("SendApplet params={}", params);
{"code", 200}, {"data", {}}, {"msg", "Not Implemented"}}; nlohmann::json jp = nlohmann::json::parse(params);
std::wstring wxid = jsonutils::GetWStringParam(jp, "wxid");
std::wstring waid_concat = jsonutils::GetWStringParam(jp, "waidConcat");
std::wstring waid = jsonutils::GetWStringParam(jp, "waid");
std::wstring app_wxid = jsonutils::GetWStringParam(jp, "appletWxid");
std::wstring json_param = jsonutils::GetWStringParam(jp, "jsonParam");
std::wstring head_url = jsonutils::GetWStringParam(jp, "headImgUrl");
std::wstring main_img = jsonutils::GetWStringParam(jp, "mainImg");
std::wstring index_page = jsonutils::GetWStringParam(jp, "indexPage");
int64_t success = wechat::WeChatService::GetInstance().SendApplet(
wxid, waid_concat, waid, waid, app_wxid, json_param, head_url, main_img,
index_page);
nlohmann::json ret = {{"code", success}, {"data", {}}, {"msg", "success"}};
return ret.dump(); return ret.dump();
} }
std::string ChatController::SendPatMsg(std::string params) { std::string ChatController::SendPatMsg(std::string params) {
SPDLOG_INFO("SendPatMsg params={}", params);
nlohmann::json jp = nlohmann::json::parse(params); nlohmann::json jp = nlohmann::json::parse(params);
std::wstring room_id = jsonutils::GetWStringParam(jp, "receiver"); std::wstring room_id = jsonutils::GetWStringParam(jp, "receiver");
std::wstring wxid = jsonutils::GetWStringParam(jp, "wxid"); std::wstring wxid = jsonutils::GetWStringParam(jp, "wxid");
@ -91,37 +116,55 @@ std::string ChatController::SendPatMsg(std::string params) {
} }
std::string ChatController::ForwardMsg(std::string params) { std::string ChatController::ForwardMsg(std::string params) {
SPDLOG_INFO("ForwardMsg params={}", params);
nlohmann::json jp = nlohmann::json::parse(params); nlohmann::json jp = nlohmann::json::parse(params);
std::wstring wxid = jsonutils::GetWStringParam(jp, "wxid"); std::wstring wxid = jsonutils::GetWStringParam(jp, "wxid");
int64_t msg_id = jsonutils::GetInt64Param(jp, "msgId"); int64_t msg_id = jsonutils::GetInt64Param(jp, "msgId");
int64_t success = int64_t success =
wechat::WeChatService::GetInstance().ForwardMsg(msg_id, wxid); wechat::WeChatService::GetInstance().ForwardMsg(msg_id, wxid);
nlohmann::json ret = { nlohmann::json ret = {{"code", success}, {"data", {}}, {"msg", "success"}};
{"code", success}, {"data", {}}, {"msg", "Not Implemented"}};
return ret.dump(); return ret.dump();
} }
std::string ChatController::ForwardPublicMsgByMsgId(std::string params) { std::string ChatController::ForwardPublicMsgByMsgId(std::string params) {
nlohmann::json ret = { SPDLOG_INFO("ForwardPublicMsgByMsgId params={}", params);
{"code", 200}, {"data", {}}, {"msg", "Not Implemented"}};
nlohmann::json jp = nlohmann::json::parse(params);
std::wstring wxid = jsonutils::GetWStringParam(jp, "wxid");
int64_t msg_id = jsonutils::GetInt64Param(jp, "msgId");
int64_t success =
wechat::WeChatService::GetInstance().ForwardPublicMsgByMsgId(wxid,
msg_id);
nlohmann::json ret = {{"code", success}, {"data", {}}, {"msg", "success"}};
return ret.dump(); return ret.dump();
} }
std::string ChatController::ForwardPublicMsg(std::string params) { std::string ChatController::ForwardPublicMsg(std::string params) {
nlohmann::json ret = { SPDLOG_INFO("ForwardPublicMsg params={}", params);
{"code", 200}, {"data", {}}, {"msg", "Not Implemented"}}; nlohmann::json jp = nlohmann::json::parse(params);
std::wstring wxid = jsonutils::GetWStringParam(jp, "wxid");
std::wstring appname = jsonutils::GetWStringParam(jp, "appName");
std::wstring username = jsonutils::GetWStringParam(jp, "userName");
std::wstring title = jsonutils::GetWStringParam(jp, "title");
std::wstring url = jsonutils::GetWStringParam(jp, "url");
std::wstring thumburl = jsonutils::GetWStringParam(jp, "thumbUrl");
std::wstring digest = jsonutils::GetWStringParam(jp, "digest");
INT64 success = wechat::WeChatService::GetInstance().ForwardPublicMsg(
wxid, title, url, thumburl, username, appname, digest);
nlohmann::json ret = {{"code", success}, {"data", {}}, {"msg", "success"}};
return ret.dump(); return ret.dump();
} }
std::string ChatController::GetContactOrChatRoomNickname(std::string params) { std::string ChatController::GetContactOrChatRoomNickname(std::string params) {
SPDLOG_INFO("GetContactOrChatRoomNickname params={}", params);
int64_t success = -1; int64_t success = -1;
nlohmann::json jp = nlohmann::json::parse(params); nlohmann::json jp = nlohmann::json::parse(params);
std::wstring wxid = jsonutils::GetWStringParam(jp, "wxid"); std::wstring wxid = jsonutils::GetWStringParam(jp, "wxid");
std::wstring nickname = std::wstring nickname =
wechat::WeChatService::GetInstance().GetContactOrChatRoomNickname(wxid); wechat::WeChatService::GetInstance().GetContactOrChatRoomNickname(wxid);
nlohmann::json ret = {{"code", success}, nlohmann::json ret = {
{"data", {"nickname", nickname}}, {"code", success}, {"data", {"nickname", nickname}}, {"msg", "success"}};
{"msg", "Not Implemented"}};
return ret.dump(); return ret.dump();
} }

View File

@ -5,6 +5,7 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
#include "wechat_interface.h" #include "wechat_interface.h"
#include "wechat_service.h" #include "wechat_service.h"
#include "utils.h"
namespace wxhelper { namespace wxhelper {
std::string ChatRoomController::GetChatRoomDetailInfo(std::string params) { std::string ChatRoomController::GetChatRoomDetailInfo(std::string params) {
nlohmann::json jp = nlohmann::json::parse(params); nlohmann::json jp = nlohmann::json::parse(params);
@ -31,7 +32,8 @@ std::string ChatRoomController::GetMemberFromChatRoom(std::string params) {
wechat::ChatRoomMemberInner member; wechat::ChatRoomMemberInner member;
int64_t success = wechat::WeChatService::GetInstance().GetMemberFromChatRoom( int64_t success = wechat::WeChatService::GetInstance().GetMemberFromChatRoom(
room_id, member); room_id, member);
nlohmann::json ret_data = {{"code", success}, {"data", {}}, {"msg", "success"}}; nlohmann::json ret_data = {
{"code", success}, {"data", {}}, {"msg", "success"}};
if (success > 0) { if (success > 0) {
nlohmann::json member_info = { nlohmann::json member_info = {
{"admin", member.admin}, {"admin", member.admin},
@ -56,8 +58,7 @@ std::string ChatRoomController::AddMemberToChatRoom(std::string params) {
} }
int64_t success = wechat::WeChatService::GetInstance().AddMemberToChatRoom( int64_t success = wechat::WeChatService::GetInstance().AddMemberToChatRoom(
room_id, wxid_list); room_id, wxid_list);
nlohmann::json ret = { nlohmann::json ret = {{"code", success}, {"data", {}}, {"msg", "success"}};
{"code", success}, {"data", {}}, {"msg", "success"}};
return ret.dump(); return ret.dump();
} }
std::string ChatRoomController::DelMemberFromChatRoom(std::string params) { std::string ChatRoomController::DelMemberFromChatRoom(std::string params) {
@ -70,44 +71,80 @@ std::string ChatRoomController::DelMemberFromChatRoom(std::string params) {
for (unsigned int i = 0; i < wxids.size(); i++) { for (unsigned int i = 0; i < wxids.size(); i++) {
wxid_list.push_back(wxids[i]); wxid_list.push_back(wxids[i]);
} }
INT64 success = wechat::WeChatService::GetInstance().DelMemberFromChatRoom( int64_t success = wechat::WeChatService::GetInstance().DelMemberFromChatRoom(
room_id, wxid_list); room_id, wxid_list);
nlohmann::json ret_data = { nlohmann::json ret_data = {
{"code", success}, {"msg", "success"}, {"data", {}}}; {"code", success}, {"msg", "success"}, {"data", {}}};
return ret_data.dump(); return ret_data.dump();
} }
std::string ChatRoomController::CreateChatRoom(std::string params) { std::string ChatRoomController::CreateChatRoom(std::string params) {
nlohmann::json ret = { SPDLOG_INFO("CreateChatRoom params:{}", params);
{"code", 200}, {"data", {}}, {"msg", "Not Implemented"}}; nlohmann::json jp = nlohmann::json::parse(params);
std::vector<std::wstring> wxids = jsonutils::GetArrayParam(jp, "memberIds");
int64_t success = wechat::WeChatService::GetInstance().CreateChatRoom(wxids);
nlohmann::json ret = {{"code", success}, {"data", {}}, {"msg", "success"}};
return ret.dump(); return ret.dump();
} }
std::string ChatRoomController::QuitChatRoom(std::string params) { std::string ChatRoomController::QuitChatRoom(std::string params) {
nlohmann::json ret = { SPDLOG_INFO("QuitChatRoom params:{}", params);
{"code", 200}, {"data", {}}, {"msg", "Not Implemented"}}; nlohmann::json jp = nlohmann::json::parse(params);
std::wstring room_id = jsonutils::GetWStringParam(jp, "chatRoomId");
int64_t success = wechat::WeChatService::GetInstance().QuitChatRoom(room_id);
nlohmann::json ret = {{"code", success}, {"data", {}}, {"msg", "success"}};
return ret.dump(); return ret.dump();
} }
std::string ChatRoomController::InviteMemberToChatRoom(std::string params) { std::string ChatRoomController::InviteMemberToChatRoom(std::string params) {
nlohmann::json ret = { SPDLOG_INFO("InviteMemberToChatRoom params:{}", params);
{"code", 200}, {"data", {}}, {"msg", "Not Implemented"}}; nlohmann::json jp = nlohmann::json::parse(params);
std::wstring room_id = jsonutils::GetWStringParam(jp, "chatRoomId");
std::vector<std::wstring> wxids = jsonutils::GetArrayParam(jp, "memberIds");
int64_t success = wechat::WeChatService::GetInstance().InviteMemberToChatRoom(
room_id, wxids);
nlohmann::json ret = {{"code", success}, {"data", {}}, {"msg", "success"}};
return ret.dump(); return ret.dump();
} }
std::string ChatRoomController::TopMsg(std::string params) { std::string ChatRoomController::TopMsg(std::string params) {
return std::string(); SPDLOG_INFO("TopMsg params:{}", params);
nlohmann::json jp = nlohmann::json::parse(params);
int64_t msg_id = jsonutils::GetInt64Param(jp, "msgId");
int64_t success = wechat::WeChatService::GetInstance().SetTopMsg(msg_id);
nlohmann::json ret = {{"code", success}, {"data", {}}, {"msg", "success"}};
return ret.dump();
} }
std::string ChatRoomController::RemoveTopMsg(std::string params) { std::string ChatRoomController::RemoveTopMsg(std::string params) {
nlohmann::json ret = { SPDLOG_INFO("RemoveTopMsg params:{}", params);
{"code", 200}, {"data", {}}, {"msg", "Not Implemented"}}; nlohmann::json jp = nlohmann::json::parse(params);
std::wstring room_id = jsonutils::GetWStringParam(jp, "chatRoomId");
int64_t msg_id = jsonutils::GetInt64Param(jp, "msgId");
int64_t success =
wechat::WeChatService::GetInstance().RemoveTopMsg(room_id, msg_id);
nlohmann::json ret = {{"code", success}, {"data", {}}, {"msg", "success"}};
return ret.dump(); return ret.dump();
} }
std::string ChatRoomController::GetChatRoomMemberNickname(std::string params) { std::string ChatRoomController::GetChatRoomMemberNickname(std::string params) {
SPDLOG_INFO("GetChatRoomMemberNickname params:{}", params);
nlohmann::json jp = nlohmann::json::parse(params);
std::wstring room_id = jsonutils::GetWStringParam(jp, "chatRoomId");
std::wstring member_id = jsonutils::GetWStringParam(jp, "memberId");
std::wstring name = wechat::WeChatService::GetInstance().GetChatRoomMemberNickname(room_id,
member_id);
nlohmann::json ret = { nlohmann::json ret = {
{"code", 200}, {"data", {}}, {"msg", "Not Implemented"}}; {"code", 1},
{"data", {{"nickname", base::utils::WstringToUtf8(name)}}},
{"msg", "success"}};
return ret.dump(); return ret.dump();
} }
std::string ChatRoomController::ModifyChatRoomMemberNickName( std::string ChatRoomController::ModifyChatRoomMemberNickName(
std::string params) { std::string params) {
nlohmann::json ret = { SPDLOG_INFO("ModifyChatRoomMemberNickName params:{}", params);
{"code", 200}, {"data", {}}, {"msg", "Not Implemented"}}; nlohmann::json jp = nlohmann::json::parse(params);
std::wstring room_id = jsonutils::GetWStringParam(jp, "chatRoomId");
std::wstring wxid = jsonutils::GetWStringParam(jp, "wxid");
std::wstring nickName = jsonutils::GetWStringParam(jp, "nickName");
int64_t success =
wechat::WeChatService::GetInstance().ModChatRoomMemberNickName(
room_id, wxid, nickName);
nlohmann::json ret = {{"code", success}, {"msg", "success"}, {"data", {}}};
return ret.dump(); return ret.dump();
} }
} // namespace wxhelper } // namespace wxhelper

View File

@ -1,13 +1,14 @@
#include "contacts_controller.h" #include "contacts_controller.h"
#include "json_utils.h"
#include "nlohmann/json.hpp" #include "nlohmann/json.hpp"
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
#include "wechat_interface.h" #include "wechat_interface.h"
#include "json_utils.h"
#include "wechat_service.h" #include "wechat_service.h"
namespace jsonutils = wxhelper::jsonutils; namespace jsonutils = wxhelper::jsonutils;
namespace wxhelper {
std::string wxhelper::ContactsController::GetContactList(std::string params) { std::string ContactsController::GetContactList(std::string params) {
SPDLOG_INFO("GetContactList params:{}", params);
std::vector<wechat::ContactInner> vec; std::vector<wechat::ContactInner> vec;
int64_t success = wechat::WeChatService::GetInstance().GetContacts(vec); int64_t success = wechat::WeChatService::GetInstance().GetContacts(vec);
nlohmann::json ret_data = { nlohmann::json ret_data = {
@ -34,33 +35,83 @@ std::string wxhelper::ContactsController::GetContactList(std::string params) {
return ret_data.dump(); return ret_data.dump();
} }
std::string wxhelper::ContactsController::GetContactProfile( std::string ContactsController::GetContactProfile(
std::string params) { std::string params) {
nlohmann::json ret = { SPDLOG_INFO("GetContactProfile params:{}", params);
{"code", 200}, {"data", {}}, {"msg", "Not Implemented"}}; nlohmann::json jp = nlohmann::json::parse(params);
std::wstring wxid = jsonutils::GetWStringParam(jp, "wxid");
wechat::ContactProfileInner profile;
int64_t success =
wechat::WeChatService::GetInstance().GetContactByWxid(wxid, profile);
nlohmann::json ret = {{"code", success}, {"msg", "success"}, {"data", {}}};
if (success == 1) {
nlohmann::json contact_profile = {
{"account", profile.account}, {"headImage", profile.head_image},
{"nickname", profile.nickname}, {"v3", profile.v3},
{"wxid", profile.wxid},
};
ret["data"] = contact_profile;
}
return ret.dump(); return ret.dump();
} }
std::string wxhelper::ContactsController::DelContact(std::string params) { std::string ContactsController::DelContact(std::string params) {
nlohmann::json ret = { SPDLOG_INFO("DelContact params:{}", params);
{"code", 200}, {"data", {}}, {"msg", "Not Implemented"}}; nlohmann::json jp = nlohmann::json::parse(params);
std::wstring wxid = jsonutils::GetWStringParam(jp, "wxid");
int64_t success = wechat::WeChatService::GetInstance().DelContact(wxid);
nlohmann::json ret = {{"code", success}, {"data", {}}, {"msg", "success"}};
return ret.dump(); return ret.dump();
} }
std::string wxhelper::ContactsController::SearchContact(std::string params) { std::string ContactsController::SearchContact(std::string params) {
nlohmann::json ret = { SPDLOG_INFO("SearchContact params:{}", params);
{"code", 200}, {"data", {}}, {"msg", "Not Implemented"}}; nlohmann::json jp = nlohmann::json::parse(params);
std::wstring keyword = jsonutils::GetWStringParam(jp, "keyword");
wechat::SearchContactInner contact;
int64_t success =
wechat::WeChatService::GetInstance().SearchContact(keyword, contact);
nlohmann::json ret = {{"code", success}, {"data", {}}, {"msg", "success"}};
if (success == 1) {
nlohmann::json info = {
{"bigImage", contact.big_image},
{"smallImage", contact.small_image},
{"city", contact.city},
{"nation", contact.nation},
{"nickname", contact.nickname},
{"province", contact.province},
{"sex", contact.sex},
{"signature", contact.signature},
{"v2", contact.v2},
{"v3", contact.v3},
};
ret["data"] = info;
}
return ret.dump(); return ret.dump();
} }
std::string wxhelper::ContactsController::AddContact(std::string params) { std::string ContactsController::AddContact(std::string params) {
nlohmann::json ret = { SPDLOG_INFO("AddContact params:{}", params);
{"code", 200}, {"data", {}}, {"msg", "Not Implemented"}}; nlohmann::json jp = nlohmann::json::parse(params);
std::wstring wxid = jsonutils::GetWStringParam(jp, "wxid");
std::wstring msg = jsonutils::GetWStringParam(jp, "msg");
int64_t success =
wechat::WeChatService::GetInstance().AddFriendByWxid(wxid, msg);
nlohmann::json ret = {{"code", success}, {"data", {}}, {"msg", "success"}};
return ret.dump(); return ret.dump();
} }
std::string wxhelper::ContactsController::VerifyApply(std::string params) { std::string ContactsController::VerifyApply(std::string params) {
nlohmann::json ret = { SPDLOG_INFO("VerifyApply params:{}", params);
{"code", 200}, {"data", {}}, {"msg", "Not Implemented"}}; nlohmann::json jp = nlohmann::json::parse(params);
std::wstring v3 = jsonutils::GetWStringParam(jp, "v3");
std::wstring v4 = jsonutils::GetWStringParam(jp, "v4");
int32_t permission = jsonutils::GetIntParam(jp, "permission");
int64_t success =
wechat::WeChatService::GetInstance().VerifyApply(v3, v4, permission);
nlohmann::json ret = {{"code", success}, {"data", {}}, {"msg", "success"}};
return ret.dump(); return ret.dump();
} }
}

View File

@ -38,38 +38,65 @@ std::string MiscController::GetUserInfo(std::string params) {
return ret.dump(); return ret.dump();
} }
std::string MiscController::GetSNSFirstPage(std::string params) { std::string MiscController::GetSNSFirstPage(std::string params) {
nlohmann::json ret = { int64_t success = wechat::WeChatService::GetInstance().GetSNSFirstPage();
{"code", 200}, {"data", {}}, {"msg", "Not Implemented"}}; nlohmann::json ret = {{"code", success}, {"data", {}}, {"msg", "success"}};
return ret.dump(); return ret.dump();
} }
std::string MiscController::GetSNSNextPage(std::string params) { std::string MiscController::GetSNSNextPage(std::string params) {
nlohmann::json ret = { SPDLOG_INFO("GetSNSNextPage params:{}", params);
{"code", 200}, {"data", {}}, {"msg", "Not Implemented"}}; nlohmann::json jp = nlohmann::json::parse(params);
int64_t sns_id = jsonutils::GetInt64Param(jp, "snsId");
int64_t success = wechat::WeChatService::GetInstance().GetSNSNextPage(sns_id);
nlohmann::json ret = {{"code", success}, {"data", {}}, {"msg", "success"}};
return ret.dump(); return ret.dump();
} }
std::string MiscController::AddFavFromMsg(std::string params) { std::string MiscController::AddFavFromMsg(std::string params) {
nlohmann::json ret = { SPDLOG_INFO("AddFavFromMsg params:{}", params);
{"code", 200}, {"data", {}}, {"msg", "Not Implemented"}}; nlohmann::json jp = nlohmann::json::parse(params);
int64_t sns_id = jsonutils::GetInt64Param(jp, "msgId");
int64_t success = wechat::WeChatService::GetInstance().AddFavFromMsg(sns_id);
nlohmann::json ret = {{"code", success}, {"data", {}}, {"msg", "success"}};
return ret.dump(); return ret.dump();
} }
std::string MiscController::AddFavFromImage(std::string params) { std::string MiscController::AddFavFromImage(std::string params) {
nlohmann::json ret = { SPDLOG_INFO("AddFavFromImage params:{}", params);
{"code", 200}, {"data", {}}, {"msg", "Not Implemented"}}; nlohmann::json jp = nlohmann::json::parse(params);
std::wstring wxid = jsonutils::GetWStringParam(jp, "wxid");
std::wstring image_path = jsonutils::GetWStringParam(jp, "imagePath");
int64_t success =
wechat::WeChatService::GetInstance().AddFavFromImage(wxid, image_path);
nlohmann::json ret = {{"code", success}, {"data", {}}, {"msg", "success"}};
return ret.dump(); return ret.dump();
} }
std::string MiscController::DecodeImage(std::string params) { std::string MiscController::DecodeImage(std::string params) {
nlohmann::json ret = { SPDLOG_INFO("DecodeImage params:{}", params);
{"code", 200}, {"data", {}}, {"msg", "Not Implemented"}}; nlohmann::json jp = nlohmann::json::parse(params);
std::wstring file_path = jsonutils::GetWStringParam(jp, "filePath");
std::wstring store_dir = jsonutils::GetWStringParam(jp, "storeDir");
int64_t success =
wechat::WeChatService::GetInstance().DecodeImage(file_path, store_dir);
nlohmann::json ret = {{"code", success}, {"data", {}}, {"msg", "success"}};
return ret.dump(); return ret.dump();
} }
std::string MiscController::GetVoiceByMsgId(std::string params) { std::string MiscController::GetVoiceByMsgId(std::string params) {
nlohmann::json ret = { SPDLOG_INFO("GetVoiceByMsgId params:{}", params);
{"code", 200}, {"data", {}}, {"msg", "Not Implemented"}}; nlohmann::json jp = nlohmann::json::parse(params);
int64_t msg_id = jsonutils::GetInt64Param(jp, "msgId");
std::wstring store_dir = jsonutils::GetWStringParam(jp, "storeDir");
int64_t success =
wechat::WeChatService::GetInstance().GetVoiceByDB(msg_id, store_dir);
nlohmann::json ret = {{"code", success}, {"data", {}}, {"msg", "success"}};
return ret.dump(); return ret.dump();
} }
std::string MiscController::DoOcrTask(std::string params) { std::string MiscController::DoOcrTask(std::string params) {
SPDLOG_INFO("DoOcrTask params:{}", params);
nlohmann::json jp = nlohmann::json::parse(params);
std::wstring image_path = jsonutils::GetWStringParam(jp, "imagePath");
std::string text("");
int64_t success =
wechat::WeChatService::GetInstance().DoOCRTask(image_path, text);
nlohmann::json ret = { nlohmann::json ret = {
{"code", 200}, {"data", {}}, {"msg", "Not Implemented"}}; {"code", success}, {"data", {{"content", text}}}, {"msg", "success"}};
return ret.dump(); return ret.dump();
} }
std::string MiscController::LockWeChat(std::string params) { std::string MiscController::LockWeChat(std::string params) {
@ -94,6 +121,7 @@ std::string MiscController::GetLoginUrl(std::string params) {
return ret.dump(); return ret.dump();
} }
std::string MiscController::TranslateVoice(std::string params) { std::string MiscController::TranslateVoice(std::string params) {
SPDLOG_INFO("TranslateVoice params:{}", params);
nlohmann::json jp = nlohmann::json::parse(params); nlohmann::json jp = nlohmann::json::parse(params);
int64_t msg_id = jsonutils::GetInt64Param(jp, "msgId"); int64_t msg_id = jsonutils::GetInt64Param(jp, "msgId");
int64_t success = wechat::WeChatService::GetInstance().TranslateVoice(msg_id); int64_t success = wechat::WeChatService::GetInstance().TranslateVoice(msg_id);
@ -110,23 +138,32 @@ std::string MiscController::GetTranslateVoiceText(std::string params) {
return ret_data.dump(); return ret_data.dump();
} }
std::string MiscController::OpenUrlByWeChat(std::string params) { std::string MiscController::OpenUrlByWeChat(std::string params) {
SPDLOG_INFO("OpenUrlByWeChat params:{}", params);
nlohmann::json jp = nlohmann::json::parse(params); nlohmann::json jp = nlohmann::json::parse(params);
std::wstring url = jsonutils::GetWStringParam(jp, "url"); std::wstring url = jsonutils::GetWStringParam(jp, "url");
int flag = jsonutils::GetIntParam(jp, "flag"); int flag = jsonutils::GetIntParam(jp, "flag");
int64_t success = int64_t success =
wechat::WeChatService::GetInstance().OpenUrlByWeChatBrowser(url, flag); wechat::WeChatService::GetInstance().OpenUrlByWeChatBrowser(url, flag);
nlohmann::json ret = { nlohmann::json ret = {{"code", success}, {"data", {}}, {"msg", "success"}};
{"code", success}, {"data", {}}, {"msg", "Not Implemented"}};
return ret.dump(); return ret.dump();
} }
std::string MiscController::ConfirmReceipt(std::string params) { std::string MiscController::ConfirmReceipt(std::string params) {
nlohmann::json ret = { SPDLOG_INFO("ConfirmReceipt params:{}", params);
{"code", 200}, {"data", {}}, {"msg", "Not Implemented"}}; nlohmann::json jp = nlohmann::json::parse(params);
std::wstring wxid = jsonutils::GetWStringParam(jp, "wxid");
std::wstring transcationid = jsonutils::GetWStringParam(jp, "transcationId");
std::wstring transferid = jsonutils::GetWStringParam(jp, "transferId");
int64_t success = wechat::WeChatService::GetInstance().DoConfirmReceipt(
wxid, transcationid, transferid);
nlohmann::json ret = {{"code", success}, {"data", {}}, {"msg", "success"}};
return ret.dump(); return ret.dump();
} }
std::string MiscController::DownloadAttach(std::string params) { std::string MiscController::DownloadAttach(std::string params) {
nlohmann::json ret = { SPDLOG_INFO("DownloadAttach params:{}", params);
{"code", 200}, {"data", {}}, {"msg", "Not Implemented"}}; nlohmann::json jp = nlohmann::json::parse(params);
int64_t msg_id = jsonutils::GetInt64Param(jp, "msgId");
int64_t success = wechat::WeChatService::GetInstance().DoDownloadTask(msg_id);
nlohmann::json ret = {{"code", success}, {"data", {}}, {"msg", "success"}};
return ret.dump(); return ret.dump();
} }
} // namespace wxhelper } // namespace wxhelper

View File

@ -1,4 +1,4 @@
#include "include/thread_pool.h" #include "thread_pool.h"
namespace base { namespace base {
ThreadPool::~ThreadPool() { ThreadPool::~ThreadPool() {

View File

@ -1,4 +1,4 @@
#include "include/utils.h" #include "utils.h"
#include <winternl.h> #include <winternl.h>

View File

@ -1,18 +1,34 @@
#include "wechat_service.h" #include "wechat_service.h"
#include "json_utils.h" #include "json_utils.h"
#include "memory.h" #include "base/memory.h"
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
#include "tinyxml2.h" #include "tinyxml2.h"
#include "utils.h" #include "utils.h"
#include "wechat_db.h" #include "wechat_db.h"
#include "wxutils.h" #include "wxutils.h"
#define BUFSIZE 1024
#define JPEG0 0xFF
#define JPEG1 0xD8
#define JPEG2 0xFF
#define PNG0 0x89
#define PNG1 0x50
#define PNG2 0x4E
#define BMP0 0x42
#define BMP1 0x4D
#define GIF0 0x47
#define GIF1 0x49
#define GIF2 0x46
namespace offset = wechat::offset; namespace offset = wechat::offset;
namespace prototype = wechat::prototype; namespace prototype = wechat::prototype;
namespace func = wechat::function; namespace func = wechat::function;
namespace utils = base::utils; namespace utils = base::utils;
namespace jsonutils = wxhelper::jsonutils; namespace jsonutils = wxhelper::jsonutils;
namespace wxutils = wxhelper::wxutils; namespace wxutils = wxhelper::wxutils;
prototype::WeChatString* BuildWechatString(const std::wstring& ws) { prototype::WeChatString* BuildWechatString(const std::wstring& ws) {
prototype::WeChatString* p = prototype::WeChatString* p =
base::utils::WxHeapAlloc<prototype::WeChatString>( base::utils::WxHeapAlloc<prototype::WeChatString>(
@ -269,7 +285,7 @@ int64_t wechat::WeChatService::SendImageMsg(const std::wstring& wxid,
uint64_t temp2 = 0; uint64_t temp2 = 0;
uint64_t temp3 = 1; uint64_t temp3 = 1;
uint64_t* flag[10] = {}; uint64_t* flag[10] = {};
flag[0] = reinterpret_cast<uint64_t*>(temp3); flag[0] = reinterpret_cast<uint64_t*>(temp3);
flag[8] = &temp1; flag[8] = &temp1;
flag[9] = &temp2; flag[9] = &temp2;
flag[1] = reinterpret_cast<uint64_t*>(p_chat_msg_temp); flag[1] = reinterpret_cast<uint64_t*>(p_chat_msg_temp);
@ -385,27 +401,33 @@ int64_t wechat::WeChatService::GetContacts(std::vector<ContactInner>& vec) {
int64_t wechat::WeChatService::GetChatRoomDetailInfo( int64_t wechat::WeChatService::GetChatRoomDetailInfo(
const std::wstring& room_id, ChatRoomInfoInner& room_info) { const std::wstring& room_id, ChatRoomInfoInner& room_info) {
int64_t success = -1; int64_t success = -1;
prototype::WeChatString chat_room_id(room_id); prototype::WeChatString chat_room_id(room_id);
int64_t base_addr = wxutils::GetWeChatWinBase(); int64_t base_addr = wxutils::GetWeChatWinBase();
uint64_t get_chat_room_mgr_addr = base_addr + offset::kChatRoomMgr; uint64_t get_chat_room_mgr_addr = base_addr + offset::kChatRoomMgr;
uint64_t get_chat_room_detail_addr = base_addr + offset::kGetChatRoomDetailInfo; uint64_t get_chat_room_detail_addr =
base_addr + offset::kGetChatRoomDetailInfo;
uint64_t create_chat_room_info_addr = base_addr + offset::kNewChatRoomInfo; uint64_t create_chat_room_info_addr = base_addr + offset::kNewChatRoomInfo;
uint64_t free_chat_room_info_addr = base_addr + offset::kFreeChatRoomInfo; uint64_t free_chat_room_info_addr = base_addr + offset::kFreeChatRoomInfo;
func::__GetChatRoomMgr get_chat_room_mgr = (func::__GetChatRoomMgr)get_chat_room_mgr_addr; func::__GetChatRoomMgr get_chat_room_mgr =
func::__NewChatRoomInfo new_chat_room_info = (func::__NewChatRoomInfo)create_chat_room_info_addr; (func::__GetChatRoomMgr)get_chat_room_mgr_addr;
func::__FreeChatRoomInfo free_chat_room_info = (func::__FreeChatRoomInfo)free_chat_room_info_addr; func::__NewChatRoomInfo new_chat_room_info =
func::__GetChatRoomDetailInfo get_chat_room_detail = (func::__GetChatRoomDetailInfo)get_chat_room_detail_addr; (func::__NewChatRoomInfo)create_chat_room_info_addr;
func::__FreeChatRoomInfo free_chat_room_info =
(func::__FreeChatRoomInfo)free_chat_room_info_addr;
func::__GetChatRoomDetailInfo get_chat_room_detail =
(func::__GetChatRoomDetailInfo)get_chat_room_detail_addr;
char chat_room_info[0x144] = {0}; char chat_room_info[0x144] = {0};
uint64_t new_room_info = new_chat_room_info(reinterpret_cast<uint64_t>(&chat_room_info)); uint64_t new_room_info =
new_chat_room_info(reinterpret_cast<uint64_t>(&chat_room_info));
uint64_t mgr = get_chat_room_mgr(); uint64_t mgr = get_chat_room_mgr();
success = get_chat_room_detail(mgr,reinterpret_cast<uint64_t>(&chat_room_id),new_room_info,1); success = get_chat_room_detail(mgr, reinterpret_cast<uint64_t>(&chat_room_id),
new_room_info, 1);
room_info.chat_room_id = wxutils::ReadWstringThenConvert(new_room_info + 0x8); room_info.chat_room_id = wxutils::ReadWstringThenConvert(new_room_info + 0x8);
room_info.notice = wxutils::ReadWstringThenConvert(new_room_info + 0x28); room_info.notice = wxutils::ReadWstringThenConvert(new_room_info + 0x28);
room_info.admin = wxutils::ReadWstringThenConvert(new_room_info + 0x48); room_info.admin = wxutils::ReadWstringThenConvert(new_room_info + 0x48);
@ -425,10 +447,10 @@ int64_t wechat::WeChatService::AddMemberToChatRoom(
func::__DoAddMemberToChatRoom add_members = func::__DoAddMemberToChatRoom add_members =
(func::__DoAddMemberToChatRoom)add_members_addr; (func::__DoAddMemberToChatRoom)add_members_addr;
prototype::WeChatString *chat_room_id = (prototype::WeChatString *)HeapAlloc( prototype::WeChatString* chat_room_id = (prototype::WeChatString*)HeapAlloc(
GetProcessHeap(), 0, sizeof(prototype::WeChatString)); GetProcessHeap(), 0, sizeof(prototype::WeChatString));
wchar_t *p_chat_room_id = wchar_t* p_chat_room_id =
(wchar_t *)HeapAlloc(GetProcessHeap(), 0, (room_id.size() + 1) * 2); (wchar_t*)HeapAlloc(GetProcessHeap(), 0, (room_id.size() + 1) * 2);
wmemcpy(p_chat_room_id, room_id.c_str(), room_id.size() + 1); wmemcpy(p_chat_room_id, room_id.c_str(), room_id.size() + 1);
chat_room_id->ptr = p_chat_room_id; chat_room_id->ptr = p_chat_room_id;
chat_room_id->length = static_cast<int32_t>(room_id.size()); chat_room_id->length = static_cast<int32_t>(room_id.size());
@ -438,7 +460,7 @@ int64_t wechat::WeChatService::AddMemberToChatRoom(
std::vector<prototype::WeChatString> member_list; std::vector<prototype::WeChatString> member_list;
uint64_t temp[2] = {0}; uint64_t temp[2] = {0};
wechat::VectorInner *list = (wechat::VectorInner *)&member_list; wechat::VectorInner* list = (wechat::VectorInner*)&member_list;
int64_t members_ptr = (int64_t)&list->start; int64_t members_ptr = (int64_t)&list->start;
for (int i = 0; i < members.size(); i++) { for (int i = 0; i < members.size(); i++) {
prototype::WeChatString member(members[i]); prototype::WeChatString member(members[i]);
@ -454,7 +476,18 @@ int64_t wechat::WeChatService::AddMemberToChatRoom(
int64_t wechat::WeChatService::ModChatRoomMemberNickName( int64_t wechat::WeChatService::ModChatRoomMemberNickName(
const std::wstring& room_id, const std::wstring& wxid, const std::wstring& room_id, const std::wstring& wxid,
const std::wstring& nickname) { const std::wstring& nickname) {
return 0; int64_t success = -1;
uint64_t mod_addr = base_addr_ + offset::kDoModChatRoomMemberNickName;
func::__DoModChatRoomMemberNickName modify =
(func::__DoModChatRoomMemberNickName)mod_addr;
const wchar_t* p = room_id.c_str();
prototype::WeChatString* chat_room_id = BuildWechatString(room_id);
prototype::WeChatString* self_id = BuildWechatString(wxid);
prototype::WeChatString* name = BuildWechatString(nickname);
success = modify(
reinterpret_cast<UINT64>(p), reinterpret_cast<UINT64>(chat_room_id),
reinterpret_cast<UINT64>(self_id), reinterpret_cast<UINT64>(name));
return success;
} }
int64_t wechat::WeChatService::DelMemberFromChatRoom( int64_t wechat::WeChatService::DelMemberFromChatRoom(
@ -499,7 +532,7 @@ int64_t wechat::WeChatService::GetMemberFromChatRoom(
prototype::WeChatString chat_room_id(room_id); prototype::WeChatString chat_room_id(room_id);
char chat_room_info[0x308] = {0}; char chat_room_info[0x308] = {0};
uint64_t addr = new_chat_room(reinterpret_cast<uint64_t>(&chat_room_info)); uint64_t addr = new_chat_room(reinterpret_cast<uint64_t>(&chat_room_info));
uint64_t mgr = get_chat_room_mgr(); uint64_t mgr = get_chat_room_mgr();
success = get_members(mgr, reinterpret_cast<uint64_t>(&chat_room_id), addr); success = get_members(mgr, reinterpret_cast<uint64_t>(&chat_room_id), addr);
member.chat_room_id = wxutils::ReadWstringThenConvert(addr + 0x10); member.chat_room_id = wxutils::ReadWstringThenConvert(addr + 0x10);
@ -511,25 +544,96 @@ int64_t wechat::WeChatService::GetMemberFromChatRoom(
return success; return success;
} }
int64_t wechat::WeChatService::SetTopMsg(uint64_t msg_id) { return 0; } int64_t wechat::WeChatService::SetTopMsg(uint64_t msg_id) {
int64_t success = -1;
uint64_t top_addr = base_addr_ + offset::kTopMsg;
func::__DoTopMsg top_msg = (func::__DoTopMsg)top_addr;
int64_t index = 0;
int64_t local_id =
wechat::WeChatDb::GetInstance().GetLocalIdByMsgId(msg_id, index);
if (local_id <= 0 || index >> 32 == 0) {
success = -2;
return success;
}
LARGE_INTEGER l;
l.HighPart = index >> 32;
l.LowPart = (DWORD)local_id;
uint64_t ptr = reinterpret_cast<uint64_t>(&l);
success = top_msg(ptr, 1);
return success;
}
int64_t wechat::WeChatService::RemoveTopMsg(const std::wstring& room_id, int64_t wechat::WeChatService::RemoveTopMsg(const std::wstring& room_id,
ULONG64 msg_id) { uint64_t msg_id) {
return 0; int64_t success = -1;
uint64_t remove_addr = base_addr_ + offset::kRemoveTopMsg;
func::__RemoveTopMsg remove_top_msg = (func::__RemoveTopMsg)remove_addr;
prototype::WeChatString* chat_room_id = BuildWechatString(room_id);
const wchar_t* w_room = room_id.c_str();
success = remove_top_msg(reinterpret_cast<UINT64>(w_room), msg_id,
reinterpret_cast<UINT64>(chat_room_id));
return success;
} }
TODO("InviteMemberToChatRoom")
int64_t wechat::WeChatService::InviteMemberToChatRoom( int64_t wechat::WeChatService::InviteMemberToChatRoom(
const std::wstring& room_id, const std::vector<std::wstring>& wxids) { const std::wstring& room_id, const std::vector<std::wstring>& wxids) {
return 0; int64_t success = -1;
uint64_t invite_addr = base_addr_ + offset::kInviteMember;
func::__InviteMemberToChatRoom invite =
(func::__InviteMemberToChatRoom)invite_addr;
const wchar_t* w_room = room_id.c_str();
prototype::WeChatString* chat_room_id = BuildWechatString(room_id);
std::vector<prototype::WeChatString> wxid_list;
wechat::VectorInner* list = (wechat::VectorInner*)&wxid_list;
int64_t head = (int64_t)&list->start;
for (int i = 0; i < wxids.size(); i++) {
prototype::WeChatString id(wxids[i]);
wxid_list.push_back(id);
}
uint64_t temp[2] = {0};
success = invite(reinterpret_cast<uint64_t>(w_room), head,
reinterpret_cast<uint64_t>(chat_room_id),
reinterpret_cast<uint64_t>(&temp));
return success;
} }
TODO("CreateChatRoom")
int64_t wechat::WeChatService::CreateChatRoom( int64_t wechat::WeChatService::CreateChatRoom(
const std::vector<std::wstring>& wxids) { const std::vector<std::wstring>& wxids) {
return 0; int64_t success = -1;
uint64_t get_chat_room_mgr_addr = base_addr_ + offset::kChatRoomMgr;
uint64_t create_chat_room_addr = base_addr_ + offset::kCreateChatRoom;
func::__GetChatRoomMgr get_chat_room_mgr =
(func::__GetChatRoomMgr)get_chat_room_mgr_addr;
func::__CreateChatRoom create_chat_room =
(func::__CreateChatRoom)create_chat_room_addr;
std::vector<prototype::WeChatString> wxid_list;
wechat::VectorInner* list = (wechat::VectorInner*)&wxid_list;
int64_t head = (int64_t)&list->start;
for (int i = 0; i < wxids.size(); i++) {
prototype::WeChatString id(wxids[i]);
wxid_list.push_back(id);
}
int64_t end = list->end;
uint64_t mgr = get_chat_room_mgr();
success = create_chat_room(mgr, head, end);
return success;
} }
TODO("QuitChatRoom")
int64_t wechat::WeChatService::QuitChatRoom(const std::wstring& room_id) { int64_t wechat::WeChatService::QuitChatRoom(const std::wstring& room_id) {
return 0; int64_t success = -1;
uint64_t get_chat_room_mgr_addr = base_addr_ + offset::kChatRoomMgr;
uint64_t quit_chat_room_addr = base_addr_ + offset::kQuitChatRoom;
func::__GetChatRoomMgr get_chat_room_mgr =
(func::__GetChatRoomMgr)get_chat_room_mgr_addr;
func::__QuitChatRoom quit_chat_room =
(func::__QuitChatRoom)quit_chat_room_addr;
uint64_t mgr = get_chat_room_mgr();
prototype::WeChatString chat_room_id(room_id);
success = quit_chat_room(mgr, reinterpret_cast<uint64_t>(&chat_room_id), 0);
return success;
} }
int64_t wechat::WeChatService::ForwardMsg(uint64_t msg_id, int64_t wechat::WeChatService::ForwardMsg(uint64_t msg_id,
@ -553,17 +657,91 @@ int64_t wechat::WeChatService::ForwardMsg(uint64_t msg_id,
return success; return success;
} }
int64_t wechat::WeChatService::GetSNSFirstPage() { return 0; } TODO("GetSNSFirstPage")
int64_t wechat::WeChatService::GetSNSFirstPage() {
int64_t success = -1;
uint64_t sns_data_mgr_addr = base_addr_ + offset::kSNSDataMgr;
uint64_t sns_first_page_addr = base_addr_ + offset::kSNSGetFirstPage;
func::__GetSNSDataMgr sns_data_mgr = (func::__GetSNSDataMgr)sns_data_mgr_addr;
func::__GetSNSFirstPage sns_first_page =
(func::__GetSNSFirstPage)sns_first_page_addr;
uint64_t mgr = sns_data_mgr();
int64_t buff[16] = {0};
success = sns_first_page(mgr, reinterpret_cast<uint64_t>(&buff), 1);
return success;
}
int64_t wechat::WeChatService::GetSNSNextPage(uint64_t sns_id) { return 0; } TODO("GetSNSNextPage")
int64_t wechat::WeChatService::GetSNSNextPage(uint64_t sns_id) {
int64_t success = -1;
uint64_t time_line_mgr_addr = base_addr_ + offset::kSNSTimeLineMgr;
uint64_t sns_next_page_addr = base_addr_ + offset::kSNSGetNextPageScene;
func::__GetSnsTimeLineMgr time_line_mgr =
(func::__GetSnsTimeLineMgr)time_line_mgr_addr;
func::__GetSNSNextPageScene sns_next_page =
(func::__GetSNSNextPageScene)sns_next_page_addr;
uint64_t mgr = time_line_mgr();
success = sns_next_page(mgr, sns_id);
return success;
}
int64_t wechat::WeChatService::AddFavFromMsg(uint64_t msg_id) {
int64_t success = -1;
uint64_t get_chat_mgr_addr = base_addr_ + offset::kGetChatMgr;
uint64_t get_by_local_id_addr = base_addr_ + offset::kGetMgrByPrefixLocalId;
uint64_t add_fav_addr = base_addr_ + offset::kAddFavFromMsg;
uint64_t get_favorite_mgr_addr = base_addr_ + offset::kGetFavoriteMgr;
uint64_t free_chat_msg_addr = base_addr_ + offset::kFreeChatMsg;
func::__GetMgrByPrefixLocalId get_by_local_id =
(func::__GetMgrByPrefixLocalId)get_by_local_id_addr;
uint64_t new_chat_msg_addr = base_addr_ + offset::kChatMsgInstanceCounter;
func::__AddFavFromMsg add_fav = (func::__AddFavFromMsg)add_fav_addr;
func::__GetChatMgr get_chat_mgr = (func::__GetChatMgr)get_chat_mgr_addr;
func::__GetFavoriteMgr get_favorite_mgr =
(func::__GetFavoriteMgr)get_favorite_mgr_addr;
func::__FreeChatMsg free_chat_msg = (func::__FreeChatMsg)free_chat_msg_addr;
func::__NewChatMsg new_chat_msg = (func::__NewChatMsg)new_chat_msg_addr;
int64_t index = 0;
int64_t local_id =
wechat::WeChatDb::GetInstance().GetLocalIdByMsgId(msg_id, index);
if (local_id <= 0 || index >> 32 == 0) {
success = -2;
return success;
}
char chat_msg[0x460] = {0};
LARGE_INTEGER l;
l.HighPart = index >> 32;
l.LowPart = (DWORD)local_id;
uint64_t p_chat_msg = new_chat_msg(reinterpret_cast<uint64_t>(&chat_msg));
get_chat_mgr();
get_by_local_id(l.QuadPart, p_chat_msg);
uint64_t mgr = get_favorite_mgr();
success = add_fav(mgr, p_chat_msg);
free_chat_msg(p_chat_msg);
return success;
}
int64_t wechat::WeChatService::AddFavFromMsg(uint64_t msg_id) { return 0; }
int64_t wechat::WeChatService::AddFavFromImage(const std::wstring& wxid, int64_t wechat::WeChatService::AddFavFromImage(const std::wstring& wxid,
const std::wstring& image_path) { const std::wstring& image_path) {
return 0; int64_t success = -1;
uint64_t get_favorite_mgr_addr = base_addr_ + offset::kGetFavoriteMgr;
uint64_t add_fav_from_image_addr = base_addr_ + offset::kAddFavFromImage;
prototype::WeChatString* send_id = BuildWechatString(wxid);
prototype::WeChatString* path = BuildWechatString(image_path);
func::__GetFavoriteMgr get_favorite_mgr =
(func::__GetFavoriteMgr)get_favorite_mgr_addr;
func::__AddFavFromImage add_fav_from_image =
(func::__AddFavFromImage)add_fav_from_image_addr;
uint64_t mgr = get_favorite_mgr();
success = add_fav_from_image(mgr, reinterpret_cast<uint64_t>(path),
reinterpret_cast<uint64_t>(send_id));
return success;
} }
int64_t wechat::WeChatService::SendAtText( int64_t wechat::WeChatService::SendAtText(
const std::wstring& room_id, const std::vector<std::wstring>& wxids, const std::wstring& room_id, const std::vector<std::wstring>& wxids,
const std::wstring& msg) { const std::wstring& msg) {
@ -578,7 +756,7 @@ int64_t wechat::WeChatService::SendAtText(
if (at_all.compare(wxids[i]) == 0) { if (at_all.compare(wxids[i]) == 0) {
nickname = L"\u6240\u6709\u4eba"; nickname = L"\u6240\u6709\u4eba";
} else { } else {
// nickname = GetContactOrChatRoomNickname(wxids[i]); nickname = GetContactOrChatRoomNickname(wxids[i]);
} }
if (nickname.length() == 0) { if (nickname.length() == 0) {
continue; continue;
@ -612,7 +790,7 @@ int64_t wechat::WeChatService::SendAtText(
free(reinterpret_cast<uint64_t>(&chat_msg)); free(reinterpret_cast<uint64_t>(&chat_msg));
return 0; return 0;
} }
TODO("GetContactOrChatRoomNickname")
std::wstring wechat::WeChatService::GetContactOrChatRoomNickname( std::wstring wechat::WeChatService::GetContactOrChatRoomNickname(
const std::wstring& wxid) { const std::wstring& wxid) {
int64_t success = -1; int64_t success = -1;
@ -641,13 +819,169 @@ std::wstring wechat::WeChatService::GetContactOrChatRoomNickname(
} }
} }
int64_t wechat::WeChatService::GetContactByWxid(const std::wstring& wxid, int64_t wechat::WeChatService::GetContactByWxid(const std::wstring& wxid,
ContactProfileInner& profile) { ContactProfileInner& profile) {
return 0; int64_t success = -1;
prototype::WeChatString to_user(wxid);
uint64_t get_contact_mgr_addr = base_addr_ + offset::kGetContactMgr;
uint64_t new_contact_addr = base_addr_ + offset::kNewContact;
uint64_t get_contact_addr = base_addr_ + offset::kGetContact;
uint64_t free_contact_addr = base_addr_ + offset::kFreeContact;
func::__GetContactMgr get_contact_mgr =
(func::__GetContactMgr)get_contact_mgr_addr;
func::__GetContact get_contact = (func::__GetContact)get_contact_addr;
func::__NewContact new_contact = (func::__NewContact)new_contact_addr;
func::__FreeContact free_contact = (func::__FreeContact)free_contact_addr;
char buff[0x6A9] = {0};
uint64_t contact = new_contact(reinterpret_cast<uint64_t>(&buff));
uint64_t mgr = get_contact_mgr();
success = get_contact(mgr, reinterpret_cast<uint64_t>(&to_user), contact);
profile.wxid = wxutils::ReadWstringThenConvert(contact + 0x10);
profile.account = wxutils::ReadWstringThenConvert(contact + 0x30);
profile.v3 = wxutils::ReadWstringThenConvert(contact + 0x50);
profile.nickname = wxutils::ReadWstringThenConvert(contact + 0xA0);
profile.head_image = wxutils::ReadWstringThenConvert(contact + 0x188);
free_contact(contact);
return success;
} }
int64_t wechat::WeChatService::DoDownloadTask(uint64_t msg_id) { return 0; } TODO("DoDownloadTask")
int64_t wechat::WeChatService::DoDownloadTask(uint64_t msg_id) {
int64_t success = -1;
uint64_t get_by_local_id_addr = base_addr_ + offset::kGetMgrByPrefixLocalId;
func::__GetMgrByPrefixLocalId get_by_local_id =
(func::__GetMgrByPrefixLocalId)get_by_local_id_addr;
uint64_t get_chat_mgr_addr = base_addr_ + offset::kGetChatMgr;
func::__GetChatMgr get_chat_mgr = (func::__GetChatMgr)get_chat_mgr_addr;
uint64_t free_chat_msg_addr = base_addr_ + offset::kFreeChatMsg;
func::__FreeChatMsg free_chat_msg = (func::__FreeChatMsg)free_chat_msg_addr;
uint64_t new_chat_msg_addr = base_addr_ + offset::kChatMsgInstanceCounter;
func::__NewChatMsg new_chat_msg = (func::__NewChatMsg)new_chat_msg_addr;
uint64_t get_current_data_path_addr =
base_addr_ + offset::kGetCurrentDataPath;
func::__GetCurrentDataPath GetCurrentDataPath =
(func::__GetCurrentDataPath)get_current_data_path_addr;
uint64_t new_app_msg_info_addr = base_addr_ + offset::kNewAppMsgInfo;
func::__NewAppMsgInfo new_app_msg_info =
(func::__NewAppMsgInfo)new_app_msg_info_addr;
uint64_t free_app_msg_info_addr = base_addr_ + offset::kFreeAppMsgInfo;
func::__FreeAppMsgInfo free_app_msg_info =
(func::__NewAppMsgInfo)free_app_msg_info_addr;
uint64_t xml_to_app_info_addr = base_addr_ + offset::kParseAppMsgXml;
func::__ParseAppMsgXml xml_to_app_info =
(func::__ParseAppMsgXml)xml_to_app_info_addr;
uint64_t get_pre_download_mgr_addr = base_addr_ + offset::kGetPreDownLoadMgr;
func::__GetPreDownLoadMgr get_pre_download_mgr =
(func::__GetPreDownLoadMgr)get_pre_download_mgr_addr;
uint64_t push_attach_task_addr = base_addr_ + offset::kPushAttachTask;
func::__PushAttachTask push_attach_task =
(func::__PushAttachTask)push_attach_task_addr;
int64_t index = 0;
int64_t local_id =
wechat::WeChatDb::GetInstance().GetLocalIdByMsgId(msg_id, index);
if (local_id <= 0 || index >> 32 == 0) {
success = -2;
return success;
}
char* chat_msg = base::utils::WxHeapAlloc<char>(0x460);
LARGE_INTEGER l;
l.HighPart = index >> 32;
l.LowPart = (DWORD)local_id;
uint64_t p_chat_msg = new_chat_msg(reinterpret_cast<uint64_t>(chat_msg));
get_chat_mgr();
get_by_local_id(l.QuadPart, p_chat_msg);
std::wstring save_path = L"";
std::wstring thumb_path = L"";
prototype::WeChatString current_data_path;
GetCurrentDataPath(reinterpret_cast<ULONG_PTR>(&current_data_path));
if (current_data_path.length > 0) {
save_path += current_data_path.ptr;
save_path += L"wxhelper";
} else {
return -1;
}
if (!wxutils::FindOrCreateDirectory(save_path)) {
return -3;
}
int64_t type = *(int64_t*)(chat_msg + 0x38);
wchar_t* content = *(wchar_t**)(chat_msg + 0x88);
DWORD len = *(DWORD*)(chat_msg + 0x94);
std::wstring tmp_content(content, len);
prototype::WeChatString* we_content = BuildWechatString(tmp_content);
switch (type) {
case 0x3: {
save_path += L"\\image";
if (!wxutils::FindOrCreateDirectory(save_path)) {
return -3;
}
thumb_path = save_path + L"\\" + std::to_wstring(msg_id) + L"_t.dat";
save_path = save_path + L"\\" + std::to_wstring(msg_id) + L".dat";
break;
}
case 0x3E:
case 0x2B: {
save_path += L"\\video";
if (!wxutils::FindOrCreateDirectory(save_path)) {
return -3;
}
thumb_path = save_path + L"\\" + std::to_wstring(msg_id) + L".jpg";
save_path = save_path + L"\\" + std::to_wstring(msg_id) + L".mp4";
break;
}
case 0x31: {
save_path += L"\\file";
if (!wxutils::FindOrCreateDirectory(save_path)) {
return -3;
}
char* p_xml_app_msg = base::utils::WxHeapAlloc<char>(0x3000);
uint64_t xml_msg =
new_app_msg_info(reinterpret_cast<uint64_t>(p_xml_app_msg));
uint64_t result =
xml_to_app_info(xml_msg, reinterpret_cast<uint64_t>(we_content), 1);
if (result != 1) {
return -4;
}
std::wstring file_name = wxutils::ReadWstring(xml_msg + 0x70);
save_path =
save_path + L"\\" + std::to_wstring(msg_id) + L"_" + file_name;
free_app_msg_info(xml_msg);
break;
}
default:
break;
}
prototype::WeChatString* we_save_path = BuildWechatString(save_path);
prototype::WeChatString* we_thumb_path = BuildWechatString(thumb_path);
int temp = 1;
memcpy(chat_msg + 0x280, we_thumb_path, sizeof(prototype::WeChatString));
memcpy(chat_msg + 0x2A0, we_save_path, sizeof(prototype::WeChatString));
memcpy(chat_msg + 0x40C, &temp, sizeof(temp));
UINT64 mgr = get_pre_download_mgr();
success = push_attach_task(mgr, p_chat_msg, 0, 1);
free_chat_msg(p_chat_msg);
return success;
}
TODO("ForwardPublicMsg")
int64_t wechat::WeChatService::ForwardPublicMsg(const std::wstring& wxid, int64_t wechat::WeChatService::ForwardPublicMsg(const std::wstring& wxid,
const std::wstring& title, const std::wstring& title,
const std::wstring& url, const std::wstring& url,
@ -658,33 +992,218 @@ int64_t wechat::WeChatService::ForwardPublicMsg(const std::wstring& wxid,
return 0; return 0;
} }
TODO("ForwardPublicMsgByMsgId")
int64_t wechat::WeChatService::ForwardPublicMsgByMsgId(const std::wstring& wxid, int64_t wechat::WeChatService::ForwardPublicMsgByMsgId(const std::wstring& wxid,
uint64_t msg_id) { uint64_t msg_id) {
return 0; return 0;
} }
TODO("DecodeImage")
int64_t wechat::WeChatService::DecodeImage(const std::wstring& file_path, int64_t wechat::WeChatService::DecodeImage(const std::wstring& file_path,
const std::wstring& save_dir) { const std::wstring& save_dir) {
return 0; if (!wxutils::FindOrCreateDirectory(save_dir)) {
} return 0;
}
int64_t pos_begin = file_path.find_last_of(L"\\") + 1;
int64_t pos_end = file_path.find_last_of(L".");
std::wstring file_name = file_path.substr(pos_begin, pos_end - pos_begin);
HANDLE h_origin_file =
CreateFileW(file_path.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, NULL);
char buffer[BUFSIZE] = {0};
DWORD bytes_read = 0;
DWORD bytes_write = 0;
unsigned char magic_head[4] = {0};
std::wstring suffix;
short key = 0;
if (ReadFile(h_origin_file, buffer, BUFSIZE, &bytes_read, NULL)) {
memcpy(magic_head, buffer, 3);
} else {
CloseHandle(h_origin_file);
return 0;
}
if ((magic_head[0] ^ JPEG0) == (magic_head[1] ^ JPEG1)) {
key = magic_head[0] ^ JPEG0;
suffix = L".jpg";
} else if ((magic_head[0] ^ PNG1) == (magic_head[1] ^ PNG2)) {
key = magic_head[0] ^ PNG1;
suffix = L".png";
} else if ((magic_head[0] ^ GIF0) == (magic_head[1] ^ GIF1)) {
key = magic_head[0] ^ GIF0;
suffix = L".gif";
} else if ((magic_head[0] ^ BMP0) == (magic_head[1] ^ BMP1)) {
key = magic_head[0] ^ BMP0;
suffix = L".bmp";
} else {
key = -1;
suffix = L".dat";
}
std::wstring save_img_path = save_dir + L"\\" + file_name + suffix;
HANDLE save_img = CreateFileW(save_img_path.c_str(), GENERIC_ALL, 0, NULL,
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (save_img == INVALID_HANDLE_VALUE) {
return 0;
}
if (key > 0) {
for (unsigned int i = 0; i < bytes_read; i++) {
buffer[i] ^= key;
}
}
if (!WriteFile(save_img, (LPCVOID)buffer, bytes_read, &bytes_write, 0)) {
CloseHandle(h_origin_file);
CloseHandle(save_img);
return 0;
}
do {
if (ReadFile(h_origin_file, buffer, BUFSIZE, &bytes_read, NULL)) {
if (key > 0) {
for (unsigned int i = 0; i < bytes_read; i++) {
buffer[i] ^= key;
}
}
if (!WriteFile(save_img, (LPCVOID)buffer, bytes_read, &bytes_write, 0)) {
CloseHandle(h_origin_file);
CloseHandle(save_img);
return 0;
}
}
} while (bytes_read == BUFSIZE);
CloseHandle(h_origin_file);
CloseHandle(save_img);
return 1;
}
TODO("GetVoiceByDB")
int64_t wechat::WeChatService::GetVoiceByDB(ULONG64 msg_id, int64_t wechat::WeChatService::GetVoiceByDB(ULONG64 msg_id,
const std::wstring& dir) { const std::wstring& dir) {
return 0; return 0;
} }
TODO("SendCustomEmotion")
int64_t wechat::WeChatService::SendCustomEmotion(const std::wstring& file_path, int64_t wechat::WeChatService::SendCustomEmotion(const std::wstring& file_path,
const std::wstring& wxid) { const std::wstring& wxid) {
return 0; int64_t success = -1;
uint64_t get_custom_smiley_mgr_addr =
base_addr_ + offset::kGetCustomSmileyMgr;
func::__GetCustomSmileyMgr get_custom_smiley_mgr =
(func::__GetCustomSmileyMgr)get_custom_smiley_mgr_addr;
uint64_t send_custom_emotion_addr = base_addr_ + offset::kSendCustomEmotion;
func::__SendCustomEmotion send_custom_emotion =
(func::__SendCustomEmotion)send_custom_emotion_addr;
prototype::WeChatString* path = BuildWechatString(file_path);
prototype::WeChatString* recv = BuildWechatString(wxid);
int64_t* temp = base::utils::WxHeapAlloc<int64_t>(0x20);
memset(temp, 0, 0x20);
uint64_t mgr = get_custom_smiley_mgr();
success = send_custom_emotion(
mgr, reinterpret_cast<uint64_t>(path), reinterpret_cast<uint64_t>(temp),
reinterpret_cast<uint64_t>(recv), 2, reinterpret_cast<uint64_t>(temp), 0,
reinterpret_cast<uint64_t>(temp));
return success;
} }
TODO("SendApplet")
int64_t wechat::WeChatService::SendApplet( int64_t wechat::WeChatService::SendApplet(
const std::wstring& recv_wxid, const std::wstring& waid_suff, const std::wstring& recv_wxid, const std::wstring& waid_suff,
const std::wstring& waid_w, const std::string& waid_s, const std::wstring& waid_w, const std::wstring& waid_s,
const std::string& wa_wxid, const std::string& json_param, const std::wstring& wa_wxid, const std::wstring& json_param,
const std::string& head_image, const std::string& big_image, const std::wstring& head_image, const std::wstring& big_image,
const std::string& index_page) { const std::wstring& index_page) {
return 0; int64_t success = -1;
if (js_api_addr_ == 0) {
auto vec2 =
base::memory::ScanAndMatchValue(base_addr_ + 0x32D1318, 0x1000, 0x8);
for (int i = 0; i < vec2.size(); i++) {
int64_t ptr = vec2.at(i);
if (*(int64_t*)ptr == base_addr_ + 0x32D1318) {
js_api_addr_ = ptr;
break;
}
}
}
if (js_api_addr_ == 0) {
success = -2;
return success;
}
uint64_t share_app_msg_addr = base_addr_ + offset::kNewJsApiShareAppMessage;
func::__JsApiShareAppMessage share_app_msg =
(func::__JsApiShareAppMessage)share_app_msg_addr;
uint64_t init_addr = base_addr_ + offset::kInitJsConfig;
func::__InitJsConfig init = (func::__InitJsConfig)init_addr;
uint64_t send_applet_addr = base_addr_ + offset::kSendApplet;
func::__SendApplet send_applet = (func::__SendApplet)send_applet_addr;
uint64_t get_by_waid_addr = base_addr_ + offset::kGetAppInfoByWaid;
func::__GetAppInfoByWaid get_app_info =
(func::__GetAppInfoByWaid)get_by_waid_addr;
uint64_t copy_app_req_addr = base_addr_ + offset::kCopyShareAppMessageRequest;
func::__CopyShareAppMessageRequest copy_app_req =
(func::__CopyShareAppMessageRequest)copy_app_req_addr;
uint64_t new_wa_msg_addr = base_addr_ + offset::kNewWAUpdatableMsgInfo;
func::__NewWAUpdatableMsgInfo new_wa_msg =
(func::__NewWAUpdatableMsgInfo)new_wa_msg_addr;
uint64_t free_wa_msg_addr = base_addr_ + offset::kFreeWAUpdatableMsgInfo;
func::__FreeWAUpdatableMsgInfo free_wa_msg =
(func::__FreeWAUpdatableMsgInfo)free_wa_msg_addr;
std::vector<prototype::WeChatString>* temp =
base::utils::WxHeapAlloc<std::vector<prototype::WeChatString>>(0x20);
// std::vector<prototype::WeChatString>* temp = new
// std::vector<prototype::WeChatString>();
wechat::VectorInner* list = (wechat::VectorInner*)temp;
prototype::WeChatString* member = BuildWechatString(recv_wxid);
#ifdef _DEBUG
list->head = reinterpret_cast<uint64_t>(member);
#endif
list->start = reinterpret_cast<uint64_t>(member);
list->finsh = reinterpret_cast<uint64_t>(member) + 0x20;
list->end = reinterpret_cast<uint64_t>(member) + 0x20;
uint64_t head = reinterpret_cast<uint64_t>(&(list->start));
prototype::WeChatString* waid_cat = BuildWechatString(waid_suff);
prototype::WeChatString* waid = BuildWechatString(waid_w);
prototype::WeChatString* waid_2 = BuildWechatString(waid_suff);
prototype::WeChatString* waid_str = BuildWechatString(waid_s);
prototype::WeChatString* app_wxid = BuildWechatString(wa_wxid);
prototype::WeChatString* json_str = BuildWechatString(json_param);
prototype::WeChatString* head_image_url = BuildWechatString(head_image);
prototype::WeChatString* image = BuildWechatString(big_image);
prototype::WeChatString* index = BuildWechatString(index_page);
uint64_t app_msg = js_api_addr_;
uint64_t data = *(uint64_t*)(app_msg + 0x8);
char* share_req = base::utils::WxHeapAlloc<char>(0x2000);
char* mid_ptr = base::utils::WxHeapAlloc<char>(0x18);
memcpy(mid_ptr, &share_req, sizeof(INT64));
memcpy(mid_ptr + 0x8, &share_req, sizeof(INT64));
memcpy(mid_ptr + 0x10, &share_req, sizeof(INT64));
memcpy((void*)data, mid_ptr, 0x18);
memcpy(share_req, (void*)(app_msg + 0x8), sizeof(uint64_t));
memcpy(share_req + 0x8, (void*)(app_msg + 0x8), sizeof(uint64_t));
memcpy(share_req + 0x10, (void*)(app_msg + 0x8), sizeof(uint64_t));
memcpy(share_req + 0x20, waid_2, sizeof(prototype::WeChatString));
memcpy(share_req + 0x48, waid_str, sizeof(prototype::WeChatStr));
memcpy(share_req + 0x98, app_wxid, sizeof(prototype::WeChatStr));
memcpy(share_req + 0xF8, json_str, sizeof(prototype::WeChatStr));
memcpy(share_req + 0x178, head_image_url, sizeof(prototype::WeChatStr));
memcpy(share_req + 0x198, image, sizeof(prototype::WeChatStr));
memcpy(share_req + 0x1c0, index, sizeof(prototype::WeChatStr));
success = send_applet(app_msg, reinterpret_cast<uint64_t>(waid_cat), head, 0);
return success;
} }
int64_t wechat::WeChatService::SendPatMsg(const std::wstring& room_id, int64_t wechat::WeChatService::SendPatMsg(const std::wstring& room_id,
@ -699,9 +1218,40 @@ int64_t wechat::WeChatService::SendPatMsg(const std::wstring& room_id,
return success; return success;
} }
TODO("DoOCRTask")
int64_t wechat::WeChatService::DoOCRTask(const std::wstring& img_path, int64_t wechat::WeChatService::DoOCRTask(const std::wstring& img_path,
std::string& result) { std::string& result) {
return 0; int64_t success = -1;
uint64_t ocr_manager_addr = base_addr_ + offset::kGetOCRManager;
func::__GetOCRManager ocr_manager = (func::__GetOCRManager)ocr_manager_addr;
uint64_t do_ocr_task_addr = base_addr_ + offset::kDoOCRTask;
func::__DoOCRTask do_ocr_task = (func::__DoOCRTask)do_ocr_task_addr;
prototype::WeChatString img(img_path);
std::vector<INT64>* temp =
base::utils::WxHeapAlloc<std::vector<int64_t>>(0x20);
int64_t unkonwn = 0;
wechat::VectorInner* list = (wechat::VectorInner*)temp;
list->start = reinterpret_cast<INT64>(&list->start);
list->finsh = list->start;
char buff[0x28] = {0};
memcpy(buff, &list->start, sizeof(INT64));
uint64_t mgr = ocr_manager();
success = do_ocr_task(mgr, reinterpret_cast<uint64_t>(&img), 1,
reinterpret_cast<uint64_t>(buff),
reinterpret_cast<uint64_t>(&unkonwn));
int64_t number = *(int64_t*)(buff + 0x8);
if (number > 0) {
int64_t header = *(int64_t*)(buff);
for (unsigned int i = 0; i < number; i++) {
int64_t content = *(int64_t*)header;
result += wxutils::ReadWstringThenConvert(content + 0x28);
result += "\r\n";
header = content;
}
}
return success;
} }
int64_t wechat::WeChatService::LockWeChat() { int64_t wechat::WeChatService::LockWeChat() {
@ -736,11 +1286,10 @@ int64_t wechat::WeChatService::EnterWeChat() {
int64_t base_addr = wxutils::GetWeChatWinBase(); int64_t base_addr = wxutils::GetWeChatWinBase();
uint64_t click_cb_addr = base_addr + offset::kOnLoginBtnClick; uint64_t click_cb_addr = base_addr + offset::kOnLoginBtnClick;
func::__OnLoginBtnClick cb = (func::__OnLoginBtnClick)click_cb_addr; func::__OnLoginBtnClick cb = (func::__OnLoginBtnClick)click_cb_addr;
auto vec = auto vec = base::memory::ScanAndMatchValue(base_addr + 0x4ecedf8, 0x1000, 0x8);
base::memory::ScanAndMatchValue(base_addr + 0x34e0c18, 0x1000, 0x8);
for (int i = 0; i < vec.size(); i++) { for (int i = 0; i < vec.size(); i++) {
int64_t ptr = vec.at(i); int64_t ptr = vec.at(i);
if (*(int64_t*)ptr == base_addr + 0x34e0c18) { if (*(int64_t*)ptr == base_addr + 0x4ecedf8) {
int64_t login_wnd = ptr; int64_t login_wnd = ptr;
success = cb(ptr); success = cb(ptr);
break; break;
@ -749,6 +1298,7 @@ int64_t wechat::WeChatService::EnterWeChat() {
return success; return success;
} }
TODO("SendMultiAtText")
int64_t wechat::WeChatService::SendMultiAtText( int64_t wechat::WeChatService::SendMultiAtText(
const std::wstring& room_id, const std::wstring& room_id,
const std::vector<std::pair<std::wstring, std::wstring>>& at) { const std::vector<std::pair<std::wstring, std::wstring>>& at) {
@ -805,10 +1355,15 @@ std::string wechat::WeChatService::GetLoginUrl() {
return "http://weixin.qq.com/x/" + login_url; return "http://weixin.qq.com/x/" + login_url;
} }
void wechat::WeChatService::SetBaseAddr(uint64_t addr) {} void wechat::WeChatService::SetBaseAddr(uint64_t addr) {
this->base_addr_ = addr;
}
void wechat::WeChatService::SetJsApiAddr(uint64_t addr) {} void wechat::WeChatService::SetJsApiAddr(uint64_t addr) {
this->js_api_addr_ = addr;
}
TODO("TranslateVoice")
int64_t wechat::WeChatService::TranslateVoice(uint64_t msg_id) { int64_t wechat::WeChatService::TranslateVoice(uint64_t msg_id) {
int64_t success = -1; int64_t success = -1;
uint64_t get_by_local_id_addr = base_addr_ + offset::kGetMgrByPrefixLocalId; uint64_t get_by_local_id_addr = base_addr_ + offset::kGetMgrByPrefixLocalId;
@ -865,13 +1420,13 @@ int64_t wechat::WeChatService::TranslateVoice(uint64_t msg_id) {
return success; return success;
} }
TODO("GetTranslateVoiceText")
std::string wechat::WeChatService::GetTranslateVoiceText(uint64_t msg_id) { std::string wechat::WeChatService::GetTranslateVoiceText(uint64_t msg_id) {
std::string content = std::string content =
wechat::WeChatDb::GetInstance().GetChatMsgStrContentByMsgId(msg_id); wechat::WeChatDb::GetInstance().GetChatMsgStrContentByMsgId(msg_id);
if (content.empty()) { if (content.empty()) {
return {}; return {};
} }
tinyxml2::XMLDocument doc; tinyxml2::XMLDocument doc;
if (doc.Parse(content.c_str(), content.size()) != 0) { if (doc.Parse(content.c_str(), content.size()) != 0) {
SPDLOG_INFO("tinyxml2 parse error"); SPDLOG_INFO("tinyxml2 parse error");
@ -888,6 +1443,7 @@ std::string wechat::WeChatService::GetTranslateVoiceText(uint64_t msg_id) {
return ""; return "";
} }
TODO("OpenUrlByWeChatBrowser")
int64_t wechat::WeChatService::OpenUrlByWeChatBrowser(const std::wstring& url, int64_t wechat::WeChatService::OpenUrlByWeChatBrowser(const std::wstring& url,
int flag) { int flag) {
int64_t success = -1; int64_t success = -1;
@ -922,3 +1478,114 @@ int64_t wechat::WeChatService::OpenUrlByWeChatBrowser(const std::wstring& url,
free_config(ptr); free_config(ptr);
return success; return success;
} }
TODO("GetChatRoomMemberNickname")
std::wstring wechat::WeChatService::GetChatRoomMemberNickname(
const std::wstring& room_id, const std::wstring& member_id) {
return std::wstring();
}
TODO("DelContact")
int64_t wechat::WeChatService::DelContact(const std::wstring& wxid) {
int64_t success = -1;
uint64_t del_contcat_addr = base_addr_ + offset::kDoDelContact;
func::__DelContact del_contcat = (func::__DelContact)del_contcat_addr;
return success;
}
TODO("SearchContact")
int64_t wechat::WeChatService::SearchContact(
const std::wstring& keyword, wechat::SearchContactInner& contact) {
int64_t success = -1;
prototype::WeChatString key(keyword);
uint64_t search_mgr_addr = base_addr_ + offset::kGetSearchContactMgr;
uint64_t search_addr = base_addr_ + offset::kStartSearch;
func::__GetSearchContactMgr get_mgr =
(func::__GetSearchContactMgr)search_mgr_addr;
func::__StartSearch search = (func::__StartSearch)search_addr;
uint64_t mgr = get_mgr();
// success = search(mgr,&key);
return success;
}
TODO("AddFriendByWxid")
int64_t wechat::WeChatService::AddFriendByWxid(const std::wstring& wxid,
const std::wstring& msg) {
uint64_t add_friend_addr = base_addr_ + offset::kAddFriend;
func::__AddFriend add_friend = (func::__AddFriend)add_friend_addr;
return 0;
}
TODO("VerifyApply")
int64_t wechat::WeChatService::VerifyApply(const std::wstring& v3,
const std::wstring& v4,
int32_t permission) {
uint64_t verify_addr = base_addr_ + offset::kVerifyApply;
func::__Verify add_friend = (func::__Verify)verify_addr;
return 0;
}
TODO("DoConfirmReceipt")
int64_t wechat::WeChatService::DoConfirmReceipt(
const std::wstring& wxid, const std::wstring& transcationid,
const std::wstring& transferid) {
int success = -1;
prototype::WeChatString recv_id(wxid);
prototype::WeChatString transcation_id(transcationid);
prototype::WeChatString transfer_id(transferid);
char pay_info[0x224] = {0};
uint64_t new_pay_info_addr = base_addr_ + offset::kNewPayInfo;
uint64_t free_pay_info_addr = base_addr_ + offset::kFreePayInfo;
uint64_t do_confirm_addr = base_addr_ + offset::kTransferConfirm;
func::__NewWCPayInfo new_pay_info = (func::__NewWCPayInfo)new_pay_info_addr;
func::__FreeWCPayInfo free_pay_info =
(func::__FreeWCPayInfo)free_pay_info_addr;
func::__PayTransferConfirm do_confirm =
(func::__PayTransferConfirm)do_confirm_addr;
new_pay_info(reinterpret_cast<uint64_t>(&pay_info));
memcpy(&pay_info[0x30], &transcation_id, sizeof(transcation_id));
memcpy(&pay_info[0x58], &transfer_id, sizeof(transfer_id));
// memcpy(&pay_info[0xA0], &recv_id, sizeof(recv_id));
success = do_confirm(reinterpret_cast<uint64_t>(&pay_info), reinterpret_cast<uint64_t>(&recv_id));
free_pay_info(reinterpret_cast<uint64_t>(&pay_info));
return success;
}
TODO("DoRefuseReceipt")
int64_t wechat::WeChatService::DoRefuseReceipt(
const std::wstring& wxid, const std::wstring& transcationid,
const std::wstring& transferid) {
int success = -1;
prototype::WeChatString recv_id(wxid);
prototype::WeChatString transcation_id(transcationid);
prototype::WeChatString transfer_id(transferid);
char pay_info[0x224] = {0};
uint64_t new_pay_info_addr = base_addr_ + offset::kNewPayInfo;
uint64_t free_pay_info_addr = base_addr_ + offset::kFreePayInfo;
uint64_t do_refuse_addr = base_addr_ + offset::kTransferRefuse;
func::__NewWCPayInfo new_pay_info = (func::__NewWCPayInfo)new_pay_info_addr;
func::__FreeWCPayInfo free_pay_info =
(func::__FreeWCPayInfo)free_pay_info_addr;
func::__PayTransferRefuse do_refuse =
(func::__PayTransferRefuse)do_refuse_addr;
new_pay_info(reinterpret_cast<uint64_t>(&pay_info));
memcpy(&pay_info[0x30], &transcation_id, sizeof(transcation_id));
memcpy(&pay_info[0x58], &transfer_id, sizeof(transfer_id));
// memcpy(&pay_info[0xA0], &recv_id, sizeof(recv_id));
success = do_refuse(reinterpret_cast<uint64_t>(&pay_info), reinterpret_cast<uint64_t>(&recv_id));
free_pay_info(reinterpret_cast<uint64_t>(&pay_info));
return success;
}

View File

@ -105,6 +105,20 @@ int DecodeImage(const wchar_t *file_path, const wchar_t *save_dir) {
return -1; return -1;
} }
bool FindOrCreateDirectory(const std::wstring &path) {
WIN32_FIND_DATAW fd;
HANDLE found = ::FindFirstFileW(path.c_str(), &fd);
if (found != INVALID_HANDLE_VALUE &&
(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
FindClose(found);
return true;
}
if (!::CreateDirectoryW(path.c_str(), NULL)) {
return false;
}
return true;
}
} // namespace wxutils } // namespace wxutils
} // namespace wxhelper } // namespace wxhelper

BIN
wxhelper.rc Normal file

Binary file not shown.

View File

@ -1,22 +1,25 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17 # Visual Studio Version 17
VisualStudioVersion = 17.10.34928.147 VisualStudioVersion = 17.9.34723.18
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxhelper", "wxhelper.vcxproj", "{D245A0CA-D4E8-3ECD-9DEB-C610DD36E27D}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxhelper", "wxhelper.vcxproj", "{40818871-0BD0-4363-B5C3-198F3CEF6CC0}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64 Debug|x64 = Debug|x64
Release|x64 = Release|x64
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D245A0CA-D4E8-3ECD-9DEB-C610DD36E27D}.Debug|x64.ActiveCfg = Debug|x64 {40818871-0BD0-4363-B5C3-198F3CEF6CC0}.Debug|x64.ActiveCfg = Debug|x64
{D245A0CA-D4E8-3ECD-9DEB-C610DD36E27D}.Debug|x64.Build.0 = Debug|x64 {40818871-0BD0-4363-B5C3-198F3CEF6CC0}.Debug|x64.Build.0 = Debug|x64
{40818871-0BD0-4363-B5C3-198F3CEF6CC0}.Release|x64.ActiveCfg = Release|x64
{40818871-0BD0-4363-B5C3-198F3CEF6CC0}.Release|x64.Build.0 = Release|x64
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8C0C4913-BC48-3A32-B80B-ADD14470CB5C} SolutionGuid = {6E2841B9-FB48-4FB4-80D0-6970D17FB19C}
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View File

@ -1,13 +1,14 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="17.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations"> <ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64"> <ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="src\chat_controller.cc" /> <ClCompile Include="src\chat_controller.cc" />
@ -25,6 +26,8 @@
<ClCompile Include="src\json_utils.cc" /> <ClCompile Include="src\json_utils.cc" />
<ClCompile Include="src\misc_controller.cc" /> <ClCompile Include="src\misc_controller.cc" />
<ClCompile Include="src\sync_msg_hook.cc" /> <ClCompile Include="src\sync_msg_hook.cc" />
<ClCompile Include="src\thread_pool.cc" />
<ClCompile Include="src\utils.cc" />
<ClCompile Include="src\wechat_db.cc" /> <ClCompile Include="src\wechat_db.cc" />
<ClCompile Include="src\wechat_service.cc" /> <ClCompile Include="src\wechat_service.cc" />
<ClCompile Include="src\wxhelper.cc" /> <ClCompile Include="src\wxhelper.cc" />
@ -32,6 +35,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="inc\base64.h" /> <ClInclude Include="inc\base64.h" />
<ClInclude Include="inc\base\inc\win_header.h" />
<ClInclude Include="inc\base_config.h" /> <ClInclude Include="inc\base_config.h" />
<ClInclude Include="inc\chat_controller.h" /> <ClInclude Include="inc\chat_controller.h" />
<ClInclude Include="inc\chat_room_controller.h" /> <ClInclude Include="inc\chat_room_controller.h" />
@ -64,76 +68,105 @@
<ClInclude Include="inc\win_header.h" /> <ClInclude Include="inc\win_header.h" />
<ClInclude Include="inc\wxhelper.h" /> <ClInclude Include="inc\wxhelper.h" />
<ClInclude Include="inc\wxutils.h" /> <ClInclude Include="inc\wxutils.h" />
<ClInclude Include="resource.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="wxhelper.rc" />
</ItemGroup> </ItemGroup>
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<ProjectGuid>{D245A0CA-D4E8-3ECD-9DEB-C610DD36E27D}</ProjectGuid> <VCProjectVersion>17.0</VCProjectVersion>
<ProjectName>wxhelper</ProjectName>
<ProjectGuid>{40818871-0BD0-4363-B5C3-198F3CEF6CC0}</ProjectGuid>
<RootNamespace>wxhelper</RootNamespace>
<Keyword>Win32Proj</Keyword> <Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>10.0.22621.0</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>10.0.22621.0</WindowsTargetPlatformVersion>
<Platform>x64</Platform>
<ProjectName>wxhelper</ProjectName>
<VCProjectUpgraderObjectName>NoUpgrade</VCProjectUpgraderObjectName>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>false</WholeProgramOptimization>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings"> <ImportGroup Label="ExtensionSettings">
</ImportGroup> </ImportGroup>
<ImportGroup Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<PropertyGroup Label="UserMacros" /> <PropertyGroup Label="UserMacros" />
<PropertyGroup> <PropertyGroup>
<_ProjectFileVersion>10.0.20506.1</_ProjectFileVersion> <_ProjectFileVersion>17.0.34714.143</_ProjectFileVersion>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">wxhelper</TargetName>
<TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.dll</TargetExt>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</GenerateManifest>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LibraryPath>$(ProjectDir)\lib;$(LibraryPath)</LibraryPath> <OutDir>$(SolutionDir)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental>
<ExternalIncludePath>$(ProjectDir)\inc;$(ExternalIncludePath)</ExternalIncludePath>
<LibraryPath>$(ProjectDir)\lib\debug;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental>
<IncludePath>$(ProjectDir)\inc;$(IncludePath)</IncludePath> <IncludePath>$(ProjectDir)\inc;$(IncludePath)</IncludePath>
<LibraryPath>$(ProjectDir)\lib\release;$(LibraryPath)</LibraryPath>
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile> <ClCompile>
<AssemblerListingLocation>$(IntDir)</AssemblerListingLocation> <PreprocessorDefinitions>WECHAT_VERSION=391125;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> <MinimalRebuild>false</MinimalRebuild>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <BasicRuntimeChecks>Default</BasicRuntimeChecks>
<ExceptionHandling>Sync</ExceptionHandling>
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
<Optimization>Disabled</Optimization>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<UseFullPaths>false</UseFullPaths> <PrecompiledHeader>
<PreprocessorDefinitions>%(PreprocessorDefinitions);WIN32;_WINDOWS;WECHAT_VERSION=391019;SPDLOG_COMPILED_LIB;CMAKE_INTDIR="Debug";wxhelper_EXPORTS</PreprocessorDefinitions> </PrecompiledHeader>
<ObjectFileName>$(IntDir)</ObjectFileName> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
<LanguageStandard>Default</LanguageStandard> <LanguageStandard>Default</LanguageStandard>
</ClCompile> </ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>%(PreprocessorDefinitions);WIN32;_DEBUG;_WINDOWS;WECHAT_VERSION=391019;SPDLOG_COMPILED_LIB;CMAKE_INTDIR=\"Debug\";wxhelper_EXPORTS</PreprocessorDefinitions>
<AdditionalIncludeDirectories>\x64-windows\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Midl>
<AdditionalIncludeDirectories>\x64-windows\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<OutputDirectory>$(ProjectDir)/$(IntDir)</OutputDirectory>
<HeaderFileName>%(Filename).h</HeaderFileName>
<TypeLibraryName>%(Filename).tlb</TypeLibraryName>
<InterfaceIdentifierFileName>%(Filename)_i.c</InterfaceIdentifierFileName>
<ProxyFileName>%(Filename)_p.c</ProxyFileName>
</Midl>
<Link> <Link>
<AdditionalDependencies>base.lib;base64.lib;detours.lib;lz4.lib;mongoose.lib;spdlogd.lib;tinyxml2.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib</AdditionalDependencies>
<AdditionalOptions>%(AdditionalOptions) /machine:x64</AdditionalOptions>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
<TargetMachine>MachineX64</TargetMachine>
<AdditionalDependencies>base.lib;base64.lib;detours.lib;lz4.lib;mongoose.lib;spdlog.lib;tinyxml2.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WECHAT_VERSION=391125;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX64</TargetMachine>
<AdditionalDependencies>base.lib;base64.lib;detours.lib;lz4.lib;mongoose.lib;spdlog.lib;tinyxml2.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
</Link> </Link>
<ProjectReference>
<LinkLibraryDependencies>false</LinkLibraryDependencies>
</ProjectReference>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">

194
wxhelper.vcxproj.filters Normal file
View File

@ -0,0 +1,194 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<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</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\hook_controller.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\http_client.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\http_router.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\http_server.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\json_utils.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\misc_controller.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\sync_msg_hook.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\thread_pool.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\utils.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\wechat_db.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\wechat_service.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\wxhelper.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\wxutils.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\chat_controller.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\chat_room_controller.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\client_socket.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\config.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\contacts_controller.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\db_controller.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\dllMain.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\hook.cc">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="resource.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\base64.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\chat_controller.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\chat_room_controller.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\client_socket.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\config.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\contacts_controller.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\db_controller.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\detours.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\hook.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\hook_controller.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\http_client.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\http_controller.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\http_router.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\http_server.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\json_utils.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\misc_controller.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\mongoose.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\noncopyable.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\offset.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\singleton.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\sqlite_function.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\sync_msg_hook.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\thread_pool.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\tinyxml2.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\utils.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\wechat_db.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\wechat_interface.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\wechat_service.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\win_header.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\wxhelper.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\wxutils.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\base\inc\win_header.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\base_config.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\memory.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="wxhelper.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>