feat: 根据502647092提供的偏移,新增登录二维码

This commit is contained in:
hugy 2023-05-25 22:10:03 +08:00
parent 581aacb8ce
commit aaada266df
6 changed files with 49 additions and 12 deletions

View File

@ -33,4 +33,5 @@
54.朋友圈下一页 54.朋友圈下一页
55.获取联系人或者群名称 55.获取联系人或者群名称
56.获取消息附件(图片,视频,文件) 56.获取消息附件(图片,视频,文件)
57.获取消息语音文件 57.获取消息语音文件
58.登录二维码

View File

@ -1,21 +1,16 @@
#include "pch.h" #include "pch.h"
#include "account_mgr.h" #include "account_mgr.h"
#include "wechat_function.h" #include "wechat_function.h"
using namespace std; using namespace std;
namespace wxhelper { namespace wxhelper {
AccountMgr::AccountMgr(DWORD base):BaseMgr(base){ AccountMgr::AccountMgr(DWORD base) : BaseMgr(base) {}
AccountMgr::~AccountMgr() {}
}
AccountMgr::~AccountMgr(){
}
int AccountMgr::GetSelfInfo(SelfInfoInner &out) { int AccountMgr::GetSelfInfo(SelfInfoInner &out) {
DWORD accout_service_addr = base_addr_ + WX_ACCOUNT_SERVICE_OFFSET; DWORD accout_service_addr = base_addr_ + WX_ACCOUNT_SERVICE_OFFSET;
DWORD get_app_save_addr = base_addr_ + WX_GET_APP_DATA_SAVE_PATH_OFFSET; DWORD get_app_save_addr = base_addr_ + WX_GET_APP_DATA_SAVE_PATH_OFFSET;
DWORD get_current_data_path_addr = base_addr_ + WX_GET_CURRENT_DATA_PATH_OFFSET; DWORD get_current_data_path_addr =
base_addr_ + WX_GET_CURRENT_DATA_PATH_OFFSET;
DWORD service_addr = NULL; DWORD service_addr = NULL;
__asm { __asm {
PUSHAD PUSHAD
@ -215,4 +210,35 @@ int AccountMgr::Logout() {
return success; return success;
} }
/// @brief 根据 502647092 提供的偏移 获取二维码url
/// @return
std::string AccountMgr::GetQRCodeUrl() {
DWORD qr_code_login_addr = base_addr_ + WX_QR_CODE_LOGIN_MGR_OFFSET ;
DWORD get_qr_code_img_addr = base_addr_ + WX_GET_QR_CODE_IMAGE_OFFSET ;
DWORD temp;
__asm {
PUSHAD
PUSHFD
CALL qr_code_login_addr
MOV temp,EAX
POPFD
POPAD
}
std::string pre("https://weixin.qq.com/x/");
DWORD ptr = temp + 0x8;
DWORD len = *(DWORD*)(ptr+0x10);
if (*(DWORD *)(ptr) == 0) {
return std::string();
} else {
if( *(DWORD*) (temp+0x1c) > 0xf){
std::string suff(*(char **)ptr,len);
return pre + suff;
}else{
std::string suff((char *)ptr,len);
return pre + suff;
}
}
}
} // namespace wxhelper } // namespace wxhelper

View File

@ -13,6 +13,8 @@ namespace wxhelper{
int CheckLogin(); int CheckLogin();
int Logout(); int Logout();
std::string GetQRCodeUrl();
}; };
} }

View File

@ -71,6 +71,7 @@ typedef enum HTTP_API_ROUTE {
WECHAT_CONTACT_NAME, WECHAT_CONTACT_NAME,
WECHAT_ATTACH_DOWNLOAD, WECHAT_ATTACH_DOWNLOAD,
WECHAT_GET_VOICE, WECHAT_GET_VOICE,
WECHAT_GET_QRCODE,
} WECHAT_HTTP_APIS, } WECHAT_HTTP_APIS,
*PWECHAT_HTTP_APIS; *PWECHAT_HTTP_APIS;

View File

@ -572,6 +572,12 @@ string Dispatch(struct mg_connection *c, struct mg_http_message *hm) {
ret = ret_data.dump(); ret = ret_data.dump();
break; break;
} }
case WECHAT_GET_QRCODE: {
string url = g_context.account_mgr->GetQRCodeUrl();
json ret_data = {{"code", 1}, {"result", "OK"},{"qrCodeUrl",url}};
ret = ret_data.dump();
break;
}
default: default:
break; break;
} }

View File

@ -118,8 +118,9 @@
#define WX_ACCOUNT_SERVICE_OFFSET 0x769720 #define WX_ACCOUNT_SERVICE_OFFSET 0x769720
#define WX_GET_APP_DATA_SAVE_PATH_OFFSET 0xf3bbd0 #define WX_GET_APP_DATA_SAVE_PATH_OFFSET 0xf3bbd0
#define WX_GET_CURRENT_DATA_PATH_OFFSET 0xc88120 #define WX_GET_CURRENT_DATA_PATH_OFFSET 0xc88120
#define WX_QR_CODE_LOGIN_MGR_OFFSET 0xaeab70
#define WX_GET_QR_CODE_IMAGE_OFFSET 0xcdb560
//forward //forward
#define WX_FORWARD_MSG_OFFSET 0xce75a0 #define WX_FORWARD_MSG_OFFSET 0xce75a0
// send file // send file