Impl Functions_FUNC_ACCEPT_FRIEND
This commit is contained in:
parent
591a958f85
commit
18078f3171
@ -5,36 +5,22 @@
|
|||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
typedef struct NewFriendParam {
|
|
||||||
DWORD handle;
|
|
||||||
DWORD *status;
|
|
||||||
DWORD statusEnd1;
|
|
||||||
DWORD statusEnd2;
|
|
||||||
char buffer[0x3C];
|
|
||||||
} NewFriendParam_t;
|
|
||||||
|
|
||||||
extern WxCalls_t g_WxCalls;
|
extern WxCalls_t g_WxCalls;
|
||||||
extern DWORD g_WeChatWinDllAddr;
|
extern DWORD g_WeChatWinDllAddr;
|
||||||
|
|
||||||
int AcceptNewFriend(std::string v3, std::string v4, int scene)
|
int AcceptNewFriend(std::string v3, std::string v4, int scene)
|
||||||
{
|
{
|
||||||
int isSucceeded = 0;
|
int success = 0;
|
||||||
|
|
||||||
DWORD acceptNewFriendCall1 = g_WeChatWinDllAddr + g_WxCalls.anf.call1;
|
DWORD acceptNewFriendCall1 = g_WeChatWinDllAddr + g_WxCalls.anf.call1;
|
||||||
DWORD acceptNewFriendCall2 = g_WeChatWinDllAddr + g_WxCalls.anf.call2;
|
DWORD acceptNewFriendCall2 = g_WeChatWinDllAddr + g_WxCalls.anf.call2;
|
||||||
DWORD acceptNewFriendHandle = g_WeChatWinDllAddr + g_WxCalls.anf.handle;
|
DWORD acceptNewFriendCall3 = g_WeChatWinDllAddr + g_WxCalls.anf.call3;
|
||||||
|
DWORD acceptNewFriendCall4 = g_WeChatWinDllAddr + g_WxCalls.anf.call4;
|
||||||
|
|
||||||
char buffer[0x94] = { 0 };
|
char buffer[0x40] = { 0 };
|
||||||
NewFriendParam_t param = { 0 };
|
char nullbuffer[0x3CC] = { 0 };
|
||||||
DWORD status[9] = { 0xB2, (DWORD)¶m, 0xB5, (DWORD)¶m, 0xB0, (DWORD)¶m, 0xB1, (DWORD)¶m, 0x00 };
|
|
||||||
|
|
||||||
param.handle = acceptNewFriendHandle;
|
LOG_DEBUG("\nv3: {}\nv4: {}\nscene: {}", v3, v4, scene);
|
||||||
param.status = status;
|
|
||||||
param.statusEnd1 = (DWORD)status + 0x20;
|
|
||||||
param.statusEnd2 = (DWORD)status + 0x20;
|
|
||||||
NewFriendParam_t *pParam = ¶m;
|
|
||||||
|
|
||||||
LOG_DEBUG("v3: {}\nv4: {}", v3, v4);
|
|
||||||
WxString_t wxV3 = { 0 };
|
WxString_t wxV3 = { 0 };
|
||||||
WxString_t wxV4 = { 0 };
|
WxString_t wxV4 = { 0 };
|
||||||
std::wstring wsV3 = String2Wstring(v3);
|
std::wstring wsV3 = String2Wstring(v3);
|
||||||
@ -51,26 +37,31 @@ int AcceptNewFriend(std::string v3, std::string v4, int scene)
|
|||||||
__asm {
|
__asm {
|
||||||
pushad;
|
pushad;
|
||||||
pushfd;
|
pushfd;
|
||||||
push 0x0;
|
lea ecx, buffer;
|
||||||
mov eax, scene;
|
call acceptNewFriendCall1;
|
||||||
push eax;
|
mov esi, 0x0;
|
||||||
|
mov edi, scene;
|
||||||
|
push esi;
|
||||||
|
push edi;
|
||||||
sub esp, 0x14;
|
sub esp, 0x14;
|
||||||
mov ecx, esp;
|
mov ecx, esp;
|
||||||
lea eax, wxV4;
|
lea eax, wxV4;
|
||||||
push eax;
|
push eax;
|
||||||
call acceptNewFriendCall1;
|
call acceptNewFriendCall2;
|
||||||
sub esp, 0x8;
|
sub esp, 0x8;
|
||||||
push 0x0;
|
push 0x0;
|
||||||
lea eax, buffer;
|
lea eax, nullbuffer;
|
||||||
push eax;
|
push eax;
|
||||||
lea eax, wxV3;
|
lea eax, wxV3;
|
||||||
push eax;
|
push eax;
|
||||||
mov ecx, pParam;
|
lea ecx, buffer;
|
||||||
call acceptNewFriendCall2;
|
call acceptNewFriendCall3;
|
||||||
mov isSucceeded, eax;
|
mov success, eax;
|
||||||
|
lea ecx, buffer;
|
||||||
|
call acceptNewFriendCall4;
|
||||||
popfd;
|
popfd;
|
||||||
popad;
|
popad;
|
||||||
}
|
}
|
||||||
|
|
||||||
return isSucceeded; // 成功返回 1
|
return success; // 成功返回 1
|
||||||
}
|
}
|
||||||
|
@ -21,9 +21,9 @@ WxCalls_t wxCalls = {
|
|||||||
/* Exec Sql:
|
/* Exec Sql:
|
||||||
Exec, base, start, end, slot, name*/
|
Exec, base, start, end, slot, name*/
|
||||||
{ 0x141BDF0, 0x2366934, 0x1428, 0x142C, 0x3C, 0x50 },
|
{ 0x141BDF0, 0x2366934, 0x1428, 0x142C, 0x3C, 0x50 },
|
||||||
{ 0x771980, 0x2AE8D0, 0x1EE40E0 }, // Accept New Friend application
|
{ 0xA17D50, 0xF59E40, 0xA18BD0, 0xA17E70 }, // Accept New Friend application
|
||||||
{ 0xE29F0, 0x771980, 0x43D8D0 }, // Add chatroom members
|
{ 0xE29F0, 0x771980, 0x43D8D0 }, // Add chatroom members
|
||||||
{ 0x771980, 0xCD2A90 } // Receive transfer
|
{ 0x771980, 0xCD2A90 } // Receive transfer
|
||||||
};
|
};
|
||||||
|
|
||||||
int LoadCalls(const wchar_t *version, WxCalls_t *calls)
|
int LoadCalls(const wchar_t *version, WxCalls_t *calls)
|
||||||
|
@ -621,12 +621,12 @@ static bool dispatcher(uint8_t *in, size_t in_len, uint8_t *out, size_t *out_len
|
|||||||
ret = func_exec_db_query(req.msg.query.db, req.msg.query.sql, out, out_len);
|
ret = func_exec_db_query(req.msg.query.db, req.msg.query.sql, out, out_len);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#if 0
|
|
||||||
case Functions_FUNC_ACCEPT_FRIEND: {
|
case Functions_FUNC_ACCEPT_FRIEND: {
|
||||||
LOG_DEBUG("[Functions_FUNC_ACCEPT_FRIEND]");
|
LOG_DEBUG("[Functions_FUNC_ACCEPT_FRIEND]");
|
||||||
ret = func_accept_friend(req.msg.v.v3, req.msg.v.v4, req.msg.v.scene, out, out_len);
|
ret = func_accept_friend(req.msg.v.v3, req.msg.v.v4, req.msg.v.scene, out, out_len);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#if 0
|
||||||
case Functions_FUNC_ADD_ROOM_MEMBERS: {
|
case Functions_FUNC_ADD_ROOM_MEMBERS: {
|
||||||
LOG_DEBUG("[Functions_FUNC_ADD_ROOM_MEMBERS]");
|
LOG_DEBUG("[Functions_FUNC_ADD_ROOM_MEMBERS]");
|
||||||
ret = func_add_room_members(req.msg.m.roomid, req.msg.m.wxids, out, out_len);
|
ret = func_add_room_members(req.msg.m.roomid, req.msg.m.wxids, out, out_len);
|
||||||
|
@ -61,7 +61,8 @@ typedef struct Sql {
|
|||||||
typedef struct NewFriend {
|
typedef struct NewFriend {
|
||||||
DWORD call1;
|
DWORD call1;
|
||||||
DWORD call2;
|
DWORD call2;
|
||||||
DWORD handle;
|
DWORD call3;
|
||||||
|
DWORD call4;
|
||||||
} NewFriend_t;
|
} NewFriend_t;
|
||||||
|
|
||||||
typedef struct RoomMember {
|
typedef struct RoomMember {
|
||||||
|
Loading…
Reference in New Issue
Block a user