未验证 提交 e0edd9ce 编写于 作者: W WangMuDu 提交者: GitHub

Merge branch 'ljc545w:master' into master

......@@ -4,12 +4,17 @@
*.lib
*/Debug/
*/Release/
*/SOCKET_Debug/
*/SOCKET_Release/
*/Win32/
*/x64/
*.rar
/.vs/
/x64
*/x64/
*/obj/
/wxRobot/bin/Debug/
/wxRobot/bin/Release/*.pdb
*/__pycache__/
packages
\ No newline at end of file
packages
mongoose.c
mongoose.h
#include "pch.h"
BOOL CheckFriendStatusInit() {
if (!hProcess)
return 1;
DWORD WeChatRobotBase = GetWeChatRobotBase();
DWORD dwId = 0;
DWORD CheckFriendStatusInitRemoteAddr = WeChatRobotBase + CheckFriendStatusInitRemoteOffset;
HANDLE hThread = CreateRemoteThread(hProcess, NULL, 0, (LPTHREAD_START_ROUTINE)CheckFriendStatusInitRemoteAddr, NULL, 0, &dwId);
if (hThread) {
WaitForSingleObject(hThread, INFINITE);
CloseHandle(hThread);
}
return 0;
}
BOOL CheckFriendStatusFinish() {
if (!hProcess)
return 1;
DWORD WeChatRobotBase = GetWeChatRobotBase();
DWORD dwId = 0;
DWORD CheckFriendStatusFinishRemoteAddr = WeChatRobotBase + CheckFriendStatusFinishRemoteOffset;
HANDLE hThread = CreateRemoteThread(hProcess, NULL, 0, (LPTHREAD_START_ROUTINE)CheckFriendStatusFinishRemoteAddr, NULL, 0, &dwId);
if (hThread) {
WaitForSingleObject(hThread, INFINITE);
CloseHandle(hThread);
}
return 0;
}
DWORD CheckFriendStatus(wchar_t* wxid) {
if (!hProcess)
return 1;
......
#pragma once
#include<windows.h>
BOOL CheckFriendStatusInit();
DWORD CheckFriendStatus(wchar_t* wxid);
BOOL CheckFriendStatusFinish();
\ No newline at end of file
DWORD CheckFriendStatus(wchar_t* wxid);
\ No newline at end of file
......@@ -32,7 +32,7 @@ bool InjectDll(DWORD dwId, WCHAR* szPath)//
return 0;
}
bool Injert(DWORD dwPid,wchar_t* workPath) {
bool Inject(DWORD dwPid,wchar_t* workPath) {
wchar_t* dllpath = new wchar_t[MAX_PATH];
swprintf_s(dllpath, MAX_PATH, L"%ws%ws%ws", workPath, L"\\", dllname);
string name = _com_util::ConvertBSTRToString((BSTR)workPath);
......
#pragma once
#include<windows.h>
bool Injert(DWORD dwPid, wchar_t* workPath);
bool Inject(DWORD dwPid, wchar_t* workPath);
BOOL RemoveDll(DWORD dwId);
\ No newline at end of file
// RobotEvent.cpp: CRobotEvent 的实现
#include "pch.h"
#include "RobotEvent.h"
// CRobotEvent
STDMETHODIMP CRobotEvent::CPostMessage(VARIANT* msg, int* __result)
{
// TODO: 在此处添加实现代码
// 将收到的消息广播给所有用户
Fire_OnGetMessageEvent(msg);
*__result = 0;
return S_OK;
}
// RobotEvent.h: CRobotEvent 的声明
#pragma once
#include "resource.h" // 主符号
#include "WeChatRobotCOM_i.h"
#include "_IRobotEventEvents_CP.h"
using namespace ATL;
// CRobotEvent
class ATL_NO_VTABLE CRobotEvent :
public CComObjectRootEx<CComMultiThreadModel>,
public CComCoClass<CRobotEvent, &CLSID_RobotEvent>,
public IConnectionPointContainerImpl<CRobotEvent>,
public CProxy_IRobotEventEvents<CRobotEvent>,
public IDispatchImpl<IRobotEvent, &IID_IRobotEvent, &LIBID_WeChatRobotCOMLib, /*wMajor =*/ 1, /*wMinor =*/ 0>
{
public:
CRobotEvent()
{
}
DECLARE_REGISTRY_RESOURCEID(107)
DECLARE_CLASSFACTORY_SINGLETON(CRobotEvent)
BEGIN_COM_MAP(CRobotEvent)
COM_INTERFACE_ENTRY(IRobotEvent)
COM_INTERFACE_ENTRY(IDispatch)
COM_INTERFACE_ENTRY(IConnectionPointContainer)
END_COM_MAP()
BEGIN_CONNECTION_POINT_MAP(CRobotEvent)
CONNECTION_POINT_ENTRY(__uuidof(_IRobotEventEvents))
END_CONNECTION_POINT_MAP()
DECLARE_PROTECT_FINAL_CONSTRUCT()
HRESULT FinalConstruct()
{
return S_OK;
}
void FinalRelease()
{
}
public:
STDMETHOD(CPostMessage)(VARIANT* msg, int* __result);
};
OBJECT_ENTRY_AUTO(__uuidof(RobotEvent), CRobotEvent)
HKCR
{
WeChatRobot.RobotEvent.1 = s 'RobotEvent class'
{
CLSID = s '{178001e8-5e64-4cec-8032-1de28801df55}'
}
WeChatRobot.RobotEvent = s 'RobotEvent class'
{
CurVer = s 'WeChatRobot.RobotEvent.1'
}
NoRemove CLSID
{
ForceRemove {178001e8-5e64-4cec-8032-1de28801df55} = s 'RobotEvent class'
{
ProgID = s 'WeChatRobot.RobotEvent.1'
VersionIndependentProgID = s 'WeChatRobot.RobotEvent'
ForceRemove Programmable
LocalServer32 = s '%MODULE%'
{
val ServerExecutable = s '%MODULE_RAW%'
}
TypeLib = s '{721abb35-141a-4aa2-94f2-762e2833fa6c}'
Version = s '1.0'
}
}
}
......@@ -11,6 +11,7 @@ struct SendArticleStruct {
BOOL SendArticle(wchar_t* wxid, wchar_t* title, wchar_t* abstract, wchar_t* url, wchar_t* imgpath) {
if (!hProcess)
return 1;
DWORD WeChatRobotBase = GetWeChatRobotBase();
DWORD dwId = 0;
DWORD dwWriteSize = 0;
......
......@@ -134,14 +134,6 @@ STDMETHODIMP CWeChatRobot::CGetSelfInfo(BSTR* __result) {
return S_OK;
}
/*
* 参数1:预返回的值,调用时无需提供
*/
STDMETHODIMP CWeChatRobot::CCheckFriendStatusInit(int* __result) {
*__result = CheckFriendStatusInit();
return S_OK;
}
/*
* 参数1:查询的wxid
* 参数2:预返回的值,调用时无需提供
......@@ -151,14 +143,6 @@ STDMETHODIMP CWeChatRobot::CCheckFriendStatus(BSTR wxid,int* __result) {
return S_OK;
}
/*
* 参数1:预返回的值,调用时无需提供
*/
STDMETHODIMP CWeChatRobot::CCheckFriendStatusFinish(int* __result) {
*__result = CheckFriendStatusFinish();
return S_OK;
}
/*
* 参数1:预返回的值,调用时无需提供
*/
......
......@@ -63,9 +63,7 @@ public:
STDMETHODIMP CGetFriendListString(BSTR* __result);
STDMETHODIMP CGetWxUserInfo(BSTR wxid, BSTR* __result);
STDMETHODIMP CGetSelfInfo(BSTR* __result);
STDMETHODIMP CCheckFriendStatusInit(int* __result);
STDMETHODIMP CCheckFriendStatus(BSTR wxid, int* __result);
STDMETHODIMP CCheckFriendStatusFinish(int* __result);
STDMETHODIMP CGetComWorkPath(BSTR* __result);
STDMETHODIMP CStartReceiveMessage(int* __result);
STDMETHODIMP CReceiveMessage(VARIANT* __result);
......
......@@ -16,43 +16,52 @@ import "ocidl.idl";
]
interface IWeChatRobot : IDispatch
{
[id(1)] HRESULT CStartRobotService([out, retval] int* __result);
[id(2)] HRESULT CStopRobotService([out, retval] int* __result);
[id(3)] HRESULT CSendText([in] BSTR wxid, [in] BSTR wxmsg, [out, retval] int* __result);
[id(4)] HRESULT CSendImage([in] BSTR wxid, [in] BSTR imagepath, [out, retval] int* __result);
[id(5)] HRESULT CSendFile([in] BSTR wxid, [in] BSTR filepath, [out, retval] int* __result);
[id(6)] HRESULT CSendArticle([in] BSTR wxid, [in] BSTR title, [in] BSTR abstract, [in] BSTR url, [in] BSTR imgpath, [out, retval] int* __result);
[id(7)] HRESULT CSendCard([in] BSTR receiver, [in] BSTR sharedwxid, [in] BSTR nickname, [out, retval] int* __result);
[id(8)] HRESULT CGetFriendList([out, retval] VARIANT* __result);
[id(9)] HRESULT CGetFriendListString([out, retval] BSTR* __result);
[id(10)] HRESULT CGetWxUserInfo([in] BSTR wxid, [out, retval] BSTR* __result);
[id(11)] HRESULT CGetSelfInfo([out, retval] BSTR* __result);
[id(12)] HRESULT CCheckFriendStatusInit([out, retval] int* __result);
[id(13)] HRESULT CCheckFriendStatus([in] BSTR wxid, [out, retval] int* __result);
[id(14)] HRESULT CCheckFriendStatusFinish([out, retval] int* __result);
[id(15)] HRESULT CGetComWorkPath([out, retval] BSTR* __result);
[id(16)] HRESULT CStartReceiveMessage([out, retval] int* __result);
[id(17)] HRESULT CReceiveMessage([out, retval] VARIANT* __result);
[id(18)] HRESULT CStopReceiveMessage([out, retval] int* __result);
[id(19)] HRESULT CSendAtText([in] BSTR chatroomid, [in] VARIANT* wxid, [in] BSTR wxmsg, [in] BOOL AutoNickName, [out, retval] int* __result);
[id(20)] HRESULT CGetChatRoomMembers([in] BSTR chatroomid, [out, retval] VARIANT* __result);
[id(21)] HRESULT CGetDbHandles([out, retval] VARIANT* __result);
[id(22)] HRESULT CExecuteSQL([in] DWORD DbHandle, [in] BSTR sql, [out, retval] VARIANT* __result);
[id(23)] HRESULT CBackupSQLiteDB([in] DWORD DbHandle, [in] BSTR savepath, [out, retval] int* __result);
[id(24)] HRESULT CVerifyFriendApply([in] BSTR v3, [in] BSTR v4, [out, retval] int* __result);
[id(25)] HRESULT CAddFriendByWxid([in] BSTR wxid, [in] BSTR message, [out, retval] int* __result);
[id(26)] HRESULT CAddFriendByV3([in] BSTR v3, [in] BSTR message, [in] int AddType, [out, retval] int* __result);
[id(27)] HRESULT CGetWeChatVer([out, retval] BSTR* __result);
[id(28)] HRESULT CStartWeChat([out, retval] int* __result);
[id(29)] HRESULT CSearchContactByNet([in] BSTR keyword, [out, retval] VARIANT* __result);
[id(30)] HRESULT CAddBrandContact([in] BSTR PublicId, [out, retval] int* __result);
[id(31)] HRESULT CHookVoiceMsg([in] BSTR savepath, [out, retval] int* __result);
[id(32)] HRESULT CUnHookVoiceMsg([out, retval] int* __result);
[id(33)] HRESULT CHookImageMsg([in] BSTR savepath, [out, retval] int* __result);
[id(34)] HRESULT CUnHookImageMsg([out, retval] int* __result);
[id(35)] HRESULT CChangeWeChatVer([in] BSTR verStr, [out, retval] int* __result);
[id(36)] HRESULT CSendAppMsg([in] BSTR wxid, [in] BSTR appid, [out, retval] int* __result);
[id(37)] HRESULT CDeleteUser([in] BSTR wxid, [out, retval] int* __result);
[id(1), helpstring("启动服务")] HRESULT CStartRobotService([out, retval] int* __result);
[id(2), helpstring("关闭服务")] HRESULT CStopRobotService([out, retval] int* __result);
[id(3), helpstring("发送文本")] HRESULT CSendText([in] BSTR wxid, [in] BSTR wxmsg, [out, retval] int* __result);
[id(4), helpstring("发送图片")] HRESULT CSendImage([in] BSTR wxid, [in] BSTR imagepath, [out, retval] int* __result);
[id(5), helpstring("发送文件")] HRESULT CSendFile([in] BSTR wxid, [in] BSTR filepath, [out, retval] int* __result);
[id(6), helpstring("发送XML文章")] HRESULT CSendArticle([in] BSTR wxid, [in] BSTR title, [in] BSTR abstract, [in] BSTR url, [in] BSTR imgpath, [out, retval] int* __result);
[id(7), helpstring("发送名片")] HRESULT CSendCard([in] BSTR receiver, [in] BSTR sharedwxid, [in] BSTR nickname, [out, retval] int* __result);
[id(8), helpstring("获取联系人列表,返回数组")] HRESULT CGetFriendList([out, retval] VARIANT* __result);
[id(9), helpstring("获取联系人列表,返回JSON")] HRESULT CGetFriendListString([out, retval] BSTR* __result);
[id(10), helpstring("wxid查询好友信息")] HRESULT CGetWxUserInfo([in] BSTR wxid, [out, retval] BSTR* __result);
[id(11), helpstring("获取个人信息")] HRESULT CGetSelfInfo([out, retval] BSTR* __result);
[id(13), helpstring("检查是否被好友删除")] HRESULT CCheckFriendStatus([in] BSTR wxid, [out, retval] int* __result);
[id(15), helpstring("获取COM的工作目录")] HRESULT CGetComWorkPath([out, retval] BSTR* __result);
[id(16), helpstring("启动接收消息Hook")] HRESULT CStartReceiveMessage([out, retval] int* __result);
[id(17), helpstring("从Hook缓存中获取一条消息")] HRESULT CReceiveMessage([out, retval] VARIANT* __result);
[id(18), helpstring("停止接收消息Hook")] HRESULT CStopReceiveMessage([out, retval] int* __result);
[id(19), helpstring("发送艾特消息")] HRESULT CSendAtText([in] BSTR chatroomid, [in] VARIANT* wxid, [in] BSTR wxmsg, [in] BOOL AutoNickName, [out, retval] int* __result);
[id(20), helpstring("获取群成员wxid")] HRESULT CGetChatRoomMembers([in] BSTR chatroomid, [out, retval] VARIANT* __result);
[id(21), helpstring("获取数据库句柄")] HRESULT CGetDbHandles([out, retval] VARIANT* __result);
[id(22), helpstring("执行SQL")] HRESULT CExecuteSQL([in] DWORD DbHandle, [in] BSTR sql, [out, retval] VARIANT* __result);
[id(23), helpstring("备份数据库")] HRESULT CBackupSQLiteDB([in] DWORD DbHandle, [in] BSTR savepath, [out, retval] int* __result);
[id(24), helpstring("通过好友请求")] HRESULT CVerifyFriendApply([in] BSTR v3, [in] BSTR v4, [out, retval] int* __result);
[id(25), helpstring("wxid加好友")] HRESULT CAddFriendByWxid([in] BSTR wxid, [in] BSTR message, [out, retval] int* __result);
[id(26), helpstring("v3数据加好友")] HRESULT CAddFriendByV3([in] BSTR v3, [in] BSTR message, [in] int AddType, [out, retval] int* __result);
[id(27), helpstring("获取微信版本号(注册表)")] HRESULT CGetWeChatVer([out, retval] BSTR* __result);
[id(28), helpstring("启动微信")] HRESULT CStartWeChat([out, retval] int* __result);
[id(29), helpstring("网络查询用户信息")] HRESULT CSearchContactByNet([in] BSTR keyword, [out, retval] VARIANT* __result);
[id(30), helpstring("关注公众号")] HRESULT CAddBrandContact([in] BSTR PublicId, [out, retval] int* __result);
[id(31), helpstring("Hook语音消息")] HRESULT CHookVoiceMsg([in] BSTR savepath, [out, retval] int* __result);
[id(32), helpstring("取消Hook语音消息")] HRESULT CUnHookVoiceMsg([out, retval] int* __result);
[id(33), helpstring("Hook图片消息")] HRESULT CHookImageMsg([in] BSTR savepath, [out, retval] int* __result);
[id(34), helpstring("取消Hook图片消息")] HRESULT CUnHookImageMsg([out, retval] int* __result);
[id(35), helpstring("修改微信版本号")] HRESULT CChangeWeChatVer([in] BSTR verStr, [out, retval] int* __result);
[id(36), helpstring("发送小程序")] HRESULT CSendAppMsg([in] BSTR wxid, [in] BSTR appid, [out, retval] int* __result);
[id(37), helpstring("删除好友")] HRESULT CDeleteUser([in] BSTR wxid, [out, retval] int* __result);
};
[
object,
uuid(1a9d8d1b-d40e-4f3a-8ed4-b783e6a59830),
dual,
nonextensible,
pointer_default(unique)
]
interface IRobotEvent : IDispatch
{
[id(1), helpstring("用于微信主动推送消息")] HRESULT CPostMessage([in] VARIANT* msg, [out, retval] int* __result);
};
[
uuid(721abb35-141a-4aa2-94f2-762e2833fa6c),
......@@ -68,6 +77,24 @@ library WeChatRobotCOMLib
{
[default] interface IWeChatRobot;
};
[
uuid(8fd26fd1-9169-4e4c-8a1d-d05093bacce5)
]
dispinterface _IRobotEventEvents
{
properties:
methods:
[id(1), helpstring("连接点回调,需要在客户端实现")] HRESULT OnGetMessageEvent(VARIANT* msg);
};
[
uuid(178001e8-5e64-4cec-8032-1de28801df55)
]
coclass RobotEvent
{
[default] interface IRobotEvent;
[default, source] dispinterface _IRobotEventEvents;
};
};
import "shobjidl.idl";
import "shobjidl.idl";
B// Microsoft Visual C++ generated resource script.
......
......@@ -220,11 +220,12 @@
<ClInclude Include="FriendList.h" />
<ClInclude Include="GetChatRoomMembers.h" />
<ClInclude Include="GetDbHandles.h" />
<ClInclude Include="InjertDll.h" />
<ClInclude Include="InjectDll.h" />
<ClInclude Include="pch.h" />
<ClInclude Include="ReceiveMessage.h" />
<ClInclude Include="Resource.h" />
<ClInclude Include="robotdata.h" />
<ClInclude Include="RobotEvent.h" />
<ClInclude Include="SelfInfo.h" />
<ClInclude Include="SendAppMsg.h" />
<ClInclude Include="SendArticle.h" />
......@@ -240,6 +241,7 @@
<ClInclude Include="WeChatRobotCOM_i.h" />
<ClInclude Include="wechatver.h" />
<ClInclude Include="xdlldata.h" />
<ClInclude Include="_IRobotEventEvents_CP.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="AddBrandContact.cpp" />
......@@ -254,7 +256,7 @@
<ClCompile Include="GetDbHandles.cpp" />
<ClCompile Include="HookImageMessage.cpp" />
<ClCompile Include="HookVoiceMessage.cpp" />
<ClCompile Include="InjertDll.cpp" />
<ClCompile Include="InjectDll.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
......@@ -262,6 +264,7 @@
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="ReceiveMessage.cpp" />
<ClCompile Include="RobotEvent.cpp" />
<ClCompile Include="SearchContactByNet.cpp" />
<ClCompile Include="SelfInfo.cpp" />
<ClCompile Include="SendAppMsg.cpp" />
......@@ -305,6 +308,7 @@
<ResourceCompile Include="WeChatRobotCOM.rc" />
</ItemGroup>
<ItemGroup>
<None Include="RobotEvent.rgs" />
<None Include="WeChatRobot.rgs" />
<None Include="WeChatRobotCOM.rgs" />
</ItemGroup>
......
......@@ -115,7 +115,7 @@
<ClInclude Include="WeChatRobot.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="InjertDll.h">
<ClInclude Include="InjectDll.h">
<Filter>注入工具</Filter>
</ClInclude>
<ClInclude Include="SendImage.h">
......@@ -181,6 +181,12 @@
<ClInclude Include="DeleteUser.h">
<Filter>好友相关\删除好友</Filter>
</ClInclude>
<ClInclude Include="_IRobotEventEvents_CP.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="RobotEvent.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="WeChatRobotCOM.cpp">
......@@ -198,7 +204,7 @@
<ClCompile Include="WeChatRobot.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="InjertDll.cpp">
<ClCompile Include="InjectDll.cpp">
<Filter>注入工具</Filter>
</ClCompile>
<ClCompile Include="SendImage.cpp">
......@@ -276,6 +282,9 @@
<ClCompile Include="DeleteUser.cpp">
<Filter>好友相关\删除好友</Filter>
</ClCompile>
<ClCompile Include="RobotEvent.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="WeChatRobotCOM.rc">
......@@ -289,6 +298,9 @@
<None Include="WeChatRobot.rgs">
<Filter>资源文件</Filter>
</None>
<None Include="RobotEvent.rgs">
<Filter>资源文件</Filter>
</None>
</ItemGroup>
<ItemGroup>
<Midl Include="WeChatRobotCOM.idl">
......
......@@ -69,11 +69,20 @@ typedef IID CLSID;
MIDL_DEFINE_GUID(IID, IID_IWeChatRobot,0xa836e359,0x59b2,0x4e01,0x9b,0x0c,0x0e,0x5a,0x5a,0x2e,0xfa,0x22);
MIDL_DEFINE_GUID(IID, IID_IRobotEvent,0x1a9d8d1b,0xd40e,0x4f3a,0x8e,0xd4,0xb7,0x83,0xe6,0xa5,0x98,0x30);
MIDL_DEFINE_GUID(IID, LIBID_WeChatRobotCOMLib,0x721abb35,0x141a,0x4aa2,0x94,0xf2,0x76,0x2e,0x28,0x33,0xfa,0x6c);
MIDL_DEFINE_GUID(CLSID, CLSID_WeChatRobot,0x4ce7f5e1,0x2c93,0x4bfe,0x86,0xac,0x88,0x64,0x52,0xe4,0x74,0x75);
MIDL_DEFINE_GUID(IID, DIID__IRobotEventEvents,0x8fd26fd1,0x9169,0x4e4c,0x8a,0x1d,0xd0,0x50,0x93,0xba,0xcc,0xe5);
MIDL_DEFINE_GUID(CLSID, CLSID_RobotEvent,0x178001e8,0x5e64,0x4cec,0x80,0x32,0x1d,0xe2,0x88,0x01,0xdf,0x55);
#undef MIDL_DEFINE_GUID
#ifdef __cplusplus
......
此差异已折叠。
此差异已折叠。
#pragma once
template<class T>
class CProxy_IRobotEventEvents :
public ATL::IConnectionPointImpl<T, &__uuidof(_IRobotEventEvents)>
{
public:
HRESULT Fire_OnGetMessageEvent(VARIANT* msg)
{
HRESULT hr = S_OK;
T* pThis = static_cast<T*>(this);
int cConnections = m_vec.GetSize();
for (int iConnection = 0; iConnection < cConnections; iConnection++)
{
pThis->Lock();
CComPtr<IUnknown> punkConnection = m_vec.GetAt(iConnection);
pThis->Unlock();
IDispatch* pConnection = static_cast<IDispatch*>(punkConnection.p);
if (pConnection)
{
/*CComVariant avarParams[1];
avarParams[0] = msg;
avarParams[0].vt = msg->vt;*/
CComVariant varResult;
DISPPARAMS params = { msg, NULL, 1, 0 };
hr = pConnection->Invoke(1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &params, &varResult, NULL, NULL);
}
}
return hr;
}
};
......@@ -24,9 +24,7 @@ DWORD SearchContactByNetRemoteOffset = 0x0;
DWORD VerifyFriendApplyOffset = 0x0;
DWORD CheckFriendStatusInitRemoteOffset = 0x0;
DWORD CheckFriendStatusRemoteOffset = 0x0;
DWORD CheckFriendStatusFinishRemoteOffset = 0x0;
DWORD HookReceiveMessageRemoteOffset = 0x0;
DWORD UnHookReceiveMessageRemoteOffset = 0x0;
......@@ -149,12 +147,8 @@ BOOL GetProcOffset(wchar_t* workPath) {
DWORD SearchContactByNetRemoteAddr = (DWORD)GetProcAddress(hd, SearchContactByNetRemote);
SearchContactByNetRemoteOffset = SearchContactByNetRemoteAddr - WeChatBase;
DWORD CheckFriendStatusInitRemoteAddr = (DWORD)GetProcAddress(hd, CheckFriendStatusInitRemote);
CheckFriendStatusInitRemoteOffset = CheckFriendStatusInitRemoteAddr - WeChatBase;
DWORD CheckFriendStatusRemoteAddr = (DWORD)GetProcAddress(hd, CheckFriendStatusRemote);
CheckFriendStatusRemoteOffset = CheckFriendStatusRemoteAddr - WeChatBase;
DWORD CheckFriendStatusFinishRemoteAddr = (DWORD)GetProcAddress(hd, CheckFriendStatusFinishRemote);
CheckFriendStatusFinishRemoteOffset = CheckFriendStatusFinishRemoteAddr - WeChatBase;
DWORD HookReceiveMessageRemoteAddr = (DWORD)GetProcAddress(hd, HookReceiveMessageRemote);
HookReceiveMessageRemoteOffset = HookReceiveMessageRemoteAddr - WeChatBase;
......@@ -231,7 +225,7 @@ DWORD StartRobotService() {
};
if(!hProcess)
hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, wxPid);
bool status = Injert(wxPid, workPath);
bool status = Inject(wxPid, workPath);
if (status == 1) {
CloseHandle(hProcess);
hProcess = NULL;
......
......@@ -5,6 +5,7 @@
#define IDS_PROJNAME 100
#define IDR_WECHATROBOTCOM 101
#define IDR_WECHATROBOT 106
#define IDR_ROBOTEVENT 107
// Next default values for new objects
//
......@@ -13,6 +14,6 @@
#define _APS_NEXT_RESOURCE_VALUE 201
#define _APS_NEXT_COMMAND_VALUE 32768
#define _APS_NEXT_CONTROL_VALUE 201
#define _APS_NEXT_SYMED_VALUE 107
#define _APS_NEXT_SYMED_VALUE 108
#endif
#endif
#pragma once
#include "InjertDll.h"
#include "InjectDll.h"
#include "SendImage.h"
#include "SendText.h"
#include "SendFile.h"
......@@ -44,9 +44,7 @@ extern DWORD GetSelfInfoOffset;
extern DWORD DeleteSelfInfoCacheOffset;
extern wstring SelfInfoString;
extern DWORD CheckFriendStatusInitRemoteOffset;
extern DWORD CheckFriendStatusRemoteOffset;
extern DWORD CheckFriendStatusFinishRemoteOffset;
extern DWORD HookReceiveMessageRemoteOffset;
extern DWORD UnHookReceiveMessageRemoteOffset;
......@@ -96,9 +94,7 @@ extern DWORD ChangeWeChatVerRemoteOffset;
#define VerifyFriendApplyRemote "VerifyFriendApplyRemote"
#define CheckFriendStatusInitRemote "CheckFriendStatusInitRemote"
#define CheckFriendStatusRemote "CheckFriendStatusRemote"
#define CheckFriendStatusFinishRemote "CheckFriendStatusFinishRemote"
#define HookReceiveMessageRemote "HookReceiveMessage"
#define UnHookReceiveMessageRemote "UnHookReceiveMessage"
......
......@@ -20,6 +20,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CSharp", "CSharp", "{4DE1F6
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "wxRobot", "wxRobot\wxRobot.csproj", "{10504CFA-6D19-4A97-8728-11BCE6C2499F}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxDriver", "wxDriver\wxDriver.vcxproj", "{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
......@@ -28,6 +30,12 @@ Global
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
SOCKET_DEBUG|Any CPU = SOCKET_DEBUG|Any CPU
SOCKET_DEBUG|x64 = SOCKET_DEBUG|x64
SOCKET_DEBUG|x86 = SOCKET_DEBUG|x86
SOCKET_Release|Any CPU = SOCKET_Release|Any CPU
SOCKET_Release|x64 = SOCKET_Release|x64
SOCKET_Release|x86 = SOCKET_Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F54A8A7E-C2C0-4FD8-B625-59C77FF613BA}.Debug|Any CPU.ActiveCfg = Debug|Win32
......@@ -40,6 +48,18 @@ Global
{F54A8A7E-C2C0-4FD8-B625-59C77FF613BA}.Release|x64.Build.0 = Release|x64
{F54A8A7E-C2C0-4FD8-B625-59C77FF613BA}.Release|x86.ActiveCfg = Release|Win32
{F54A8A7E-C2C0-4FD8-B625-59C77FF613BA}.Release|x86.Build.0 = Release|Win32
{F54A8A7E-C2C0-4FD8-B625-59C77FF613BA}.SOCKET_DEBUG|Any CPU.ActiveCfg = Release|x64
{F54A8A7E-C2C0-4FD8-B625-59C77FF613BA}.SOCKET_DEBUG|Any CPU.Build.0 = Release|x64
{F54A8A7E-C2C0-4FD8-B625-59C77FF613BA}.SOCKET_DEBUG|x64.ActiveCfg = Release|x64
{F54A8A7E-C2C0-4FD8-B625-59C77FF613BA}.SOCKET_DEBUG|x64.Build.0 = Release|x64
{F54A8A7E-C2C0-4FD8-B625-59C77FF613BA}.SOCKET_DEBUG|x86.ActiveCfg = Release|Win32
{F54A8A7E-C2C0-4FD8-B625-59C77FF613BA}.SOCKET_DEBUG|x86.Build.0 = Release|Win32
{F54A8A7E-C2C0-4FD8-B625-59C77FF613BA}.SOCKET_Release|Any CPU.ActiveCfg = Release|x64
{F54A8A7E-C2C0-4FD8-B625-59C77FF613BA}.SOCKET_Release|Any CPU.Build.0 = Release|x64
{F54A8A7E-C2C0-4FD8-B625-59C77FF613BA}.SOCKET_Release|x64.ActiveCfg = Release|x64
{F54A8A7E-C2C0-4FD8-B625-59C77FF613BA}.SOCKET_Release|x64.Build.0 = Release|x64
{F54A8A7E-C2C0-4FD8-B625-59C77FF613BA}.SOCKET_Release|x86.ActiveCfg = Release|Win32
{F54A8A7E-C2C0-4FD8-B625-59C77FF613BA}.SOCKET_Release|x86.Build.0 = Release|Win32
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.Debug|Any CPU.ActiveCfg = Debug|Win32
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.Debug|x64.ActiveCfg = Debug|x64
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.Debug|x64.Build.0 = Debug|x64
......@@ -50,6 +70,18 @@ Global
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.Release|x64.Build.0 = Release|x64
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.Release|x86.ActiveCfg = Release|Win32
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.Release|x86.Build.0 = Release|Win32
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.SOCKET_DEBUG|Any CPU.ActiveCfg = Release|x64
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.SOCKET_DEBUG|Any CPU.Build.0 = Release|x64
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.SOCKET_DEBUG|x64.ActiveCfg = Release|x64
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.SOCKET_DEBUG|x64.Build.0 = Release|x64
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.SOCKET_DEBUG|x86.ActiveCfg = Release|Win32
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.SOCKET_DEBUG|x86.Build.0 = Release|Win32
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.SOCKET_Release|Any CPU.ActiveCfg = Release|x64
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.SOCKET_Release|Any CPU.Build.0 = Release|x64
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.SOCKET_Release|x64.ActiveCfg = Release|x64
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.SOCKET_Release|x64.Build.0 = Release|x64
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.SOCKET_Release|x86.ActiveCfg = Release|Win32
{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.SOCKET_Release|x86.Build.0 = Release|Win32
{C0FC8DAB-0590-46AC-9270-6FEA45D52390}.Debug|Any CPU.ActiveCfg = Debug|Win32
{C0FC8DAB-0590-46AC-9270-6FEA45D52390}.Debug|x64.ActiveCfg = Debug|x64
{C0FC8DAB-0590-46AC-9270-6FEA45D52390}.Debug|x64.Build.0 = Debug|x64
......@@ -60,6 +92,16 @@ Global
{C0FC8DAB-0590-46AC-9270-6FEA45D52390}.Release|x64.Build.0 = Release|x64
{C0FC8DAB-0590-46AC-9270-6FEA45D52390}.Release|x86.ActiveCfg = Release|Win32
{C0FC8DAB-0590-46AC-9270-6FEA45D52390}.Release|x86.Build.0 = Release|Win32
{C0FC8DAB-0590-46AC-9270-6FEA45D52390}.SOCKET_DEBUG|Any CPU.ActiveCfg = SOCKET_Debug|Win32
{C0FC8DAB-0590-46AC-9270-6FEA45D52390}.SOCKET_DEBUG|x64.ActiveCfg = SOCKET_Debug|x64
{C0FC8DAB-0590-46AC-9270-6FEA45D52390}.SOCKET_DEBUG|x64.Build.0 = SOCKET_Debug|x64
{C0FC8DAB-0590-46AC-9270-6FEA45D52390}.SOCKET_DEBUG|x86.ActiveCfg = SOCKET_Debug|Win32
{C0FC8DAB-0590-46AC-9270-6FEA45D52390}.SOCKET_DEBUG|x86.Build.0 = SOCKET_Debug|Win32
{C0FC8DAB-0590-46AC-9270-6FEA45D52390}.SOCKET_Release|Any CPU.ActiveCfg = SOCKET_Release|Win32
{C0FC8DAB-0590-46AC-9270-6FEA45D52390}.SOCKET_Release|x64.ActiveCfg = SOCKET_Release|x64
{C0FC8DAB-0590-46AC-9270-6FEA45D52390}.SOCKET_Release|x64.Build.0 = SOCKET_Release|x64
{C0FC8DAB-0590-46AC-9270-6FEA45D52390}.SOCKET_Release|x86.ActiveCfg = SOCKET_Release|Win32
{C0FC8DAB-0590-46AC-9270-6FEA45D52390}.SOCKET_Release|x86.Build.0 = SOCKET_Release|Win32
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.Debug|x64.ActiveCfg = Debug|Any CPU
......@@ -72,6 +114,40 @@ Global
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.Release|x64.Build.0 = Release|Any CPU
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.Release|x86.ActiveCfg = Release|Any CPU
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.Release|x86.Build.0 = Release|Any CPU
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.SOCKET_DEBUG|Any CPU.ActiveCfg = Release|Any CPU
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.SOCKET_DEBUG|Any CPU.Build.0 = Release|Any CPU
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.SOCKET_DEBUG|x64.ActiveCfg = Release|Any CPU
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.SOCKET_DEBUG|x64.Build.0 = Release|Any CPU
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.SOCKET_DEBUG|x86.ActiveCfg = Release|Any CPU
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.SOCKET_DEBUG|x86.Build.0 = Release|Any CPU
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.SOCKET_Release|Any CPU.ActiveCfg = Release|Any CPU
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.SOCKET_Release|Any CPU.Build.0 = Release|Any CPU
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.SOCKET_Release|x64.ActiveCfg = Release|Any CPU
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.SOCKET_Release|x64.Build.0 = Release|Any CPU
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.SOCKET_Release|x86.ActiveCfg = Release|Any CPU
{10504CFA-6D19-4A97-8728-11BCE6C2499F}.SOCKET_Release|x86.Build.0 = Release|Any CPU
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.Debug|Any CPU.ActiveCfg = Debug|Win32
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.Debug|x64.ActiveCfg = Debug|x64
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.Debug|x64.Build.0 = Debug|x64
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.Debug|x86.ActiveCfg = Debug|Win32
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.Debug|x86.Build.0 = Debug|Win32
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.Release|Any CPU.ActiveCfg = Release|Win32
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.Release|x64.ActiveCfg = Release|x64
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.Release|x64.Build.0 = Release|x64
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.Release|x86.ActiveCfg = Release|Win32
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.Release|x86.Build.0 = Release|Win32
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.SOCKET_DEBUG|Any CPU.ActiveCfg = Debug|Win32
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.SOCKET_DEBUG|Any CPU.Build.0 = Debug|Win32
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.SOCKET_DEBUG|x64.ActiveCfg = Debug|x64
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.SOCKET_DEBUG|x64.Build.0 = Debug|x64
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.SOCKET_DEBUG|x86.ActiveCfg = Debug|Win32
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.SOCKET_DEBUG|x86.Build.0 = Debug|Win32
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.SOCKET_Release|Any CPU.ActiveCfg = Debug|Win32
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.SOCKET_Release|Any CPU.Build.0 = Debug|Win32
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.SOCKET_Release|x64.ActiveCfg = Release|x64
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.SOCKET_Release|x64.Build.0 = Release|x64
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.SOCKET_Release|x86.ActiveCfg = Release|Win32
{B8740C2A-CBE7-4873-9669-E0DFEC4A3B8D}.SOCKET_Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
......@@ -53,7 +53,9 @@ BOOL __stdcall AddBrandContact(wchar_t* PublicId) {
return isSuccess;
}
#ifndef USE_SOCKET
BOOL AddBrandContactRemote(LPVOID lpParameter) {
int isSuccess = AddBrandContact((wchar_t*)lpParameter);
return isSuccess;
}
\ No newline at end of file
}
#endif
\ No newline at end of file
......@@ -4,6 +4,8 @@
BOOL __stdcall AddFriendByV3(wchar_t* v3, wchar_t* message,int AddType);
BOOL __stdcall AddFriendByWxid(wchar_t* wxid, wchar_t* message);
BOOL __stdcall AddBrandContact(wchar_t* PublicId);
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) BOOL AddFriendByV3Remote(LPVOID lpParameter);
extern "C" __declspec(dllexport) BOOL AddFriendByWxidRemote(LPVOID lpParameter);
extern "C" __declspec(dllexport) BOOL AddBrandContactRemote(LPVOID lpParameter);
\ No newline at end of file
extern "C" __declspec(dllexport) BOOL AddBrandContactRemote(LPVOID lpParameter);
#endif
\ No newline at end of file
......@@ -21,17 +21,21 @@ struct AddFriendByV3ParamStruct {
char nullbuffer[0xC] = { 0 };
};
#ifndef USE_SOCKET
struct AddFriendByV3Struct {
wchar_t* wxid;
wchar_t* message;
int AddType;
};
#endif
#ifndef USE_SOCKET
BOOL AddFriendByV3Remote(LPVOID lpParameter) {
AddFriendByV3Struct* afbvs = (AddFriendByV3Struct*)lpParameter;
BOOL isSuccess = AddFriendByV3(afbvs->wxid, afbvs->message,afbvs->AddType);
return isSuccess;
}
#endif
BOOL __stdcall AddFriendByV3(wchar_t* v3, wchar_t* message,int AddType) {
DWORD WeChatWinBase = GetWeChatWinBase();
......
......@@ -21,16 +21,20 @@ struct AddFriendByWxidParamStruct {
char nullbuffer[0xC] = { 0 };
};
#ifndef USE_SOCKET
struct AddFriendByWxidStruct {
wchar_t* wxid;
wchar_t* message;
};
#endif
#ifndef USE_SOCKET
BOOL AddFriendByWxidRemote(LPVOID lpParameter) {
AddFriendByWxidStruct* afbws = (AddFriendByWxidStruct*)lpParameter;
BOOL isSuccess = AddFriendByWxid(afbws->wxid, afbws->message);
return isSuccess;
}
#endif
BOOL __stdcall AddFriendByWxid(wchar_t* wxid,wchar_t* message) {
DWORD WeChatWinBase = GetWeChatWinBase();
......
......@@ -98,16 +98,9 @@ VOID UnHookFriendStatusCode() {
CheckFriendStatusHooked = false;
}
#ifndef USE_SOCKET
/*
* 供外部调用的检查好友状态接口1,启动HOOK
* return:void
*/
VOID CheckFriendStatusInitRemote() {
HookFriendStatusCode();
}
/*
* 供外部调用的检查好友状态接口2,检查并返回状态码
* 供外部调用的检查好友状态接口,检查并返回状态码
* lparameter:要检查的联系人wxid保存地址
* return:DWORD,好友状态码
*/
......@@ -115,14 +108,7 @@ DWORD CheckFriendStatusRemote(LPVOID lparameter) {
CheckFriendStatus((wchar_t*)lparameter);
return LocalFriendStatus;
}
/*
* 供外部调用的检查好友状态接口3,取消HOOK
* return:void
*/
VOID CheckFriendStatusFinishRemote() {
UnHookFriendStatusCode();
}
#endif
/*
* 检查好友状态的具体实现
......@@ -130,6 +116,8 @@ VOID CheckFriendStatusFinishRemote() {
* return:void
*/
VOID __stdcall CheckFriendStatus(wchar_t* wxid) {
if (!CheckFriendStatusHooked)
HookFriendStatusCode();
LocalFriendStatus = 0x0;
DWORD WeChatWinBase = GetWeChatWinBase();
DWORD CheckFriendStatusCall1 = WeChatWinBase + CheckFriendStatusCall1Offset;
......
#pragma once
#include<windows.h>
extern "C" __declspec(dllexport) VOID CheckFriendStatusInitRemote();
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) DWORD CheckFriendStatusRemote(LPVOID lparameter);
extern "C" __declspec(dllexport) VOID CheckFriendStatusFinishRemote();
VOID __stdcall CheckFriendStatus(wchar_t* wxid);
\ No newline at end of file
#endif
VOID __stdcall CheckFriendStatus(wchar_t* wxid);
VOID UnHookFriendStatusCode();
VOID HookFriendStatusCode();
\ No newline at end of file
......@@ -17,6 +17,22 @@
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="SOCKET_Debug|Win32">
<Configuration>SOCKET_Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="SOCKET_Debug|x64">
<Configuration>SOCKET_Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="SOCKET_Release|Win32">
<Configuration>SOCKET_Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="SOCKET_Release|x64">
<Configuration>SOCKET_Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
......@@ -33,6 +49,12 @@
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='SOCKET_Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
......@@ -40,12 +62,25 @@
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='SOCKET_Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='SOCKET_Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
......@@ -53,6 +88,13 @@
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='SOCKET_Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
......@@ -61,30 +103,62 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='SOCKET_Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='SOCKET_Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='SOCKET_Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='SOCKET_Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<TargetName>$(ProjectName)</TargetName>
<IncludePath>$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='SOCKET_Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<TargetName>SWeChatRobot</TargetName>
<IncludePath>$(IncludePath)</IncludePath>
<IntDir>$(Configuration)\</IntDir>
<OutDir>$(SolutionDir)Debug\socket\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<TargetName>$(ProjectName)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='SOCKET_Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<TargetName>SWeChatRobot</TargetName>
<IntDir>$(Configuration)\</IntDir>
<OutDir>$(SolutionDir)Release\socket\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='SOCKET_Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='SOCKET_Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
......@@ -100,6 +174,22 @@
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='SOCKET_Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;MYWECHATROBOT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<AdditionalOptions>/D "USE_SOCKET" /D "_CRT_SECURE_NO_WARNINGS" %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
......@@ -119,6 +209,26 @@
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='SOCKET_Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;MYWECHATROBOT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<AdditionalOptions>/D "USE_SOCKET" /D "_CRT_SECURE_NO_WARNINGS" %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
......@@ -134,6 +244,21 @@
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='SOCKET_Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;MYWECHATROBOT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
......@@ -153,8 +278,28 @@
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='SOCKET_Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;MYWECHATROBOT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="AddFriend.h" />
<ClInclude Include="comclient.h" />
<ClInclude Include="CheckFriendStatus.h" />
<ClInclude Include="DbBackup.h" />
<ClInclude Include="DbExecuteSql.h" />
......@@ -178,12 +323,16 @@
<ClInclude Include="sqlite3.h" />
<ClInclude Include="VerifyFriendApply.h" />
<ClInclude Include="wechatver.h" />
<ClInclude Include="wxapi.h" />
<ClInclude Include="wxdata.h" />
<ClInclude Include="wxsocketapi.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="AddFriendByV3.cpp" />
<ClCompile Include="AddFriendByWxid.cpp" />
<ClCompile Include="AddBrandContact.cpp" />
<ClCompile Include="CheckFriendStatus.cpp" />
<ClCompile Include="comclient.cpp" />
<ClCompile Include="DbBackup.cpp" />
<ClCompile Include="DbExecuteSql.cpp" />
<ClCompile Include="DeleteUser.cpp" />
......@@ -195,9 +344,13 @@
<ClCompile Include="HookVoiceMessage.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='SOCKET_Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='SOCKET_Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='SOCKET_Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='SOCKET_Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="ReceiveMessage.cpp" />
<ClCompile Include="SearchContactByNet.cpp" />
......@@ -213,6 +366,7 @@
<ClCompile Include="LogMsgInfo.cpp" />
<ClCompile Include="VerifyFriendApply.cpp" />
<ClCompile Include="wechatver.cpp" />
<ClCompile Include="wxsocket.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
......
......@@ -25,9 +25,6 @@
<Filter Include="发送消息\发送文件">
<UniqueIdentifier>{069b8c09-e473-4bba-a49e-571f35f2efef}</UniqueIdentifier>
</Filter>
<Filter Include="自动功能">
<UniqueIdentifier>{25f77de8-b12c-4f2b-a3ac-0260b6a16897}</UniqueIdentifier>
</Filter>
<Filter Include="好友相关">
<UniqueIdentifier>{8ad1ff87-550b-4942-8ebd-afbe1cfaddc9}</UniqueIdentifier>
</Filter>
......@@ -91,6 +88,12 @@
<Filter Include="发送消息\发送小程序">
<UniqueIdentifier>{2e1bef8d-a840-4318-a728-29f1e8e68336}</UniqueIdentifier>
</Filter>
<Filter Include="wxsocket">
<UniqueIdentifier>{aa631fe9-d228-4c2b-a317-0b0914bed451}</UniqueIdentifier>
</Filter>
<Filter Include="comclient">
<UniqueIdentifier>{79c2ec41-70f9-445a-8681-5a2dbfe01eca}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="framework.h">
......@@ -165,6 +168,18 @@
<ClInclude Include="SendAppMsg.h">
<Filter>发送消息\发送小程序</Filter>
</ClInclude>
<ClInclude Include="comclient.h">
<Filter>comclient</Filter>
</ClInclude>
<ClInclude Include="wxsocketapi.h">
<Filter>wxsocket</Filter>
</ClInclude>
<ClInclude Include="wxdata.h">
<Filter>通用标头</Filter>
</ClInclude>
<ClInclude Include="wxapi.h">
<Filter>通用标头</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp">
......@@ -251,5 +266,11 @@
<ClCompile Include="SendAppMsg.cpp">
<Filter>发送消息\发送小程序</Filter>
</ClCompile>
<ClCompile Include="wxsocket.cpp">
<Filter>wxsocket</Filter>
</ClCompile>
<ClCompile Include="comclient.cpp">
<Filter>comclient</Filter>
</ClCompile>
</ItemGroup>
</Project>
\ No newline at end of file
......@@ -4,5 +4,11 @@
<LocalDebuggerCommandArguments>
</LocalDebuggerCommandArguments>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerCommand>D:\Tencent\WeChat\WeChat.exe</LocalDebuggerCommand>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='SOCKET_Debug|Win32'">
<LocalDebuggerCommandArguments />
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerCommand>D:\Tencent\WeChat\WeChat.exe</LocalDebuggerCommand>
</PropertyGroup>
</Project>
\ No newline at end of file
......@@ -2,6 +2,18 @@
BOOL SQLite3_Backup_Init_Patched = FALSE;
/*
* 外部调用时传递的参数类型
* DbHandle:要备份的数据库句柄
* BackupFile:备份的保存位置
*/
#ifndef USE_SOCKET
struct BackupStruct {
DWORD DbHandle;
char* BackupFile;
};
#endif
/*
* 数据库备份函数
* return:int,无异常返回`0`,有异常返回非0值
......@@ -136,8 +148,10 @@ int BackupSQLiteDB(DWORD DbHandle,const char* BackupFile)
* lpParameter:`BackupStruct`类型结构体指针
* return:int,无异常返回`0`,有异常返回非0值
*/
#ifndef USE_SOCKET
int BackupSQLiteDBRemote(LPVOID lpParameter) {
BackupStruct* param = (BackupStruct*)lpParameter;
int rc = BackupSQLiteDB(param->DbHandle,(const char*)param->BackupFile);
return rc;
}
\ No newline at end of file
}
#endif
\ No newline at end of file
#pragma once
#include<windows.h>
/*
* 外部调用时传递的参数类型
* DbHandle:要备份的数据库句柄
* BackupFile:备份的保存位置
*/
struct BackupStruct {
DWORD DbHandle;
char* BackupFile;
};
int BackupSQLiteDB(DWORD DbHandle, const char* BackupFile);
extern "C" __declspec(dllexport) int BackupSQLiteDBRemote(LPVOID lpParameter);
\ No newline at end of file
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) int BackupSQLiteDBRemote(LPVOID lpParameter);
#endif
\ No newline at end of file
......@@ -26,10 +26,12 @@ DWORD sqlite3_execAddr = WeChatWinBase + OffsetFromIdaAddr(IDA_SQLITE3_EXEC_ADDR
* ptrDb:数据库句柄
* ptrSql:保存sql的地址
*/
#ifndef USE_SOCKET
struct executeParams {
DWORD ptrDb;
DWORD ptrSql;
};
#endif
/*
* 保存查询结果的结构
......@@ -122,7 +124,7 @@ int query(void* data, int argc, char** argv, char** azColName) {
* 外部调用时使用的回调函数,将结果存入`SQLResult`中
* return:int,执行成功返回`0`,执行失败返回非0值
*/
int select(void* data, int argc, char** argv, char** azColName) {
int selectdbinfo(void* data, int argc, char** argv, char** azColName) {
executeResult* pdata = (executeResult*)data;
vector<SQLResultStruct> tempStruct;
for (int i = 0; i < argc; i++) {
......@@ -179,12 +181,14 @@ void ClearResultArray() {
* sql:要执行的SQL
* callback:回调函数地址
* data:传递给回调函数的参数
* return:BOOL,执行成功返回`1`,执行失败返回`0`
* return:void*,执行成功返回数组指针,执行失败返回`0`
*/
BOOL ExecuteSQL(DWORD ptrDb,const char* sql,DWORD callback,void* data) {
void* ExecuteSQL(DWORD ptrDb,const char* sql,DWORD callback,void* data) {
Sqlite3_exec p_Sqlite3_exec = (Sqlite3_exec)sqlite3_execAddr;
int status = p_Sqlite3_exec(ptrDb,sql, (sqlite3_callback)callback,data,0);
return status == 0;
if (status != SQLITE_OK)
return NULL;
return SQLResult.data();
}
/*
......@@ -192,12 +196,13 @@ BOOL ExecuteSQL(DWORD ptrDb,const char* sql,DWORD callback,void* data) {
* lpParameter:`executeParams`类型结构体指针
* return:DWORD,如果SQL执行成功,返回`SQLResult`首成员地址,否则返回0
*/
#ifndef USE_SOCKET
DWORD ExecuteSQLRemote(LPVOID lpParameter){
ClearResultArray();
executeParams* sqlparam = (executeParams*)lpParameter;
BOOL status = ExecuteSQL(sqlparam->ptrDb, (const char*)sqlparam->ptrSql, (DWORD)select, &result);
void* status = ExecuteSQL(sqlparam->ptrDb, (const char*)sqlparam->ptrSql, (DWORD)selectdbinfo, &result);
if (status) {
if (status != NULL) {
result.SQLResultAddr = (DWORD)SQLResult.data();
return (DWORD)&result;
}
......@@ -206,8 +211,9 @@ DWORD ExecuteSQLRemote(LPVOID lpParameter){
}
return 0;
}
#endif
static BOOL SelectData(DWORD db,const char* sql,void* data)
void* SelectData(DWORD db,const char* sql,void* data)
{
executeResult* pdata = (executeResult*)data;
DWORD wxBaseAddress = GetWeChatWinBase();
......@@ -222,7 +228,7 @@ static BOOL SelectData(DWORD db,const char* sql,void* data)
DWORD* stmt;
int rc = p_Sqlite3_prepare(db, sql, -1, &stmt, 0);
if (rc != SQLITE_OK)
return rc;
return NULL;
while (p_Sqlite3_step(stmt) == SQLITE_ROW)
{
int col_count = p_Sqlite3_column_count(stmt);
......@@ -264,15 +270,16 @@ static BOOL SelectData(DWORD db,const char* sql,void* data)
pdata->length++;
}
p_Sqlite3_finalize(stmt);
return rc == 0;
return SQLResult.data();
}
#ifndef USE_SOCKET
int SelectDataRemote(LPVOID lpParameter) {
ClearResultArray();
executeParams* sqlparam = (executeParams*)lpParameter;
BOOL status = SelectData(sqlparam->ptrDb, (const char*)sqlparam->ptrSql, &result);
void* status = SelectData(sqlparam->ptrDb, (const char*)sqlparam->ptrSql, &result);
if (status) {
if (status != NULL) {
result.SQLResultAddr = (DWORD)SQLResult.data();
return (DWORD)&result;
}
......@@ -280,4 +287,5 @@ int SelectDataRemote(LPVOID lpParameter) {
result.length = 0;
}
return 0;
}
\ No newline at end of file
}
#endif
\ No newline at end of file
......@@ -2,9 +2,11 @@
#include<windows.h>
int GetDbInfo(void* data, int argc, char** argv, char** azColName);
int select(void* data, int argc, char** argv, char** azColName);
int selectdbinfo(void* data, int argc, char** argv, char** azColName);
int query(void* data, int argc, char** argv, char** azColName);
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) DWORD ExecuteSQLRemote(LPVOID lpParameter);
extern "C" __declspec(dllexport) int SelectDataRemote(LPVOID lpParameter);
BOOL ExecuteSQL(DWORD ptrDb, const char* sql, DWORD callback, void* data);
\ No newline at end of file
#endif
void* ExecuteSQL(DWORD ptrDb, const char* sql, DWORD callback, void* data);
void* SelectData(DWORD db, const char* sql, void* data);
\ No newline at end of file
......@@ -31,7 +31,9 @@ BOOL __stdcall DeleteUser(wchar_t* wxid) {
return isSuccess;
}
#ifndef USE_SOCKET
BOOL DeleteUserRemote(LPVOID lpParameter) {
BOOL isSuccess = DeleteUser((wchar_t*)lpParameter);
return isSuccess;
}
\ No newline at end of file
}
#endif
\ No newline at end of file
#pragma once
#include<windows.h>
BOOL __stdcall DeleteUser(wchar_t* wxid);
extern "C" __declspec(dllexport) BOOL DeleteUserRemote(LPVOID lpParameter);
\ No newline at end of file
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) BOOL DeleteUserRemote(LPVOID lpParameter);
#endif
\ No newline at end of file
......@@ -4,29 +4,8 @@
// 通讯录左树偏移
#define LeftTreeOffset 0x23638F4
/*
* 保存单个好友信息的结构体
* wxIdAddr:wxid保存地址
* wxNumberAddr:微信号保存地址
* wxNickNameAddr:昵称保存地址
* wxRemarkAddr:备注保存地址
* WxFriendStructW:默认构造函数
*/
struct WxFriendStructW {
DWORD wxIdAddr;
DWORD wxNumberAddr;
DWORD wxNickNameAddr;
DWORD wxRemarkAddr;
WxFriendStructW(DWORD wxIdAddr, DWORD wxNumberAddr, DWORD wxNickNameAddr, DWORD wxRemarkAddr) {
this->wxIdAddr = wxIdAddr;
this->wxNumberAddr = wxNumberAddr;
this->wxNickNameAddr = wxNickNameAddr;
this->wxRemarkAddr = wxRemarkAddr;
}
};
// 保存所有好友信息的动态数组
vector<WxFriendStructW> WxFriendList;
vector<WxFriendStruct> WxFriendList;
/*
* 供外部调用的获取好友列表接口1
......@@ -37,15 +16,16 @@ int GetFriendListInit() {
#ifdef _DEBUG
cout << WxFriendList.size() << endl;
#endif
return WxFriendList.size();
return WxFriendList.size() == 0 ? 0 : WxFriendList.size() - 1;
}
#ifndef USE_SOCKET
/*
* 供外部调用的获取好友列表接口2
* return:DWORD,WxFriendList第一个成员地址
*/
DWORD GetFriendListRemote() {
if (WxFriendList.size() == 0)
if (WxFriendList.size() == 0 || WxFriendList.size() - 1 == 0)
return 0;
#ifdef _DEBUG
printf("0x%08X\n", (DWORD)&WxFriendList[0]);
......@@ -62,12 +42,12 @@ void GetFriendListFinish() {
WxFriendList.clear();
cout << WxFriendList.size() << endl;
}
#endif
/*
* 获取好友列表的具体实现
* return:void
*/
void __stdcall GetFriendList() {
WxFriendStruct* __stdcall GetFriendList() {
#ifdef _DEBUG
wcout.imbue(locale("chs"));
#endif
......@@ -114,7 +94,7 @@ void __stdcall GetFriendList() {
mov LeftTreeAddr, ecx;
popad;
}
WxFriendStructW p(wxIdAddr, wxNumberAddr, wxNickNameAddr, wxRemarkAddr);
WxFriendStruct p(wxIdAddr, wxNumberAddr, wxNickNameAddr, wxRemarkAddr);
WxFriendList.push_back(p);
#ifdef _DEBUG
wcout << (wchar_t*)(*(DWORD*)p.wxIdAddr) << endl;
......@@ -123,4 +103,7 @@ void __stdcall GetFriendList() {
break;
}
}
WxFriendStruct nullp(NULL, NULL, NULL, NULL);
WxFriendList.push_back(nullp);
return WxFriendList.data();
}
\ No newline at end of file
#pragma once
void __stdcall GetFriendList();
WxFriendStruct* __stdcall GetFriendList();
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) DWORD GetFriendListRemote();
extern "C" __declspec(dllexport) int GetFriendListInit();
extern "C" __declspec(dllexport) void GetFriendListFinish();
\ No newline at end of file
extern "C" __declspec(dllexport) void GetFriendListFinish();
#endif
\ No newline at end of file
......@@ -2,4 +2,6 @@
#include<windows.h>
BOOL __stdcall GetChatRoomMembers(wchar_t* chatroomid);
extern "C" __declspec(dllexport) DWORD GetChatRoomMembersRemote(LPVOID lparameter);
\ No newline at end of file
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) DWORD GetChatRoomMembersRemote(LPVOID lparameter);
#endif
\ No newline at end of file
......@@ -29,6 +29,7 @@ ChatRoomInfoStruct chatroominfo = { 0 };
* lparameter:保存群聊ID的地址
* return:DWORD,调用成功且群成员数量不为0,返回`chatroominfo`首地址,否则返回0
*/
#ifndef USE_SOCKET
DWORD GetChatRoomMembersRemote(LPVOID lparameter) {
wchar_t* chatroomid = (WCHAR*)lparameter;
if (chatroominfo.members != NULL) {
......@@ -47,6 +48,7 @@ DWORD GetChatRoomMembersRemote(LPVOID lparameter) {
}
return 0;
}
#endif
/*
* 获取群成员列表的具体实现
......
......@@ -29,17 +29,19 @@ DWORD GetDbHandleByDbName(wchar_t* dbname) {
* 供外部调用的获取数据库信息接口
* return:DWORD,`dbs`首个成员地址
*/
#ifndef USE_SOCKET
DWORD GetDbHandlesRemote() {
if (dbs.size() == 0)
GetDbHandles();
return (DWORD)dbs.data() ;
}
#endif
/*
* 获取数据库信息的具体实现
* return:void
*/
void GetDbHandles() {
void* GetDbHandles() {
dbs.clear();
DWORD WeChatWinBase = GetWeChatWinBase();
DWORD SqlHandleBaseAddr = WeChatWinBase + SqlHandleMicroMsgOffset;
......@@ -121,4 +123,5 @@ void GetDbHandles() {
cout << endl;
}
#endif
return dbs.data();
}
\ No newline at end of file
#pragma once
#include<windows.h>
#include<vector>
/*
* 保存数据库单个表信息的结构体
* name:表名;l_name:`name`字符数
* tbl_name:表名;l_tbl_name:`tbl_name`字符数
* sql:建表语句;l_sql:`sql`字符数
* rootpage:表编号;l_rootpage:`rootpage`字符数
*/
struct TableInfoStruct {
char* name;
DWORD l_name;
char* tbl_name;
DWORD l_tbl_name;
char* sql;
DWORD l_sql;
char* rootpage;
DWORD l_rootpage;
};
/*
* 保存数据库信息的结构体
* handle:数据库句柄
* dbname:数据库名
* l_dbname:`dbname`字符数
* tables:保存库中所有表信息的容器
* count:库中表的数量
*/
struct DbInfoStruct {
DWORD handle;
wchar_t* dbname;
DWORD l_dbname;
vector<TableInfoStruct> tables;
DWORD count;
};
void GetDbHandles();
void* GetDbHandles();
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) DWORD GetDbHandlesRemote();
#endif
DWORD GetDbHandleByDbName(wchar_t* dbname);
\ No newline at end of file
......@@ -84,6 +84,7 @@ void UnHookImageMsg() {
ImageMsgHooked = false;
}
#ifndef USE_SOCKET
BOOL HookImageMsgRemote(LPVOID lpParameter) {
savepath = (wstring)(wchar_t*)lpParameter;
if (savepath.back() != '\\') {
......@@ -95,4 +96,5 @@ BOOL HookImageMsgRemote(LPVOID lpParameter) {
}
HookImageMsg();
return true;
}
\ No newline at end of file
}
#endif
\ No newline at end of file
......@@ -70,6 +70,7 @@ void UnHookVoiceMsg() {
VoiceMsgHooked = false;
}
#ifndef USE_SOCKET
BOOL HookVoiceMsgRemote(LPVOID lpParameter) {
savepath = (wstring)(wchar_t*)lpParameter;
if (savepath.back() != '\\') {
......@@ -81,4 +82,5 @@ BOOL HookVoiceMsgRemote(LPVOID lpParameter) {
}
HookVoiceMsg();
return true;
}
\ No newline at end of file
}
#endif
\ No newline at end of file
#include "pch.h"
#include <vector>
#include <iostream>
// 接收消息的HOOK地址偏移
#define ReceiveMessageHookOffset 0x547C0F4C - 0x54270000
......@@ -11,31 +12,8 @@
// 发送消息HOOK的CALL偏移
#define SendMessageNextCallOffset 0x101E8170 - 0x0FDE0000
/*
* 保存单条信息的结构
* messagetype:消息类型
* sender:发送者wxid;l_sender:`sender`字符数
* wxid:如果sender是群聊id,则此成员保存具体发送人wxid,否则与`sender`一致;l_wxid:`wxid`字符数
* message:消息内容,非文本消息是xml格式;l_message:`message`字符数
* filepath:图片、文件及其他资源的保存路径;l_filepath:`filepath`字符数
*/
struct messageStruct {
DWORD messagetype;
BOOL isSendMessage;
wchar_t* sender;
DWORD l_sender;
wchar_t* wxid;
DWORD l_wxid;
wchar_t* message;
DWORD l_message;
wchar_t* filepath;
DWORD l_filepath;
wchar_t* time;
DWORD l_time;
};
// 保存多条信息的动态数组
vector<messageStruct> messageVector;
vector<ReceiveMsgStruct> messageVector;
// 是否开启接收消息HOOK标志
BOOL ReceiveMessageHooked = false;
......@@ -55,6 +33,42 @@ DWORD SendMessageNextCall = GetWeChatWinBase() + SendMessageNextCallOffset;
// 发送HOOK的跳转地址
DWORD SendMessageJmpBackAddress = SendMessageHookAddress + 0x5;
// 创建广播消息数组
#ifndef USE_SOCKET
static SAFEARRAY* CreateMessageArray(ReceiveMsgStruct* ms) {
HRESULT hr = S_OK;
SAFEARRAY* psaValue;
vector<wstring> MessageInfoKey = {
L"type",
L"isSendMessage",
ms->isSendMessage ? L"sendto" : L"from",
L"wxid",
L"message",
L"filepath",
L"time"
};
SAFEARRAYBOUND rgsaBound[2] = { {MessageInfoKey.size(),0},{2,0} };
psaValue = SafeArrayCreate(VT_VARIANT, 2, rgsaBound);
long keyIndex[2] = { 0,0 };
keyIndex[0] = 0; keyIndex[1] = 0;
for (unsigned int i = 0; i < MessageInfoKey.size(); i++) {
keyIndex[0] = i; keyIndex[1] = 0;
_variant_t key = MessageInfoKey[i].c_str();
hr = SafeArrayPutElement(psaValue, keyIndex, &key);
keyIndex[0] = i; keyIndex[1] = 1;
if (i < 2) {
_variant_t value = ((DWORD*)ms)[i];
hr = SafeArrayPutElement(psaValue, keyIndex, &value);
}
else {
_variant_t value = ((wchar_t**)ms)[i * 2 - 2];
hr = SafeArrayPutElement(psaValue, keyIndex, &value);
}
}
return psaValue;
}
#endif
/*
* 消息处理函数,根据消息缓冲区组装结构并存入容器
* messageAddr:保存消息的缓冲区地址
......@@ -64,7 +78,7 @@ VOID ReceiveMessage(DWORD messageAddr) {
// 此处用于区别是发送的还是接收的消息
BOOL isSendMessage = *(BOOL*)(messageAddr + 0x3C);
messageStruct message = { 0 };
ReceiveMsgStruct message = { 0 };
message.isSendMessage = isSendMessage;
message.time = GetTimeW();
message.l_time = wcslen(message.time);
......@@ -101,10 +115,14 @@ VOID ReceiveMessage(DWORD messageAddr) {
ZeroMemory(message.filepath, (length + 1) * 2);
memcpy(message.filepath, (wchar_t*)(*(DWORD*)(messageAddr + 0x1AC)), length * 2);
message.l_filepath = length;
#ifdef _DEBUG
wcout << message.time << endl;
#ifdef USE_COM
// 通过连接点,将消息广播给客户端
SAFEARRAY* psaValue = CreateMessageArray(&message);
VARIANT vsaValue;
vsaValue.vt = VT_ARRAY | VT_VARIANT;
V_ARRAY(&vsaValue) = psaValue;
PostComMessage(&vsaValue);
#endif
messageVector.push_back(message);
}
......@@ -135,7 +153,7 @@ VOID PopHeadMessage() {
messageVector[0].filepath = NULL;
delete[] messageVector[0].time;
messageVector[0].time = NULL;
vector<messageStruct>::iterator k = messageVector.begin();
vector<ReceiveMsgStruct>::iterator k = messageVector.begin();
messageVector.erase(k);
}
......
#pragma once
#include<windows.h>
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) DWORD GetHeadMessage();
extern "C" __declspec(dllexport) VOID PopHeadMessage();
extern "C" __declspec(dllexport) VOID HookReceiveMessage();
extern "C" __declspec(dllexport) VOID UnHookReceiveMessage();
void __stdcall HookVoiceMsg();
extern "C" __declspec(dllexport) void UnHookVoiceMsg();
extern "C" __declspec(dllexport) BOOL HookVoiceMsgRemote(LPVOID lpParameter);
void __stdcall HookImageMsg();
extern "C" __declspec(dllexport) void UnHookImageMsg();
extern "C" __declspec(dllexport) BOOL HookImageMsgRemote(LPVOID lpParameter);
\ No newline at end of file
extern "C" __declspec(dllexport) BOOL HookImageMsgRemote(LPVOID lpParameter);
#else
VOID HookReceiveMessage();
VOID UnHookReceiveMessage();
void UnHookImageMsg();
void UnHookVoiceMsg();
#endif
void __stdcall HookVoiceMsg();
void __stdcall HookImageMsg();
\ No newline at end of file
#pragma once
#include<windows.h>
BOOL __stdcall GetUserInfoByWxId(wchar_t* wxid);
extern "C" __declspec(dllexport) DWORD GetWxUserInfoRemote(LPVOID lparamter);
extern "C" __declspec(dllexport) VOID DeleteUserInfoCacheRemote();
wstring __stdcall GetUserInfoByWxId(wchar_t* wxid);
wchar_t* __stdcall GetUserNickNameByWxId(wchar_t* wxid);
void* __stdcall SearchContactByNet(wchar_t* keyword);
void UnHookSearchContact();
void __stdcall SearchContactByNet(wchar_t* keyword);
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) DWORD GetWxUserInfoRemote(LPVOID lparamter);
extern "C" __declspec(dllexport) VOID DeleteUserInfoCacheRemote();
extern "C" __declspec(dllexport) DWORD SearchContactByNetRemote(LPVOID keyword);
void StopSearchContactHook();
\ No newline at end of file
#endif
\ No newline at end of file
......@@ -19,22 +19,20 @@
* message:wUserInfo.c_str()
* length:wUserInfo字符串长度
*/
#ifndef USE_SOCKET
struct GetUserInfoStruct {
DWORD message;
DWORD length;
};
// 保存好友信息的字符串
wstring wUserInfo = L"";
// 外部调用时的具体返回对象
GetUserInfoStruct ret = { 0 };
} ret;
#endif
/*
* 根据缓冲区内容拼接好友信息
* address:缓冲区地址
* return:void
*/
VOID WxUserInfo(DWORD address) {
static wstring WxUserInfo(DWORD address) {
wstring wUserInfo = L"";
vector<DWORD> InfoType{
address + 0x10,
address + 0x24,
......@@ -77,6 +75,7 @@ VOID WxUserInfo(DWORD address) {
wcout.imbue(locale("chs"));
wcout << wUserInfo.c_str() << endl;
#endif
return wUserInfo;
}
/*
......@@ -84,35 +83,40 @@ VOID WxUserInfo(DWORD address) {
* lparamter:保存好友wxid的地址
* return:DWORD,`ret`的首地址
*/
#ifndef USE_SOCKET
DWORD GetWxUserInfoRemote(LPVOID lparamter) {
wchar_t* userwxid = (wchar_t*)lparamter;
if (!GetUserInfoByWxId(userwxid)) {
return 0;
}
ret.message = (DWORD)wUserInfo.c_str();
ret.length = (DWORD)wUserInfo.length();
wstring wUserInfo = GetUserInfoByWxId(userwxid);
ZeroMemory(&ret, sizeof(GetUserInfoStruct));
wchar_t* message = new wchar_t[wUserInfo.length() + 1];
memcpy(message, wUserInfo.c_str(), (wUserInfo.length() + 1) * 2);
ret.message = (DWORD)message;
ret.length = wUserInfo.length();
return (DWORD)&ret;
}
#endif
/*
* 供外部调用的清空好友信息缓存的接口
* return:void
*/
#ifndef USE_SOCKET
VOID DeleteUserInfoCacheRemote() {
if (ret.length) {
ZeroMemory((wchar_t*)ret.message, ret.length * 2 + 2);
ret.length = 0;
wUserInfo = L"";
delete[](wchar_t*)ret.message;
ZeroMemory(&ret, sizeof(GetUserInfoStruct));
}
}
#endif
/*
* 根据wxid获取好友信息的具体实现
* wxid:好友wxid
* return:BOOL,成功返回`1`,失败返回`0`
* return:wstring,成功返回好友信息,失败返回空字符串
*/
BOOL __stdcall GetUserInfoByWxId(wchar_t* wxid) {
wstring __stdcall GetUserInfoByWxId(wchar_t* wxid) {
wstring wUserInfo = L"";
DWORD WeChatWinBase = GetWeChatWinBase();
DWORD WxGetUserInfoCall1 = WeChatWinBase + GetUserInfoCall1Offset;
DWORD WxGetUserInfoCall2 = WeChatWinBase + GetUserInfoCall2Offset;
......@@ -142,7 +146,8 @@ BOOL __stdcall GetUserInfoByWxId(wchar_t* wxid) {
popad;
}
if(isSuccess)
WxUserInfo(address);
wUserInfo = WxUserInfo(address);
char deletebuffer[0x410] = { 0 };
__asm {
pushad;
......@@ -154,7 +159,7 @@ BOOL __stdcall GetUserInfoByWxId(wchar_t* wxid) {
call DeleteUserInfoCacheCall2;
popad;
}
return isSuccess;
return wUserInfo;
}
/*
......
......@@ -14,31 +14,7 @@ static char HookSearchContactErrcodeOldAsm[5] = { 0 };
static char HookUserInfoOldAsm[5] = { 0 };
static DWORD WeChatWinBase = GetWeChatWinBase();
static struct UserInfo {
int errcode;
wchar_t* keyword;
int l_keyword;
wchar_t* v3;
int l_v3;
wchar_t* NickName;
int l_NickName;
wchar_t* Signature;
int l_Signature;
wchar_t* v2;
int l_v2;
wchar_t* Nation;
int l_Nation;
wchar_t* Province;
int l_Province;
wchar_t* City;
int l_City;
wchar_t* BigAvatar;
int l_BigAvatar;
wchar_t* SmallAvatar;
int l_SmallAvatar;
DWORD sex;
BOOL over;
} userinfo;
static UserInfo userinfo;
DWORD HookSearchContactErrcodeNextCall = WeChatWinBase + HookSearchContactErrcodeNextCallOffset;
DWORD HookSearchContactErrcodeAddr = WeChatWinBase + HookSearchContactErrcodeAddrOffset;
......@@ -165,7 +141,7 @@ __declspec(naked) void dealUserInfo() {
}
}
static void StartSearchContactHook() {
static void HookSearchContact() {
if (SearchContactHooked)
return;
HookAnyAddress(HookSearchContactErrcodeAddr, (LPVOID)dealSearchContactErrcode, HookSearchContactErrcodeOldAsm);
......@@ -173,7 +149,7 @@ static void StartSearchContactHook() {
SearchContactHooked = true;
}
void StopSearchContactHook() {
void UnHookSearchContact() {
if (!SearchContactHooked)
return;
UnHookAnyAddress(HookSearchContactErrcodeAddr, HookSearchContactErrcodeOldAsm);
......@@ -217,8 +193,8 @@ static void DeleteUserInfoCache() {
}
void __stdcall SearchContactByNet(wchar_t* keyword) {
StartSearchContactHook();
void* __stdcall SearchContactByNet(wchar_t* keyword) {
HookSearchContact();
DeleteUserInfoCache();
DWORD SearchContactByNetCall1 = GetWeChatWinBase() + SearchContactByNetCall1Offset;
DWORD SearchContactByNetCall2 = GetWeChatWinBase() + SearchContactByNetCall2Offset;
......@@ -248,9 +224,12 @@ void __stdcall SearchContactByNet(wchar_t* keyword) {
wcout << userinfo.v3 << endl;
#endif
}
return &userinfo;
}
#ifndef USE_SOCKET
DWORD SearchContactByNetRemote(LPVOID keyword) {
SearchContactByNet((wchar_t*)keyword);
return (DWORD)&userinfo;
}
\ No newline at end of file
}
#endif
\ No newline at end of file
#include "pch.h"
#include <vector>
// 保存个人信息的字符串
wstring selfinfo = L"";
/*
* 外部调用时的返回类型
* message:selfinfo.c_str()
* length:selfinfo字符串长度
*/
#ifndef USE_SOCKET
struct SelfInfoStruct {
DWORD message;
DWORD length;
} ret;
#endif // !USE_SOCKET
/*
* 供外部调用的获取个人信息接口
* return:DWORD,ret的首地址
*/
#ifndef USE_SOCKET
DWORD GetSelfInfoRemote() {
ZeroMemory(&ret, sizeof(SelfInfoStruct));
wstring selfinfo = GetSelfInfo();
wchar_t* message = new wchar_t[selfinfo.length() + 1];
memcpy(message,selfinfo.c_str(),(selfinfo.length() + 1) * 2);
ret.message = (DWORD)message;
ret.length = selfinfo.length();
return (DWORD)&ret;
}
#endif
/*
* 获取个人信息
*/
wstring GetSelfInfo() {
wstring selfinfo = L"";
DWORD WeChatWinBase = GetWeChatWinBase();
vector<DWORD> SelfInfoAddr = {
WeChatWinBase + 0x236307C,
......@@ -45,9 +61,7 @@ DWORD GetSelfInfoRemote() {
L"\"wxCity\"",
L"\"PhoneNumber\""
};
#ifdef _DEBUG
wcout.imbue(locale("chs"));
#endif
selfinfo = selfinfo + L"{";
for (unsigned int i = 0; i < SelfInfoAddr.size(); i++) {
selfinfo = selfinfo + SelfInfoKey[i] + L":";
......@@ -91,22 +105,22 @@ DWORD GetSelfInfoRemote() {
wtemp = NULL;
}
selfinfo = selfinfo + L"}";
ret.message = (DWORD)selfinfo.c_str();
ret.length = selfinfo.length();
#ifdef _DEBUG
wcout.imbue(locale("chs"));
wcout << selfinfo << endl;
#endif
return (DWORD)&ret;
return selfinfo;
}
/*
* 删除个人信息缓存
* return:void
*/
#ifndef USE_SOCKET
VOID DeleteSelfInfoCacheRemote() {
if (ret.length) {
ZeroMemory((wchar_t*)ret.message, ret.length*2 + 2);
ret.length = 0;
selfinfo = L"";
delete[] (wchar_t*)ret.message;
ZeroMemory(&ret, sizeof(SelfInfoStruct));
}
}
\ No newline at end of file
}
#endif
\ No newline at end of file
......@@ -2,5 +2,8 @@
#include<windows.h>
#include<iostream>
using namespace std;
wstring GetSelfInfo();
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) DWORD GetSelfInfoRemote();
extern "C" __declspec(dllexport) VOID DeleteSelfInfoCacheRemote();
\ No newline at end of file
extern "C" __declspec(dllexport) VOID DeleteSelfInfoCacheRemote();
#endif
\ No newline at end of file
......@@ -4,19 +4,12 @@
#define SendAppMsgCall2Offset 0x04AD0980 - 0x04360000
#define SendAppMsgCall3Offset 0x04B1BB30 - 0x04360000
struct VectorStruct {
#ifdef _DEBUG
DWORD v_head;
#endif
DWORD v_data;
DWORD v_end1;
DWORD v_end2;
};
#ifndef USE_SOCKET
struct SendAppMsgStruct {
wchar_t* wxid;
wchar_t* appid;
};
#endif
BOOL __stdcall SendAppMsg(wchar_t* wxid,wchar_t* appid) {
DWORD WeChatWinBase = GetWeChatWinBase();
......@@ -55,8 +48,10 @@ BOOL __stdcall SendAppMsg(wchar_t* wxid,wchar_t* appid) {
return isSuccess;
}
#ifndef USE_SOCKET
BOOL SendAppMsgRemote(LPVOID lpParameter) {
SendAppMsgStruct* sams = (SendAppMsgStruct*)lpParameter;
BOOL isSuccess = SendAppMsg(sams->wxid, sams->appid);
return isSuccess;
}
\ No newline at end of file
}
#endif
\ No newline at end of file
#pragma once
#include<windows.h>
BOOL __stdcall SendAppMsg(wchar_t* wxid, wchar_t* appid);
extern "C" __declspec(dllexport) BOOL SendAppMsgRemote(LPVOID lpParameter);
\ No newline at end of file
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) BOOL SendAppMsgRemote(LPVOID lpParameter);
#endif
\ No newline at end of file
......@@ -23,6 +23,7 @@
* abstract:文章摘要的保存地址
* url:文章链接的保存地址
*/
#ifndef USE_SOCKET
struct SendArticleStruct {
DWORD wxid;
DWORD title;
......@@ -30,12 +31,14 @@ struct SendArticleStruct {
DWORD url;
DWORD imgpath;
};
#endif
/*
* 供外部调用的发送文章消息接口
* lparameter:SendArticleStruct类型结构体指针
* return:void
*/
#ifndef USE_SOCKET
VOID SendArticleRemote(LPVOID lparameter) {
SendArticleStruct* sas = (SendArticleStruct*)lparameter;
wchar_t* wxid = (wchar_t*)sas->wxid;
......@@ -45,6 +48,7 @@ VOID SendArticleRemote(LPVOID lparameter) {
wchar_t* imgpath = sas->imgpath ? (wchar_t*)sas->imgpath : NULL;
SendArticle(wxid,title,abstract,url, imgpath);
}
#endif
/*
* 获取自己的wxid保存地址
......@@ -101,7 +105,6 @@ BOOL __stdcall SendArticle(wchar_t* wxid,wchar_t* title, wchar_t* abstract, wcha
WxBaseStruct pXml(xmlbuffer);
WxBaseStruct pReceiver(wxid);
WxString imgbuffer = { 0 };
wcout << imgpath << endl;
if (imgpath) {
imgbuffer.buffer = imgpath;
imgbuffer.length = wcslen(imgpath);
......
#pragma once
#include<windows.h>
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) VOID SendArticleRemote(LPVOID lparameter);
#endif
BOOL __stdcall SendArticle(wchar_t* wxid, wchar_t* title, wchar_t* abstract, wchar_t* url,wchar_t* imgpath);
\ No newline at end of file
......@@ -12,6 +12,7 @@
* wxmsg:发送的内容保存地址
* length:艾特的人数量,用于指示wxidlist长度
*/
#ifndef USE_SOCKET
struct SendAtTextStruct
{
DWORD chatroomid;
......@@ -20,6 +21,7 @@ struct SendAtTextStruct
DWORD length;
BOOL AutoNickName;
};
#endif
/*
* 内存中使用的参数结构
......@@ -40,6 +42,7 @@ struct AtStruct {
* lpParameter:SendAtTextStruct类型结构体指针
* return:void
*/
#ifndef USE_SOCKET
void SendAtTextRemote(LPVOID lpParameter) {
SendAtTextStruct* rp = (SendAtTextStruct*)lpParameter;
wchar_t* wsChatRoomId = (WCHAR*)rp->chatroomid;
......@@ -51,6 +54,7 @@ void SendAtTextRemote(LPVOID lpParameter) {
else
SendAtText(wsChatRoomId, (DWORD*)rp->wxidlist, wsTextMsg, rp->length, rp->AutoNickName);
}
#endif
/*
* 发送艾特消息的具体实现
......
......@@ -2,4 +2,6 @@
#include<windows.h>
void __stdcall SendAtText(wchar_t* wsChatRoomId, DWORD wsWxId[], wchar_t* wsTextMsg, int length, BOOL AutoNickName);
extern "C" __declspec(dllexport) void SendAtTextRemote(LPVOID lpParameter);
\ No newline at end of file
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) void SendAtTextRemote(LPVOID lpParameter);
#endif
\ No newline at end of file
......@@ -11,17 +11,20 @@
* sharedwxid:被推荐人的wxid保存地址
* nickname:名片显示的昵称保存地址
*/
#ifndef USE_SOCKET
struct SendCardStruct {
DWORD receiver;
DWORD sharedwxid;
DWORD nickname;
};
#endif
/*
* 供外部调用的发送名片接口
* lparameter:SendCardStruct类型结构体指针
* return:void
*/
#ifndef USE_SOCKET
VOID SendCardRemote(LPVOID lparameter) {
SendCardStruct* scs = (SendCardStruct*)lparameter;
wchar_t* receiver = (WCHAR*)scs->receiver;
......@@ -29,6 +32,7 @@ VOID SendCardRemote(LPVOID lparameter) {
wchar_t* nickname = (WCHAR*)scs->nickname;
SendCard(receiver,sharedwxid,nickname);
}
#endif
/*
* 发送名片消息的具体实现
......
#pragma once
#include<windows.h>
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) VOID SendCardRemote(LPVOID lparameter);
#endif
BOOL __stdcall SendCard(wchar_t* receiver, wchar_t* sharedwxid, wchar_t* nickname);
\ No newline at end of file
......@@ -18,10 +18,12 @@
* wxid:wxid的保存地址
* filepath:文件绝对路径的保存地址
*/
#ifndef USE_SOCKET
struct FileParamStruct {
DWORD wxid;
DWORD filepath;
};
#endif
/*
* 内存中使用的参数结构
......@@ -51,10 +53,12 @@ struct WxFileStruct {
* lpParamStruct:FileParamStruct类型结构体指针
* return:void
*/
#ifndef USE_SOCKET
void SendFileRemote(LPVOID lpParamStruct) {
FileParamStruct* params = (FileParamStruct*)lpParamStruct;
SendFile((WCHAR*)params->wxid, (WCHAR*)params->filepath);
}
#endif
/*
* 发送文件消息的具体实现
......
......@@ -2,4 +2,6 @@
#include<windows.h>
void __stdcall SendFile(wchar_t* receiver, wchar_t* FilePath);
extern "C" __declspec(dllexport) void SendFileRemote(LPVOID lpParamStruct);
\ No newline at end of file
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) void SendFileRemote(LPVOID lpParamStruct);
#endif
\ No newline at end of file
......@@ -14,20 +14,24 @@
* wxid:保存wxid的地址
* imagepath:保存图片绝对路径的地址
*/
#ifndef USE_SOCKET
struct ImageParamStruct {
DWORD wxid;
DWORD imagepath;
};
#endif
/*
* 供外部调用的发送图片消息接口
* lpParamStruct:ImageParamStruct类型结构体指针
* return:void
*/
#ifndef USE_SOCKET
void SendImageRemote(LPVOID lpParamStruct) {
ImageParamStruct* params = (ImageParamStruct*)lpParamStruct;
SendImage((WCHAR*)params->wxid, (WCHAR*)params->imagepath);
}
#endif
/*
* 发送图片消息的具体实现
......
......@@ -2,4 +2,6 @@
#include<windows.h>
void __stdcall SendImage(wchar_t* receiver, wchar_t* ImagePath);
extern "C" __declspec(dllexport) void SendImageRemote(LPVOID lpParamStruct);
\ No newline at end of file
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) void SendImageRemote(LPVOID lpParamStruct);
#endif
\ No newline at end of file
......@@ -10,23 +10,27 @@
* wxid:wxid保存地址
* wxmsg:发送的内容保存地址
*/
#ifndef USE_SOCKET
struct SendTextStruct
{
DWORD wxid;
DWORD wxmsg;
};
#endif
/*
* 供外部调用的发送文本消息接口
* lpParameter:SendTextStruct类型结构体指针
* return:void
*/
#ifndef USE_SOCKET
void SendTextRemote(LPVOID lpParameter) {
SendTextStruct* rp = (SendTextStruct*)lpParameter;
wchar_t* wsWxId = (WCHAR*)rp->wxid;
wchar_t* wsTextMsg = (WCHAR*)rp->wxmsg;
SendText(wsWxId, wsTextMsg);
}
#endif
/*
* 发送文本消息的具体实现
......
......@@ -2,4 +2,6 @@
#include<windows.h>
void __stdcall SendText(wchar_t* wsWxId, wchar_t* wsTextMsg);
extern "C" __declspec(dllexport) void SendTextRemote(LPVOID lpParameter);
\ No newline at end of file
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) void SendTextRemote(LPVOID lpParameter);
#endif
\ No newline at end of file
......@@ -4,10 +4,12 @@
#define VerifyFriendApplyCall2Offset 0x6B6FE8D0 - 0x6B450000
#define VerifyFriendApplyParamOffset 0x6D3320D8 - 0x6B450000
#ifndef USE_SOCKET
struct VerifyFriendApplyStruct {
wchar_t* v3_data;
wchar_t* v4_data;
};
#endif
struct VerifyFriendApplyParamStruct {
DWORD handle;
......@@ -17,11 +19,13 @@ struct VerifyFriendApplyParamStruct {
char buffer[0x3C] = { 0 };
};
#ifndef USE_SOCKET
BOOL VerifyFriendApplyRemote(LPVOID lparameter) {
VerifyFriendApplyStruct* vfas = (VerifyFriendApplyStruct*)lparameter;
BOOL isSuccess = VerifyFriendApply(vfas->v3_data, vfas->v4_data);
return isSuccess;
}
#endif
BOOL __stdcall VerifyFriendApply(wchar_t* v3_data, wchar_t* v4_data) {
WxBaseStruct v3(v3_data);
......
......@@ -2,4 +2,6 @@
#include<windows.h>
BOOL __stdcall VerifyFriendApply(wchar_t* v3_data, wchar_t* v4_data);
extern "C" __declspec(dllexport) BOOL VerifyFriendApplyRemote(LPVOID lparameter);
\ No newline at end of file
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) BOOL VerifyFriendApplyRemote(LPVOID lparameter);
#endif
\ No newline at end of file
#include "pch.h"
#ifdef USE_COM
#include <atlbase.h>
#include <atlcom.h>
#include "../CWeChatRobot/WeChatRobotCOM_i.h"
#include "../CWeChatRobot/WeChatRobotCOM_i.c"
#include <iostream>
#include <thread>
CComModule m_commodule;
class CSink :
public CComObjectRoot,
public _IRobotEventEvents
{
BEGIN_COM_MAP(CSink)
COM_INTERFACE_ENTRY(IDispatch)
COM_INTERFACE_ENTRY(_IRobotEventEvents)
END_COM_MAP()
public:
virtual ~CSink() {}
STDMETHODIMP GetTypeInfoCount(UINT* pctinfo) { return E_NOTIMPL; }
STDMETHODIMP GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo) { return E_NOTIMPL; }
STDMETHODIMP GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames, UINT cNames, LCID lcid, DISPID* rgDispId) { return E_NOTIMPL; }
STDMETHODIMP Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult, EXCEPINFO* pExcepInfo, UINT* puArgErr)
{
#ifdef _DEBUG
printf("sink, id: %d, parm: %f", dispIdMember, pDispParams->rgvarg[0].fltVal);
#endif
return S_OK;
}
};
BOOL PostComMessage(VARIANT* msg) {
HRESULT hr = S_OK;
hr = CoInitializeEx(0, COINIT_APARTMENTTHREADED);
if (FAILED(hr))
return false;
CComPtr<IRobotEvent> spRobotEvent;
hr = ::CoCreateInstance(CLSID_RobotEvent, NULL, CLSCTX_ALL, IID_IRobotEvent, (LPVOID*)&spRobotEvent);
if (SUCCEEDED(hr)) {
/*
// 这段逻辑用于回调到微信
CComObject<CSink>* sinkptr = nullptr;
CComObject<CSink>::CreateInstance(&sinkptr);
DWORD cookies = 0;
AtlAdvise(spRobotEvent, sinkptr, __uuidof(_IRobotEventEvents), &cookies);
*/
/*
CComVariant varParam;
varParam.vt = VT_BSTR;
varParam = pmsg;
*/
int __result = 0;
spRobotEvent->CPostMessage(msg, &__result);
}
else {
return false;
}
CoUninitialize();
return true;
}
#endif // !USE_COM
\ No newline at end of file
#pragma once
#include<windows.h>
#define USE_COM
#include<comutil.h>
#pragma comment(lib, "comsuppw.lib")
BOOL PostComMessage(VARIANT* msg);
\ No newline at end of file
......@@ -10,12 +10,14 @@ BOOL APIENTRY DllMain( HMODULE hModule,
{
case DLL_PROCESS_ATTACH:
{
#ifdef _DEBUG
if (ProcessIsWeChat()) {
#ifndef USE_SOCKET
#ifdef _DEBUG
PrintProcAddr();
HookLogMsgInfo();
}
#endif
#endif
}
break;
}
case DLL_THREAD_ATTACH:
......
# 注意
此处源码来自以下仓库:
[mongoose](https://github.com/cesanta/mongoose)
需要自行克隆该仓库并将mongoose.c和mongoose.h拷贝到此处
# Thanks
[mongoose](https://github.com/cesanta/mongoose)
\ No newline at end of file
......@@ -132,7 +132,8 @@ void UnHookAnyAddress(DWORD dwHookAddr, char* originalRecieveCode)
void UnHookAll() {
UnHookLogMsgInfo();
UnHookReceiveMessage();
StopSearchContactHook();
UnHookFriendStatusCode();
UnHookSearchContact();
UnHookVoiceMsg();
UnHookImageMsg();
return;
......@@ -187,14 +188,13 @@ void PrintProcAddr() {
printf("CheckFriendStatus 0x%08X\n", (DWORD)CheckFriendStatus);
printf("GetChatRoomMembers 0x%08X\n", (DWORD)GetChatRoomMembers);
printf("ExecuteSql 0x%08X\n", (DWORD)ExecuteSQL);
printf("BackupSQLiteDB 0x%08X\n", (DWORD)BackupSQLiteDBRemote);
printf("BackupSQLiteDB 0x%08X\n", (DWORD)BackupSQLiteDB);
printf("VerifyFriendApply 0x%08X\n", (DWORD)VerifyFriendApply);
printf("AddFriendByV3 0x%08X\n", (DWORD)AddFriendByV3);
printf("AddFriendByWxid 0x%08X\n", (DWORD)AddFriendByWxid);
printf("AddBrandContact 0x%08X\n", (DWORD)AddBrandContact);
printf("SelectDataRemote 0x%08X\n", (DWORD)SelectDataRemote);
printf("SelectData 0x%08X\n", (DWORD)SelectData);
printf("SearchContactByNet 0x%08X\n", (DWORD)SearchContactByNet);
printf("SearchContactByNetRemote 0x%08X\n", (DWORD)SearchContactByNetRemote);
}
BOOL ProcessIsWeChat()
......
......@@ -9,87 +9,15 @@
// 添加要在此处预编译的标头
#include "framework.h"
#include<windows.h>
#include<iostream>
#include "SendImage.h"
#include "SendText.h"
#include "SendFile.h"
#include "SendArticle.h"
#include "FriendList.h"
#include "SearchContact.h"
#include "SelfInfo.h"
#include "SendCard.h"
#include "CheckFriendStatus.h"
#include "LogMsgInfo.h"
#include "ReceiveMessage.h"
#include "SendAtText.h"
#include "GetChatRoomMembers.h"
#include "GetDbHandles.h"
#include "DbExecuteSql.h"
#include "DbBackup.h"
#include "VerifyFriendApply.h"
#include "AddFriend.h"
#include "sqlite3.h"
#include "wechatver.h"
#include "DeleteUser.h"
#include "SendAppMsg.h"
#include <vector>
#include <strstream>
#include<vector>
#include<strstream>
#include "wxdata.h"
#include "wxapi.h"
#endif //PCH_H
using namespace std;
#pragma comment(lib,"version.lib")
#pragma warning(disable:4731)
// 对于导出函数,需要使用此宏修饰
#define DLLEXPORT extern "C" __declspec(dllexport)
/*
* 微信中的基础数据结构
* buffer:UNICODE字符串
* length:`buffer`字符数
* maxLength:`buffer`最大字符数
* fill1:占位成员1,默认为0
* fill2:占位成员2,默认为0
* WxBaseStruct:默认构造函数
*/
struct WxBaseStruct
{
wchar_t* buffer;
DWORD length;
DWORD maxLength;
DWORD fill1;
DWORD fill2;
WxBaseStruct(wchar_t* pStr) {
buffer = pStr;
length = wcslen(pStr);
maxLength = wcslen(pStr) * 2;
fill1 = 0x0;
fill2 = 0x0;
}
};
/*
* 不使用构造函数的微信基础数据结构,使用频率较低
*/
struct WxString
{
wchar_t* buffer = NULL;
DWORD length = 0;
DWORD maxLength = 0;
DWORD fill1 = 0;
DWORD fill2 = 0;
};
BOOL CreateConsole(void);
DWORD GetWeChatWinBase();
void Wchar_tToString(std::string& szDst, wchar_t* wchar);
string UTF8ToGBK(const std::string& strUTF8);
void HookAnyAddress(DWORD dwHookAddr, LPVOID dwJmpAddress, char* originalRecieveCode);
void UnHookAnyAddress(DWORD dwHookAddr, char* originalRecieveCode);
DLLEXPORT void UnHookAll();
wstring wreplace(wstring source, wchar_t replaced, wstring replaceto);
void PrintProcAddr();
wchar_t* GetTimeW();
BOOL ProcessIsWeChat();
BOOL FindOrCreateDirectory(const wchar_t* pszPath);
\ No newline at end of file
#ifdef USE_SOCKET
#include "wxsocketapi.h"
#else
#include "comclient.h"
#endif
\ No newline at end of file
......@@ -61,7 +61,13 @@ vector<wstring> split(const wstring& str, const wstring& delim) {
return res;
}
BOOL ChangeWeChatVerRemote(wchar_t* verStr) {
#ifndef USE_SOCKET
BOOL ChangeWeChatVerRemote(LPVOID verStr) {
return ChangeWeChatVer((wchar_t*)verStr);
}
#endif
BOOL ChangeWeChatVer(wchar_t* verStr) {
wstring wverStr(verStr);
vector<wstring> v_split = split(wverStr, L".");
BYTE bVer[4] = { 0 };
......
......@@ -4,4 +4,7 @@
using namespace std;
DWORD GetWeChatVerInt();
string GetWeChatVerStr();
extern "C" __declspec(dllexport) BOOL ChangeWeChatVerRemote(wchar_t* verStr);
\ No newline at end of file
BOOL ChangeWeChatVer(wchar_t* verStr);
#ifndef USE_SOCKET
extern "C" __declspec(dllexport) BOOL ChangeWeChatVerRemote(wchar_t* verStr);
#endif // !USE_SOCKET
\ No newline at end of file
#pragma once
#include "SendImage.h"
#include "SendText.h"
#include "SendFile.h"
#include "SendArticle.h"
#include "FriendList.h"
#include "SearchContact.h"
#include "SelfInfo.h"
#include "SendCard.h"
#include "CheckFriendStatus.h"
#include "LogMsgInfo.h"
#include "ReceiveMessage.h"
#include "SendAtText.h"
#include "GetChatRoomMembers.h"
#include "GetDbHandles.h"
#include "DbExecuteSql.h"
#include "DbBackup.h"
#include "VerifyFriendApply.h"
#include "AddFriend.h"
#include "sqlite3.h"
#include "wechatver.h"
#include "DeleteUser.h"
#include "SendAppMsg.h"
using namespace std;
#pragma comment(lib,"version.lib")
#pragma warning(disable:4731)
// 对于导出函数,需要使用此宏修饰
#define DLLEXPORT extern "C" __declspec(dllexport)
BOOL CreateConsole(void);
DWORD GetWeChatWinBase();
void Wchar_tToString(std::string& szDst, wchar_t* wchar);
string UTF8ToGBK(const std::string& strUTF8);
void HookAnyAddress(DWORD dwHookAddr, LPVOID dwJmpAddress, char* originalRecieveCode);
void UnHookAnyAddress(DWORD dwHookAddr, char* originalRecieveCode);
DLLEXPORT void UnHookAll();
wstring wreplace(wstring source, wchar_t replaced, wstring replaceto);
void PrintProcAddr();
wchar_t* GetTimeW();
BOOL ProcessIsWeChat();
BOOL FindOrCreateDirectory(const wchar_t* pszPath);
\ No newline at end of file
#pragma once
#include<windows.h>
using namespace std;
/*
* 微信中的基础数据结构
* buffer:UNICODE字符串
* length:`buffer`字符数
* maxLength:`buffer`最大字符数
* fill1:占位成员1,默认为0
* fill2:占位成员2,默认为0
* WxBaseStruct:默认构造函数
*/
struct WxBaseStruct
{
wchar_t* buffer;
DWORD length;
DWORD maxLength;
DWORD fill1;
DWORD fill2;
WxBaseStruct(wchar_t* pStr) {
buffer = pStr;
length = wcslen(pStr);
maxLength = wcslen(pStr) * 2;
fill1 = 0x0;
fill2 = 0x0;
}
};
/*
* 不使用构造函数的微信基础数据结构,使用频率较低
*/
struct WxString
{
wchar_t* buffer = NULL;
DWORD length = 0;
DWORD maxLength = 0;
DWORD fill1 = 0;
DWORD fill2 = 0;
};
/*
* 保存单条信息的结构
* messagetype:消息类型
* sender:发送者wxid;l_sender:`sender`字符数
* wxid:如果sender是群聊id,则此成员保存具体发送人wxid,否则与`sender`一致;l_wxid:`wxid`字符数
* message:消息内容,非文本消息是xml格式;l_message:`message`字符数
* filepath:图片、文件及其他资源的保存路径;l_filepath:`filepath`字符数
*/
struct ReceiveMsgStruct {
DWORD messagetype;
BOOL isSendMessage;
wchar_t* sender;
DWORD l_sender;
wchar_t* wxid;
DWORD l_wxid;
wchar_t* message;
DWORD l_message;
wchar_t* filepath;
DWORD l_filepath;
wchar_t* time;
DWORD l_time;
};
// vector在内存中的表现形式
struct VectorStruct {
#ifdef _DEBUG
DWORD v_head;
#endif
DWORD v_data;
DWORD v_end1;
DWORD v_end2;
};
struct UserInfo {
int errcode;
wchar_t* keyword;
int l_keyword;
wchar_t* v3;
int l_v3;
wchar_t* NickName;
int l_NickName;
wchar_t* Signature;
int l_Signature;
wchar_t* v2;
int l_v2;
wchar_t* Nation;
int l_Nation;
wchar_t* Province;
int l_Province;
wchar_t* City;
int l_City;
wchar_t* BigAvatar;
int l_BigAvatar;
wchar_t* SmallAvatar;
int l_SmallAvatar;
DWORD sex;
BOOL over;
};
/*
* 保存数据库单个表信息的结构体
* name:表名;l_name:`name`字符数
* tbl_name:表名;l_tbl_name:`tbl_name`字符数
* sql:建表语句;l_sql:`sql`字符数
* rootpage:表编号;l_rootpage:`rootpage`字符数
*/
struct TableInfoStruct {
char* name;
DWORD l_name;
char* tbl_name;
DWORD l_tbl_name;
char* sql;
DWORD l_sql;
char* rootpage;
DWORD l_rootpage;
};
/*
* 保存数据库信息的结构体
* handle:数据库句柄
* dbname:数据库名
* l_dbname:`dbname`字符数
* tables:保存库中所有表信息的容器
* count:库中表的数量
*/
struct DbInfoStruct {
DWORD handle;
wchar_t* dbname;
DWORD l_dbname;
vector<TableInfoStruct> tables;
DWORD count;
};
/*
* 保存单个好友信息的结构体
* wxIdAddr:wxid保存地址
* wxNumberAddr:微信号保存地址
* wxNickNameAddr:昵称保存地址
* wxRemarkAddr:备注保存地址
* WxFriendStructW:默认构造函数
*/
struct WxFriendStruct {
DWORD wxIdAddr;
DWORD wxNumberAddr;
DWORD wxNickNameAddr;
DWORD wxRemarkAddr;
WxFriendStruct(DWORD wxIdAddr, DWORD wxNumberAddr, DWORD wxNickNameAddr, DWORD wxRemarkAddr) {
this->wxIdAddr = wxIdAddr;
this->wxNumberAddr = wxNumberAddr;
this->wxNickNameAddr = wxNickNameAddr;
this->wxRemarkAddr = wxRemarkAddr;
}
};
\ No newline at end of file
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册