Impl get self wxid
This commit is contained in:
@@ -96,6 +96,21 @@ int RpcIsLogin()
|
||||
return loginFlag;
|
||||
}
|
||||
|
||||
int RpcGetSelfWxId(wchar_t wxid[20])
|
||||
{
|
||||
int ret = -1;
|
||||
unsigned long ulCode = 0;
|
||||
RpcTryExcept { ret = client_GetSelfWxId(wxid); }
|
||||
RpcExcept(1)
|
||||
{
|
||||
ulCode = RpcExceptionCode();
|
||||
printf("RpcIsLogin exception 0x%lx = %ld\n", ulCode, ulCode);
|
||||
}
|
||||
RpcEndExcept;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int RpcSendTextMsg(const wchar_t *wxid, const wchar_t *msg, const wchar_t *atWxids)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
@@ -8,6 +8,7 @@ RPC_STATUS RpcDisconnectServer();
|
||||
int RpcEnableReceiveMsg();
|
||||
int RpcDisableReceiveMsg();
|
||||
int RpcIsLogin();
|
||||
int RpcGetSelfWxId(wchar_t wxid[20]);
|
||||
int RpcSendTextMsg(const wchar_t *wxid, const wchar_t *msg, const wchar_t *atWxids);
|
||||
int RpcSendImageMsg(const wchar_t *wxid, const wchar_t *path);
|
||||
PPRpcIntBstrPair RpcGetMsgTypes(int *pNum);
|
||||
|
||||
@@ -157,6 +157,13 @@ static int getAddrHandle(DWORD *addr, HANDLE *handle)
|
||||
return 0;
|
||||
}
|
||||
|
||||
wstring WxGetSelfWxid()
|
||||
{
|
||||
wchar_t wxid[20] = { 0 };
|
||||
RpcGetSelfWxId(wxid);
|
||||
return wstring(wxid);
|
||||
}
|
||||
|
||||
MsgTypesMap_t WxGetMsgTypes()
|
||||
{
|
||||
static MsgTypesMap_t WxMsgTypes;
|
||||
|
||||
+12
-11
@@ -1,13 +1,14 @@
|
||||
EXPORTS
|
||||
WxInitSDK
|
||||
WxDestroySDK
|
||||
WxEnableRecvMsg
|
||||
WxDisableRecvMsg
|
||||
WxSendTextMsg
|
||||
WxGetMsgTypes
|
||||
WxSendImageMsg
|
||||
WxGetContacts
|
||||
WxGetDbNames
|
||||
WxGetDbTables
|
||||
WxExecDbQuery
|
||||
WxInitSDK
|
||||
WxDestroySDK
|
||||
WxEnableRecvMsg
|
||||
WxDisableRecvMsg
|
||||
WxSendTextMsg
|
||||
WxGetSelfWxid
|
||||
WxGetMsgTypes
|
||||
WxSendImageMsg
|
||||
WxGetContacts
|
||||
WxGetDbNames
|
||||
WxGetDbTables
|
||||
WxExecDbQuery
|
||||
WxAcceptNewFriend
|
||||
|
||||
@@ -51,6 +51,7 @@ int WxEnableRecvMsg(const std::function<int(WxMessage_t)> &onMsg);
|
||||
int WxDisableRecvMsg();
|
||||
int WxSendTextMsg(wstring wxid, wstring msg, wstring vAtWxids);
|
||||
int WxSendImageMsg(wstring wxid, wstring path);
|
||||
wstring WxGetSelfWxid();
|
||||
ContactMap_t WxGetContacts();
|
||||
MsgTypesMap_t WxGetMsgTypes();
|
||||
vector<wstring> WxGetDbNames();
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
#define WECHATINJECTDLL L"Spy.dll"
|
||||
|
||||
#define GET_DWORD(addr) ((DWORD) * (DWORD *)(addr))
|
||||
#define GET_STRING(addr) ((CHAR *)(addr))
|
||||
#define GET_STRING(addr) ((CHAR *)(*(DWORD *)(addr)))
|
||||
#define GET_WSTRING(addr) ((WCHAR *)(*(DWORD *)(addr)))
|
||||
|
||||
int OpenWeChat(DWORD *pid);
|
||||
|
||||
Reference in New Issue
Block a user