mirror of
https://github.com/ttttupup/wxhelper.git
synced 2025-02-22 16:14:56 +08:00
3.9.2.26部分功能
This commit is contained in:
parent
0b52a49155
commit
dccc997067
@ -3,10 +3,14 @@
|
||||
0.检查是否登录
|
||||
1.获取登录微信信息
|
||||
2.发送文本
|
||||
3.发送@文本
|
||||
5.发送图片
|
||||
6.发送文件
|
||||
9.hook消息
|
||||
10.取消hook消息
|
||||
19.通过手机或qq查找微信
|
||||
20.通过wxid添加好友
|
||||
23.通过好友申请
|
||||
25.获取群成员
|
||||
26.获取群成员昵称
|
||||
27.删除群成员
|
||||
@ -14,3 +18,6 @@
|
||||
31.修改群昵称
|
||||
32.获取数据库句柄
|
||||
34.查询数据库
|
||||
40.转发消息
|
||||
44.退出登录
|
||||
55.获取联系人或者群名称
|
@ -126,7 +126,7 @@ int ContactMgr::AddFriendByWxid(wchar_t *wxid,wchar_t* msg) {
|
||||
DWORD verify_msg_addr = base_addr_ + WX_VERIFY_MSG_OFFSET;
|
||||
DWORD set_value_addr = base_addr_ + WX_INIT_CHAT_MSG_OFFSET;
|
||||
DWORD do_verify_user_addr = base_addr_ + WX_DO_VERIFY_USER_OFFSET;
|
||||
DWORD fn1_addr = base_addr_ + 0x758720;
|
||||
DWORD fn1_addr = base_addr_ + 0x7591b0;
|
||||
WeChatString user_id(wxid);
|
||||
WeChatString w_msg(msg);
|
||||
DWORD instance =0;
|
||||
|
@ -490,7 +490,7 @@ unsigned int DB::GetLocalIdByMsgId(ULONG64 msgid, int &dbIndex) {
|
||||
swprintf_s(dbname, L"MSG%d.db", i);
|
||||
DWORD handle = GetDbHandleByDbName(dbname);
|
||||
if (handle == 0) {
|
||||
// LOG(INFO) << "MSG db handle is null";
|
||||
SPDLOG_INFO("MSG db handle is null");
|
||||
return 0;
|
||||
}
|
||||
vector<vector<string>> result;
|
||||
|
85
src/hooks.cc
85
src/hooks.cc
@ -393,7 +393,7 @@ int UnHookLog() {
|
||||
void SetErrorCode(int code) { userinfo.error_code = code; }
|
||||
|
||||
void SetUserInfoDetail(DWORD address) {
|
||||
// LOG(INFO) << "hook userinfo addr" <<&userinfo;
|
||||
SPDLOG_INFO("hook userinfo addr = {}",address);
|
||||
DWORD length = *(DWORD *)(address + 0x8);
|
||||
userinfo.keyword = new wchar_t[length + 1];
|
||||
userinfo.keyword_len = length;
|
||||
@ -424,6 +424,36 @@ void SetUserInfoDetail(DWORD address) {
|
||||
ZeroMemory(userinfo.big_image, (length + 1) * sizeof(wchar_t));
|
||||
}
|
||||
|
||||
length = *(DWORD *)(address + 0x6C);
|
||||
userinfo.V3 = new wchar_t[length + 1];
|
||||
userinfo.V3_len = length;
|
||||
if (length) {
|
||||
memcpy(userinfo.V3, (wchar_t *)(*(DWORD *)(address + 0x68)),
|
||||
(length + 1) * sizeof(wchar_t));
|
||||
} else {
|
||||
ZeroMemory(userinfo.V3, (length + 1) * sizeof(wchar_t));
|
||||
}
|
||||
|
||||
length = *(DWORD *)(address + 0x80);
|
||||
userinfo.account = new wchar_t[length + 1];
|
||||
userinfo.account_len = length;
|
||||
if (length) {
|
||||
memcpy(userinfo.account, (wchar_t *)(*(DWORD *)(address + 0x7C)),
|
||||
(length + 1) * sizeof(wchar_t));
|
||||
} else {
|
||||
ZeroMemory(userinfo.account, (length + 1) * sizeof(wchar_t));
|
||||
}
|
||||
|
||||
// length = *(DWORD *)(address + 0x94);
|
||||
// userinfo.friend_name = new wchar_t[length + 1];
|
||||
// userinfo.friend_name_len = length;
|
||||
// if (length) {
|
||||
// memcpy(userinfo.friend_name, (wchar_t *)(*(DWORD *)(address + 0x90)),
|
||||
// (length + 1) * sizeof(wchar_t));
|
||||
// } else {
|
||||
// ZeroMemory(userinfo.friend_name, (length + 1) * sizeof(wchar_t));
|
||||
// }
|
||||
|
||||
length = *(DWORD *)(address + 0xC8);
|
||||
userinfo.nickname = new wchar_t[length + 1];
|
||||
userinfo.nickname_len = length;
|
||||
@ -434,15 +464,28 @@ void SetUserInfoDetail(DWORD address) {
|
||||
ZeroMemory(userinfo.nickname, (length + 1) * sizeof(wchar_t));
|
||||
}
|
||||
|
||||
length = *(DWORD *)(address + 0x108);
|
||||
userinfo.v2 = new wchar_t[length + 1];
|
||||
userinfo.v2_len = length;
|
||||
if (length) {
|
||||
memcpy(userinfo.v2, (wchar_t *)(*(DWORD *)(address + 0x104)),
|
||||
(length + 1) * sizeof(wchar_t));
|
||||
} else {
|
||||
ZeroMemory(userinfo.v2, (length + 1) * sizeof(wchar_t));
|
||||
}
|
||||
// the results of calling and UI operations are different
|
||||
//
|
||||
// length = *(DWORD *)(address + 0x108);
|
||||
// userinfo.v2 = new wchar_t[length + 1];
|
||||
// userinfo.v2_len = length;
|
||||
// if (length) {
|
||||
// memcpy(userinfo.v2, (wchar_t *)(*(DWORD *)(address + 0x104)),
|
||||
// (length + 1) * sizeof(wchar_t));
|
||||
// } else {
|
||||
// ZeroMemory(userinfo.v2, (length + 1) * sizeof(wchar_t));
|
||||
// }
|
||||
|
||||
// length = *(DWORD *)(address + 0x11C);
|
||||
// userinfo.py = new wchar_t[length + 1];
|
||||
// userinfo.py_len = length;
|
||||
// if (length) {
|
||||
// memcpy(userinfo.py, (wchar_t *)(*(DWORD *)(address + 0x118)),
|
||||
// (length + 1) * sizeof(wchar_t));
|
||||
// } else {
|
||||
// ZeroMemory(userinfo.py, (length + 1) * sizeof(wchar_t));
|
||||
// }
|
||||
|
||||
|
||||
length = *(DWORD *)(address + 0x16C);
|
||||
userinfo.small_image = new wchar_t[length + 1];
|
||||
@ -508,9 +551,21 @@ void DeleteUserInfoCache() {
|
||||
if (userinfo.v3) {
|
||||
delete userinfo.v3;
|
||||
}
|
||||
if (userinfo.V3) {
|
||||
delete userinfo.V3;
|
||||
}
|
||||
if (userinfo.account) {
|
||||
delete userinfo.account;
|
||||
}
|
||||
if (userinfo.friend_name) {
|
||||
delete userinfo.friend_name;
|
||||
}
|
||||
if (userinfo.nickname) {
|
||||
delete userinfo.nickname;
|
||||
}
|
||||
if (userinfo.py) {
|
||||
delete userinfo.py;
|
||||
}
|
||||
if (userinfo.nation) {
|
||||
delete userinfo.nation;
|
||||
}
|
||||
@ -569,11 +624,11 @@ int HookSearchContact() {
|
||||
if (search_contact_flag_) {
|
||||
return 2;
|
||||
}
|
||||
DWORD hook_error_code_addr = base + WX_SEARCH_CONTACT_ERROR_CODE_HOOK_OFFSET;
|
||||
error_code_next_addr_ = base + WX_SEARCH_CONTACT_ERROR_CODE_HOOK_NEXT_OFFSET;
|
||||
error_code_back_addr_ = hook_error_code_addr + 0x5;
|
||||
Utils::HookAnyAddress(hook_error_code_addr, (LPVOID)HandleErrorCode,
|
||||
error_code_asm_code_);
|
||||
// DWORD hook_error_code_addr = base + WX_SEARCH_CONTACT_ERROR_CODE_HOOK_OFFSET;
|
||||
// error_code_next_addr_ = base + WX_SEARCH_CONTACT_ERROR_CODE_HOOK_NEXT_OFFSET;
|
||||
// error_code_back_addr_ = hook_error_code_addr + 0x5;
|
||||
// Utils::HookAnyAddress(hook_error_code_addr, (LPVOID)HandleErrorCode,
|
||||
// error_code_asm_code_);
|
||||
|
||||
DWORD hook_user_info_addr = base + WX_SEARCH_CONTACT_DETAIL_HOOK_OFFSET;
|
||||
user_info_next_addr_ = base + WX_SEARCH_CONTACT_DETAIL_HOOK_NEXT_OFFSET;
|
||||
|
@ -226,8 +226,12 @@ string Dispatch(struct mg_connection *c, struct mg_http_message *hm) {
|
||||
{"province", Utils::WCharToUTF8(user->province)},
|
||||
{"sex", user->sex},
|
||||
{"signature", Utils::WCharToUTF8(user->signature)},
|
||||
{"v2", Utils::WCharToUTF8(user->v2)},
|
||||
// {"v2", Utils::WCharToUTF8(user->v2)},
|
||||
{"v3", Utils::WCharToUTF8(user->v3)},
|
||||
{"V3", Utils::WCharToUTF8(user->V3)},
|
||||
{"account", Utils::WCharToUTF8(user->account)},
|
||||
// {"friendName", Utils::WCharToUTF8(user->friend_name)},
|
||||
// {"py", Utils::WCharToUTF8(user->py)},
|
||||
};
|
||||
ret_data["userInfo"] = info;
|
||||
}
|
||||
|
@ -401,8 +401,8 @@ int MiscMgr::GetImgByName(wchar_t* file_path,wchar_t* save_dir) {
|
||||
|
||||
int MiscMgr::SearchContactNetScene(wchar_t *keyword,UserInfo ** user) {
|
||||
int success = -1;
|
||||
hooks::HookSearchContact();
|
||||
hooks::DeleteUserInfoCache();
|
||||
hooks::HookSearchContact();
|
||||
DWORD search_contact_mgr_addr = base_addr_ + WX_SEARCH_CONTACT_MGR_OFFSET;
|
||||
DWORD search_contact_addr = base_addr_ + WX_SEARCH_CONTACT_OFFSET;
|
||||
WeChatString key(keyword);
|
||||
@ -419,16 +419,15 @@ int MiscMgr::SearchContactNetScene(wchar_t *keyword,UserInfo ** user) {
|
||||
popad;
|
||||
}
|
||||
success = 1;
|
||||
while (hooks::userinfo.error_code == 1 && hooks::user_info_flag_) {
|
||||
Sleep(20);
|
||||
}
|
||||
if (hooks::userinfo.error_code == 0) {
|
||||
// while (hooks::userinfo.error_code == 1 && hooks::user_info_flag_) {
|
||||
// Sleep(20);
|
||||
// }
|
||||
// if (hooks::userinfo.error_code == 0) {
|
||||
while (hooks::userinfo.over == false && hooks::user_info_flag_) {
|
||||
Sleep(20);
|
||||
Sleep(2);
|
||||
}
|
||||
}
|
||||
// }
|
||||
*user= &hooks::userinfo;
|
||||
// LOG(INFO)<<"user:" <<user;
|
||||
return success;
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
// patMgr
|
||||
#define WX_PAT_MGR_OFFSET 0x931730
|
||||
// searchContactMgr
|
||||
#define WX_SEARCH_CONTACT_MGR_OFFSET 0xa6cb00
|
||||
#define WX_SEARCH_CONTACT_MGR_OFFSET 0xa6d860
|
||||
// appMsgMgr
|
||||
#define WX_APP_MSG_MGR_OFFSET 0x76b8c0
|
||||
// sendMessageMgr
|
||||
@ -77,11 +77,11 @@
|
||||
#define WX_SET_VALUE_OFFSET 0x1f80900
|
||||
#define WX_DO_DEL_CONTACT_OFFSET 0xca6480
|
||||
#define WX_GET_CONTACT_OFFSET 0xc05ca0
|
||||
#define WX_DO_VERIFY_USER_OFFSET 0xc02100
|
||||
#define WX_VERIFY_MSG_OFFSET 0xf59d40
|
||||
#define WX_VERIFY_OK_OFFSET 0xa18bd0
|
||||
#define WX_NEW_ADD_FRIEND_HELPER_OFFSET 0xa17d50
|
||||
#define WX_FREE_ADD_FRIEND_HELPER_OFFSET 0xa17e70
|
||||
#define WX_DO_VERIFY_USER_OFFSET 0xc02f90
|
||||
#define WX_VERIFY_MSG_OFFSET 0xf5b2f0
|
||||
#define WX_VERIFY_OK_OFFSET 0xa19940
|
||||
#define WX_NEW_ADD_FRIEND_HELPER_OFFSET 0xa18ac0
|
||||
#define WX_FREE_ADD_FRIEND_HELPER_OFFSET 0xa18be0
|
||||
|
||||
// pushAttachTask
|
||||
|
||||
@ -121,7 +121,7 @@
|
||||
|
||||
|
||||
//forward
|
||||
#define WX_FORWARD_MSG_OFFSET 0xce6730
|
||||
#define WX_FORWARD_MSG_OFFSET 0xce75a0
|
||||
// send file
|
||||
#define WX_SEND_FILE_OFFSET 0xb6dfd0
|
||||
// send image
|
||||
@ -152,7 +152,7 @@
|
||||
#define STORAGE_END_OFFSET 0x13fc
|
||||
|
||||
#define PUBLIC_MSG_MGR_OFFSET 0x30400a4
|
||||
#define MULTI_DB_MSG_MGR_OFFSET 0x30403b8
|
||||
#define MULTI_DB_MSG_MGR_OFFSET 0x30424dc
|
||||
#define FAVORITE_STORAGE_MGR_OFFSET 0x3041e70
|
||||
#define FTS_FAVORITE_MGR_OFFSET 0x3000948
|
||||
|
||||
@ -576,12 +576,20 @@ struct UserInfo {
|
||||
int keyword_len;
|
||||
wchar_t *v3;
|
||||
int v3_len;
|
||||
wchar_t *V3;
|
||||
int V3_len;
|
||||
wchar_t *account;
|
||||
int account_len;
|
||||
wchar_t *friend_name;
|
||||
int friend_name_len;
|
||||
wchar_t *nickname;
|
||||
int nickname_len;
|
||||
wchar_t *signature;
|
||||
int signature_len;
|
||||
wchar_t *v2;
|
||||
int v2_len;
|
||||
wchar_t *py;
|
||||
int py_len;
|
||||
wchar_t *nation;
|
||||
int nation_len;
|
||||
wchar_t *province;
|
||||
|
Loading…
x
Reference in New Issue
Block a user