Impl accept new friend application
This commit is contained in:
parent
1fb486ea62
commit
3fd3e589e7
@ -66,6 +66,7 @@ interface ISpy
|
|||||||
int ExecDbQuery([ in, string ] const wchar_t *db,
|
int ExecDbQuery([ in, string ] const wchar_t *db,
|
||||||
[ in, string ] const wchar_t *sql, [out] int *pRow, [out] int *pCol,
|
[ in, string ] const wchar_t *sql, [out] int *pRow, [out] int *pCol,
|
||||||
[ out, size_is(, *pRow, *pCol) ] PPPRpcSqlResult *ret);
|
[ out, size_is(, *pRow, *pCol) ] PPPRpcSqlResult *ret);
|
||||||
|
BOOL AcceptNewFriend([in, string] const wchar_t *v3, [in, string] const wchar_t *v4);
|
||||||
|
|
||||||
void EnableReceiveMsg();
|
void EnableReceiveMsg();
|
||||||
void DisableReceiveMsg();
|
void DisableReceiveMsg();
|
||||||
|
@ -233,6 +233,22 @@ PPPRpcSqlResult RpcExecDbQuery(const wchar_t *db, const wchar_t *sql, int *pRow,
|
|||||||
return pppRpcSqlResult;
|
return pppRpcSqlResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL AcceptNewFriend(const wchar_t *v3, const wchar_t *v4)
|
||||||
|
{
|
||||||
|
BOOL ret = 0;
|
||||||
|
unsigned long ulCode = 0;
|
||||||
|
|
||||||
|
RpcTryExcept { ret = client_AcceptNewFriend(v3, v4); }
|
||||||
|
RpcExcept(1)
|
||||||
|
{
|
||||||
|
ulCode = RpcExceptionCode();
|
||||||
|
printf("AcceptNewFriend exception 0x%lx = %ld\n", ulCode, ulCode);
|
||||||
|
}
|
||||||
|
RpcEndExcept;
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
int server_ReceiveMsg(RpcMessage_t rpcMsg)
|
int server_ReceiveMsg(RpcMessage_t rpcMsg)
|
||||||
{
|
{
|
||||||
WxMessage_t msg;
|
WxMessage_t msg;
|
||||||
|
@ -15,3 +15,4 @@ PPRpcContact RpcGetContacts(int *pNum);
|
|||||||
BSTR *RpcGetDbNames(int *pNum);
|
BSTR *RpcGetDbNames(int *pNum);
|
||||||
PPRpcTables RpcGetDbTables(const wchar_t *db, int *pNum);
|
PPRpcTables RpcGetDbTables(const wchar_t *db, int *pNum);
|
||||||
PPPRpcSqlResult RpcExecDbQuery(const wchar_t *db, const wchar_t *sql, int *row, int *col);
|
PPPRpcSqlResult RpcExecDbQuery(const wchar_t *db, const wchar_t *sql, int *row, int *col);
|
||||||
|
BOOL AcceptNewFriend(const wchar_t *v3, const wchar_t *v4);
|
||||||
|
@ -262,3 +262,5 @@ SqlRetVector_t WxExecDbQuery(wstring db, wstring sql)
|
|||||||
|
|
||||||
return vvResults;
|
return vvResults;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL WxAcceptNewFriend(wstring v3, wstring v4) { return AcceptNewFriend(v3.c_str(), v4.c_str()); }
|
||||||
|
@ -10,3 +10,4 @@
|
|||||||
WxGetDbNames
|
WxGetDbNames
|
||||||
WxGetDbTables
|
WxGetDbTables
|
||||||
WxExecDbQuery
|
WxExecDbQuery
|
||||||
|
WxAcceptNewFriend
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "framework.h"
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -55,3 +56,4 @@ MsgTypesMap_t WxGetMsgTypes();
|
|||||||
vector<wstring> WxGetDbNames();
|
vector<wstring> WxGetDbNames();
|
||||||
DbTableVector_t WxGetDbTables(wstring db);
|
DbTableVector_t WxGetDbTables(wstring db);
|
||||||
SqlRetVector_t WxExecDbQuery(wstring db, wstring sql);
|
SqlRetVector_t WxExecDbQuery(wstring db, wstring sql);
|
||||||
|
BOOL WxAcceptNewFriend(wstring v3, wstring v4);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include <pybind11/functional.h>
|
#include <pybind11/functional.h>
|
||||||
#include <pybind11/pybind11.h>
|
#include <pybind11/pybind11.h>
|
||||||
#include <pybind11/stl.h>
|
#include <pybind11/stl.h>
|
||||||
|
|
||||||
@ -81,6 +81,7 @@ PYBIND11_MODULE(wcferry, m)
|
|||||||
m.def("WxGetDbTables", &WxGetDbTables, py::return_value_policy::reference, "Get DB tables.", py::arg("db"));
|
m.def("WxGetDbTables", &WxGetDbTables, py::return_value_policy::reference, "Get DB tables.", py::arg("db"));
|
||||||
m.def("WxExecDbQuery", &WxExecDbQueryPy, py::return_value_policy::reference, "Get DB tables.", py::arg("db"),
|
m.def("WxExecDbQuery", &WxExecDbQueryPy, py::return_value_policy::reference, "Get DB tables.", py::arg("db"),
|
||||||
py::arg("sql"));
|
py::arg("sql"));
|
||||||
|
m.def("WxAcceptNewFriend", &WxAcceptNewFriend, "Accept new friend application.", py::arg("v3"), py::arg("v4"));
|
||||||
|
|
||||||
#ifdef VERSION_INFO
|
#ifdef VERSION_INFO
|
||||||
m.attr("__version__") = VERSION_INFO;
|
m.attr("__version__") = VERSION_INFO;
|
||||||
|
@ -166,6 +166,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="..\Rpc\rpc_h.h" />
|
<ClInclude Include="..\Rpc\rpc_h.h" />
|
||||||
<ClInclude Include="..\SDK\util.h" />
|
<ClInclude Include="..\SDK\util.h" />
|
||||||
|
<ClInclude Include="accept_new_friend.h" />
|
||||||
<ClInclude Include="exec_sql.h" />
|
<ClInclude Include="exec_sql.h" />
|
||||||
<ClInclude Include="framework.h" />
|
<ClInclude Include="framework.h" />
|
||||||
<ClInclude Include="get_contacts.h" />
|
<ClInclude Include="get_contacts.h" />
|
||||||
@ -180,6 +181,7 @@
|
|||||||
<ClCompile Include="..\Rpc\rpc_memory.cpp" />
|
<ClCompile Include="..\Rpc\rpc_memory.cpp" />
|
||||||
<ClCompile Include="..\Rpc\rpc_s.c" />
|
<ClCompile Include="..\Rpc\rpc_s.c" />
|
||||||
<ClCompile Include="..\SDK\util.cpp" />
|
<ClCompile Include="..\SDK\util.cpp" />
|
||||||
|
<ClCompile Include="accept_new_friend.cpp" />
|
||||||
<ClCompile Include="dllmain.cpp" />
|
<ClCompile Include="dllmain.cpp" />
|
||||||
<ClCompile Include="exec_sql.cpp" />
|
<ClCompile Include="exec_sql.cpp" />
|
||||||
<ClCompile Include="get_contacts.cpp" />
|
<ClCompile Include="get_contacts.cpp" />
|
||||||
|
@ -51,6 +51,9 @@
|
|||||||
<ClInclude Include="spy.h">
|
<ClInclude Include="spy.h">
|
||||||
<Filter>头文件</Filter>
|
<Filter>头文件</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="accept_new_friend.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="dllmain.cpp">
|
<ClCompile Include="dllmain.cpp">
|
||||||
@ -86,6 +89,9 @@
|
|||||||
<ClCompile Include="spy.cpp">
|
<ClCompile Include="spy.cpp">
|
||||||
<Filter>源文件</Filter>
|
<Filter>源文件</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="accept_new_friend.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Midl Include="..\Rpc\rpc.idl">
|
<Midl Include="..\Rpc\rpc.idl">
|
||||||
|
57
Spy/accept_new_friend.cpp
Normal file
57
Spy/accept_new_friend.cpp
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
#include "accept_new_friend.h"
|
||||||
|
#include "load_calls.h"
|
||||||
|
|
||||||
|
typedef struct NewFriendParam {
|
||||||
|
DWORD handle;
|
||||||
|
DWORD *status;
|
||||||
|
DWORD statusEnd1;
|
||||||
|
DWORD statusEnd2;
|
||||||
|
char buffer[0x3C];
|
||||||
|
} NewFriendParam_t;
|
||||||
|
|
||||||
|
extern WxCalls_t g_WxCalls;
|
||||||
|
extern DWORD g_WeChatWinDllAddr;
|
||||||
|
|
||||||
|
BOOL AcceptNewFriend(std::wstring v3, std::wstring v4)
|
||||||
|
{
|
||||||
|
BOOL isSucceeded = false;
|
||||||
|
|
||||||
|
DWORD acceptNewFriendCall1 = g_WeChatWinDllAddr + g_WxCalls.anf.call1;
|
||||||
|
DWORD acceptNewFriendCall2 = g_WeChatWinDllAddr + g_WxCalls.anf.call2;
|
||||||
|
DWORD acceptNewFriendHandle = g_WeChatWinDllAddr + g_WxCalls.anf.handle;
|
||||||
|
|
||||||
|
char buffer[0x94] = { 0 };
|
||||||
|
NewFriendParam_t param = { 0 };
|
||||||
|
DWORD status[9] = { 0xB2, (DWORD)¶m, 0xB5, (DWORD)¶m, 0xB0, (DWORD)¶m, 0xB1, (DWORD)¶m, 0x00 };
|
||||||
|
|
||||||
|
param.handle = acceptNewFriendHandle;
|
||||||
|
param.status = status;
|
||||||
|
param.statusEnd1 = (DWORD)&status[8];
|
||||||
|
param.statusEnd2 = (DWORD)&status[8];
|
||||||
|
NewFriendParam_t *pParam = ¶m;
|
||||||
|
|
||||||
|
__asm {
|
||||||
|
pushad;
|
||||||
|
pushfd;
|
||||||
|
push 0x0;
|
||||||
|
push 0x6;
|
||||||
|
sub esp, 0x14;
|
||||||
|
mov ecx, esp;
|
||||||
|
lea eax, v4;
|
||||||
|
push eax;
|
||||||
|
call acceptNewFriendCall1;
|
||||||
|
sub esp, 0x8;
|
||||||
|
push 0x0;
|
||||||
|
lea eax, buffer;
|
||||||
|
push eax;
|
||||||
|
lea eax, v3;
|
||||||
|
push eax;
|
||||||
|
mov ecx, pParam;
|
||||||
|
call acceptNewFriendCall2;
|
||||||
|
mov isSucceeded, eax;
|
||||||
|
popfd;
|
||||||
|
popad;
|
||||||
|
}
|
||||||
|
|
||||||
|
return isSucceeded;
|
||||||
|
}
|
6
Spy/accept_new_friend.h
Normal file
6
Spy/accept_new_friend.h
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "framework.h"
|
||||||
|
#include "string"
|
||||||
|
|
||||||
|
BOOL AcceptNewFriend(std::wstring v3, std::wstring v4);
|
@ -4,19 +4,22 @@
|
|||||||
#include "load_calls.h"
|
#include "load_calls.h"
|
||||||
|
|
||||||
#define SUPPORT_VERSION L"3.7.0.30"
|
#define SUPPORT_VERSION L"3.7.0.30"
|
||||||
WxCalls_t wxCalls = { 0x2366538, // Login Status
|
WxCalls_t wxCalls = {
|
||||||
{ 0x236607C, 0x23660F4, 0x2366128 }, // User Info: wxid, nickname, mobile
|
0x2366538, // Login Status
|
||||||
0x521D30, // Send Message
|
{ 0x236607C, 0x23660F4, 0x2366128 }, // User Info: wxid, nickname, mobile
|
||||||
/* Receive Message:
|
0x521D30, // Send Message
|
||||||
Hook, call, type, self, id, msgXml, roomId, wxId, content */
|
/* Receive Message:
|
||||||
{ 0x550F4C, 0xA96350, 0x38, 0x3C, 0x184, 0x1EC, 0x48, 0x170, 0x70 },
|
Hook, call, type, self, id, msgXml, roomId, wxId, content */
|
||||||
{ 0xBD780, 0x771980, 0x521640 }, // Send Image Message
|
{ 0x550F4C, 0xA96350, 0x38, 0x3C, 0x184, 0x1EC, 0x48, 0x170, 0x70 },
|
||||||
/* Get Contacts:
|
{ 0xBD780, 0x771980, 0x521640 }, // Send Image Message
|
||||||
Base, head, wxId, Code, Name, Gender, Country, Province, City*/
|
/* Get Contacts:
|
||||||
{ 0x23668F4, 0x4C, 0x30, 0x44, 0x8C, 0x184, 0x1D0, 0x1E4, 0x1F8 },
|
Base, head, wxId, Code, Name, Gender, Country, Province, City*/
|
||||||
/* Exec Sql:
|
{ 0x23668F4, 0x4C, 0x30, 0x44, 0x8C, 0x184, 0x1D0, 0x1E4, 0x1F8 },
|
||||||
Exec, base, start, end, slot, name*/
|
/* Exec Sql:
|
||||||
{ 0x141BDF0, 0x2366934, 0x1428, 0x142C, 0x3C, 0x50 } };
|
Exec, base, start, end, slot, name*/
|
||||||
|
{ 0x141BDF0, 0x2366934, 0x1428, 0x142C, 0x3C, 0x50 },
|
||||||
|
{ 0x771980, 0x2AE8D0, 0x1EE40E0 } // Accept New Friend application
|
||||||
|
};
|
||||||
|
|
||||||
int LoadCalls(const wchar_t *version, WxCalls_t *calls)
|
int LoadCalls(const wchar_t *version, WxCalls_t *calls)
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "accept_new_friend.h"
|
||||||
#include "exec_sql.h"
|
#include "exec_sql.h"
|
||||||
#include "get_contacts.h"
|
#include "get_contacts.h"
|
||||||
#include "receive_msg.h"
|
#include "receive_msg.h"
|
||||||
@ -277,3 +278,5 @@ int server_ExecDbQuery(const wchar_t *db, const wchar_t *sql, int *pRow, int *pC
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL server_AcceptNewFriend(const wchar_t *v3, const wchar_t *v4) { return AcceptNewFriend(v3, v4); }
|
||||||
|
@ -50,6 +50,12 @@ typedef struct Sql {
|
|||||||
DWORD name;
|
DWORD name;
|
||||||
} Sql_t;
|
} Sql_t;
|
||||||
|
|
||||||
|
typedef struct NewFriend {
|
||||||
|
DWORD call1;
|
||||||
|
DWORD call2;
|
||||||
|
DWORD handle;
|
||||||
|
} NewFriend_t;
|
||||||
|
|
||||||
typedef struct WxCalls {
|
typedef struct WxCalls {
|
||||||
DWORD login; // 登录状态
|
DWORD login; // 登录状态
|
||||||
UserInfoCall_t ui; // 用户信息
|
UserInfoCall_t ui; // 用户信息
|
||||||
@ -58,6 +64,8 @@ typedef struct WxCalls {
|
|||||||
SendImg_t sendImg; // 发送图片
|
SendImg_t sendImg; // 发送图片
|
||||||
Contact_t contact; // 获取联系人
|
Contact_t contact; // 获取联系人
|
||||||
Sql_t sql; // 执行 SQL
|
Sql_t sql; // 执行 SQL
|
||||||
|
NewFriend_t anf; // 通过好友申请
|
||||||
|
|
||||||
} WxCalls_t;
|
} WxCalls_t;
|
||||||
|
|
||||||
typedef struct TextStruct {
|
typedef struct TextStruct {
|
||||||
|
Loading…
Reference in New Issue
Block a user