mirror of
https://github.com/ttttupup/wxhelper.git
synced 2024-11-23 02:39:25 +08:00
fix:修复获取个人信息错误的bug
This commit is contained in:
parent
82a5ca28db
commit
7e89c6ef2d
@ -40,75 +40,120 @@ int GetSelfInfo(SelfInfoInner &out) {
|
|||||||
if (*(DWORD *)(service_addr + 0x44) == 0 ||
|
if (*(DWORD *)(service_addr + 0x44) == 0 ||
|
||||||
*(DWORD *)(service_addr + 0x44 + 0x10) == 0) {
|
*(DWORD *)(service_addr + 0x44 + 0x10) == 0) {
|
||||||
out.wxid = string();
|
out.wxid = string();
|
||||||
|
} else {
|
||||||
|
if (*(DWORD *)(service_addr + 0x44 + 0x14) == 0xF) {
|
||||||
|
out.wxid = string((char *)(service_addr + 0x44),
|
||||||
|
*(DWORD *)(service_addr + 0x44 + 0x10));
|
||||||
} else {
|
} else {
|
||||||
out.wxid = string(*(char **)(service_addr + 0x44),
|
out.wxid = string(*(char **)(service_addr + 0x44),
|
||||||
*(DWORD *)(service_addr + 0x44 + 0x10));
|
*(DWORD *)(service_addr + 0x44 + 0x10));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (*(DWORD *)(service_addr + 0xA8) == 0 ||
|
if (*(DWORD *)(service_addr + 0xA8) == 0 ||
|
||||||
*(DWORD *)(service_addr + 0xA8 + 0x10) == 0) {
|
*(DWORD *)(service_addr + 0xA8 + 0x10) == 0) {
|
||||||
out.account = string();
|
out.account = string();
|
||||||
|
} else {
|
||||||
|
if (*(DWORD *)(service_addr + 0xA8 + 0x14) == 0xF) {
|
||||||
|
out.account = string((char *)(service_addr + 0xA8),
|
||||||
|
*(DWORD *)(service_addr + 0xA8 + 0x10));
|
||||||
} else {
|
} else {
|
||||||
out.account = string(*(char **)(service_addr + 0xA8),
|
out.account = string(*(char **)(service_addr + 0xA8),
|
||||||
*(DWORD *)(service_addr + 0xA8 + 0x10));
|
*(DWORD *)(service_addr + 0xA8 + 0x10));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (*(DWORD *)(service_addr + 0xC0) == 0 ||
|
if (*(DWORD *)(service_addr + 0xC0) == 0 ||
|
||||||
*(DWORD *)(service_addr + 0xC0 + 0x10) == 0) {
|
*(DWORD *)(service_addr + 0xC0 + 0x10) == 0) {
|
||||||
out.mobile = string();
|
out.mobile = string();
|
||||||
} else {
|
} else {
|
||||||
|
if (*(DWORD *)(service_addr + 0xC0 + 0x14) == 0xF) {
|
||||||
out.mobile = string((char *)(service_addr + 0xC0),
|
out.mobile = string((char *)(service_addr + 0xC0),
|
||||||
*(DWORD *)(service_addr + 0xC0 + 0x10));
|
*(DWORD *)(service_addr + 0xC0 + 0x10));
|
||||||
|
} else {
|
||||||
|
out.mobile = string(*(char **)(service_addr + 0xC0),
|
||||||
|
*(DWORD *)(service_addr + 0xC0 + 0x10));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*(DWORD *)(service_addr + 0xD8) == 0 ||
|
if (*(DWORD *)(service_addr + 0xD8) == 0 ||
|
||||||
*(DWORD *)(service_addr + 0xD8 + 0x10) == 0) {
|
*(DWORD *)(service_addr + 0xD8 + 0x10) == 0) {
|
||||||
out.signature = string();
|
out.signature = string();
|
||||||
} else {
|
} else {
|
||||||
|
if (*(DWORD *)(service_addr + 0xD8 + 0x14) == 0xF) {
|
||||||
out.signature = string((char *)(service_addr + 0xD8),
|
out.signature = string((char *)(service_addr + 0xD8),
|
||||||
*(DWORD *)(service_addr + 0xD8 + 0x10));
|
*(DWORD *)(service_addr + 0xD8 + 0x10));
|
||||||
|
} else {
|
||||||
|
out.signature = string(*(char **)(service_addr + 0xD8),
|
||||||
|
*(DWORD *)(service_addr + 0xD8 + 0x10));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*(DWORD *)(service_addr + 0xF0) == 0 ||
|
if (*(DWORD *)(service_addr + 0xF0) == 0 ||
|
||||||
*(DWORD *)(service_addr + 0xF0 + 0x10) == 0) {
|
*(DWORD *)(service_addr + 0xF0 + 0x10) == 0) {
|
||||||
out.country = string();
|
out.country = string();
|
||||||
} else {
|
} else {
|
||||||
|
if (*(DWORD *)(service_addr + 0xF0 + 0x14) == 0xF) {
|
||||||
out.country = string((char *)(service_addr + 0xF0),
|
out.country = string((char *)(service_addr + 0xF0),
|
||||||
*(DWORD *)(service_addr + 0xF0 + 0x10));
|
*(DWORD *)(service_addr + 0xF0 + 0x10));
|
||||||
|
} else {
|
||||||
|
out.country = string(*(char **)(service_addr + 0xF0),
|
||||||
|
*(DWORD *)(service_addr + 0xF0 + 0x10));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*(DWORD *)(service_addr + 0x108) == 0 ||
|
if (*(DWORD *)(service_addr + 0x108) == 0 ||
|
||||||
*(DWORD *)(service_addr + 0x108 + 0x10) == 0) {
|
*(DWORD *)(service_addr + 0x108 + 0x10) == 0) {
|
||||||
out.province = string();
|
out.province = string();
|
||||||
} else {
|
} else {
|
||||||
|
if (*(DWORD *)(service_addr + 0x108 + 0x14) == 0xF) {
|
||||||
out.province = string((char *)(service_addr + 0x108),
|
out.province = string((char *)(service_addr + 0x108),
|
||||||
*(DWORD *)(service_addr + 0x108 + 0x10));
|
*(DWORD *)(service_addr + 0x108 + 0x10));
|
||||||
|
} else {
|
||||||
|
out.province = string(*(char **)(service_addr + 0x108),
|
||||||
|
*(DWORD *)(service_addr + 0x108 + 0x10));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*(DWORD *)(service_addr + 0x120) == 0 ||
|
if (*(DWORD *)(service_addr + 0x120) == 0 ||
|
||||||
*(DWORD *)(service_addr + 0x120 + 0x10) == 0) {
|
*(DWORD *)(service_addr + 0x120 + 0x10) == 0) {
|
||||||
out.city = string();
|
out.city = string();
|
||||||
} else {
|
} else {
|
||||||
|
if (*(DWORD *)(service_addr + 0x120 + 0x14) == 0xF) {
|
||||||
out.city = string((char *)(service_addr + 0x120),
|
out.city = string((char *)(service_addr + 0x120),
|
||||||
*(DWORD *)(service_addr + 0x120 + 0x10));
|
*(DWORD *)(service_addr + 0x120 + 0x10));
|
||||||
|
} else {
|
||||||
|
out.city = string(*(char **)(service_addr + 0x120),
|
||||||
|
*(DWORD *)(service_addr + 0x120 + 0x10));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*(DWORD *)(service_addr + 0x150) == 0 ||
|
if (*(DWORD *)(service_addr + 0x150) == 0 ||
|
||||||
*(DWORD *)(service_addr + 0x150 + 0x10) == 0) {
|
*(DWORD *)(service_addr + 0x150 + 0x10) == 0) {
|
||||||
out.name = string();
|
out.name = string();
|
||||||
} else {
|
} else {
|
||||||
|
if (*(DWORD *)(service_addr + 0x150 + 0x14) == 0xF) {
|
||||||
out.name = string((char *)(service_addr + 0x150),
|
out.name = string((char *)(service_addr + 0x150),
|
||||||
*(DWORD *)(service_addr + 0x150 + 0x10));
|
*(DWORD *)(service_addr + 0x150 + 0x10));
|
||||||
|
} else {
|
||||||
|
out.name = string(*(char **)(service_addr + 0x150),
|
||||||
|
*(DWORD *)(service_addr + 0x150 + 0x10));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*(DWORD *)(service_addr + 0x304) == 0 ||
|
if (*(DWORD *)(service_addr + 0x304) == 0 ||
|
||||||
*(DWORD *)(service_addr + 0x304 + 0x10) == 0) {
|
*(DWORD *)(service_addr + 0x304 + 0x10) == 0) {
|
||||||
out.head_img = string();
|
out.head_img = string();
|
||||||
|
} else {
|
||||||
|
if (*(DWORD *)(service_addr + 0x304 + 0x14) == 0xF) {
|
||||||
|
out.head_img = string((char *)(service_addr + 0x304),
|
||||||
|
*(DWORD *)(service_addr + 0x304 + 0x10));
|
||||||
} else {
|
} else {
|
||||||
out.head_img = string(*(char **)(service_addr + 0x304),
|
out.head_img = string(*(char **)(service_addr + 0x304),
|
||||||
*(DWORD *)(service_addr + 0x304 + 0x10));
|
*(DWORD *)(service_addr + 0x304 + 0x10));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
WeChatString data_save_path;
|
WeChatString data_save_path;
|
||||||
WeChatString current_data_path;
|
WeChatString current_data_path;
|
||||||
@ -125,21 +170,21 @@ int GetSelfInfo(SelfInfoInner &out) {
|
|||||||
if (data_save_path.ptr) {
|
if (data_save_path.ptr) {
|
||||||
out.data_save_path =
|
out.data_save_path =
|
||||||
Wstring2String(wstring(data_save_path.ptr, data_save_path.length));
|
Wstring2String(wstring(data_save_path.ptr, data_save_path.length));
|
||||||
}else {
|
}
|
||||||
|
else {
|
||||||
out.data_save_path = string();
|
out.data_save_path = string();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (current_data_path.ptr) {
|
if (current_data_path.ptr) {
|
||||||
out.current_data_path =
|
out.current_data_path = Wstring2String(
|
||||||
Wstring2String(wstring(current_data_path.ptr, current_data_path.length));
|
wstring(current_data_path.ptr, current_data_path.length));
|
||||||
}else {
|
} else {
|
||||||
out.current_data_path = string();
|
out.current_data_path = string();
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int CheckLogin() {
|
||||||
int CheckLogin(){
|
|
||||||
DWORD base = GetWeChatWinBase();
|
DWORD base = GetWeChatWinBase();
|
||||||
DWORD accout_service_addr = base + WX_ACCOUNT_SERVICE_OFFSET;
|
DWORD accout_service_addr = base + WX_ACCOUNT_SERVICE_OFFSET;
|
||||||
DWORD service_addr = NULL;
|
DWORD service_addr = NULL;
|
||||||
@ -157,16 +202,15 @@ int CheckLogin(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Logout() {
|
||||||
int Logout(){
|
|
||||||
int success = 0;
|
int success = 0;
|
||||||
if(!CheckLogin()){
|
if (!CheckLogin()) {
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
DWORD base = GetWeChatWinBase();
|
DWORD base = GetWeChatWinBase();
|
||||||
DWORD account_service_addr = base + WX_ACCOUNT_SERVICE_OFFSET;
|
DWORD account_service_addr = base + WX_ACCOUNT_SERVICE_OFFSET;
|
||||||
DWORD logout_addr = base + WX_LOGOUT_OFFSET;
|
DWORD logout_addr = base + WX_LOGOUT_OFFSET;
|
||||||
__asm{
|
__asm {
|
||||||
PUSHAD
|
PUSHAD
|
||||||
CALL account_service_addr
|
CALL account_service_addr
|
||||||
PUSH 0x0
|
PUSH 0x0
|
||||||
|
Loading…
Reference in New Issue
Block a user