fix(chatroom): fix #379
This commit is contained in:
parent
f90c4a7f65
commit
753c2b43d0
@ -12,10 +12,11 @@ namespace chatroom
|
|||||||
{
|
{
|
||||||
namespace OsRoom = Offsets::Chatroom;
|
namespace OsRoom = Offsets::Chatroom;
|
||||||
|
|
||||||
|
using new_t = QWORD (*)(QWORD, WxString *);
|
||||||
using get_mgr_t = QWORD (*)();
|
using get_mgr_t = QWORD (*)();
|
||||||
using add_member_t = QWORD (*)(QWORD, QWORD, WxString *, QWORD);
|
using add_member_t = QWORD (*)(QWORD, QWORD, WxString *, QWORD);
|
||||||
using delete_member_t = QWORD (*)(QWORD, QWORD, WxString *);
|
using delete_member_t = QWORD (*)(QWORD, QWORD, WxString *);
|
||||||
using invite_members_t = QWORD (*)(const wchar_t *, QWORD, WxString *, QWORD);
|
using invite_members_t = QWORD (*)(const wchar_t *, QWORD, QWORD, QWORD);
|
||||||
|
|
||||||
template <auto FillFunc, typename Func>
|
template <auto FillFunc, typename Func>
|
||||||
bool rpc_chatroom_common(const MemberMgmt &m, uint8_t *out, size_t *len, Func func)
|
bool rpc_chatroom_common(const MemberMgmt &m, uint8_t *out, size_t *len, Func func)
|
||||||
@ -36,9 +37,11 @@ int add_chatroom_member(const string &roomid, const string &wxids)
|
|||||||
|
|
||||||
WxString *wx_roomid = util::CreateWxString(roomid);
|
WxString *wx_roomid = util::CreateWxString(roomid);
|
||||||
|
|
||||||
QWORD tmp[2] = { 0 };
|
QWORD tmp[2] = { 0 };
|
||||||
auto wx_members = util::parse_wxids(wxids).wxWxids;
|
|
||||||
QWORD p_members = reinterpret_cast<QWORD>(&wx_members);
|
auto split = util::parse_wxids(wxids);
|
||||||
|
auto &wx_members = split.wxWxids;
|
||||||
|
QWORD p_members = reinterpret_cast<QWORD>(&wx_members);
|
||||||
|
|
||||||
return static_cast<int>(add_members(get_chatroom_mgr(), p_members, wx_roomid, reinterpret_cast<QWORD>(tmp)));
|
return static_cast<int>(add_members(get_chatroom_mgr(), p_members, wx_roomid, reinterpret_cast<QWORD>(tmp)));
|
||||||
}
|
}
|
||||||
@ -49,24 +52,32 @@ int del_chatroom_member(const string &roomid, const string &wxids)
|
|||||||
auto del_members = Spy::getFunction<delete_member_t>(OsRoom::DEL);
|
auto del_members = Spy::getFunction<delete_member_t>(OsRoom::DEL);
|
||||||
|
|
||||||
WxString *wx_roomid = util::CreateWxString(roomid);
|
WxString *wx_roomid = util::CreateWxString(roomid);
|
||||||
auto wx_members = util::parse_wxids(wxids).wxWxids;
|
|
||||||
QWORD p_members = reinterpret_cast<QWORD>(&wx_members);
|
auto split = util::parse_wxids(wxids);
|
||||||
|
auto &wx_members = split.wxWxids;
|
||||||
|
QWORD p_members = reinterpret_cast<QWORD>(&wx_members);
|
||||||
|
|
||||||
return static_cast<int>(del_members(get_chatroom_mgr(), p_members, wx_roomid));
|
return static_cast<int>(del_members(get_chatroom_mgr(), p_members, wx_roomid));
|
||||||
}
|
}
|
||||||
|
|
||||||
int invite_chatroom_member(const string &roomid, const string &wxids)
|
int invite_chatroom_member(const string &roomid, const string &wxids)
|
||||||
{
|
{
|
||||||
|
auto init_roomid = Spy::getFunction<new_t>(OsRoom::NEW);
|
||||||
auto invite_members = Spy::getFunction<invite_members_t>(OsRoom::INV);
|
auto invite_members = Spy::getFunction<invite_members_t>(OsRoom::INV);
|
||||||
|
|
||||||
wstring ws_roomid = util::s2w(roomid);
|
wstring ws_roomid = util::s2w(roomid);
|
||||||
WxString *wx_roomid = util::CreateWxString(roomid);
|
WxString wx_roomid(ws_roomid);
|
||||||
|
|
||||||
QWORD tmp[2] = { 0 };
|
QWORD tmp[2] = { 0 };
|
||||||
auto wx_members = util::parse_wxids(wxids).wxWxids;
|
QWORD array[4] = { 0 };
|
||||||
QWORD p_members = reinterpret_cast<QWORD>(&wx_members);
|
|
||||||
|
|
||||||
return static_cast<int>(invite_members(ws_roomid.c_str(), p_members, wx_roomid, reinterpret_cast<QWORD>(tmp)));
|
auto split = util::parse_wxids(wxids);
|
||||||
|
auto &wx_members = split.wxWxids;
|
||||||
|
QWORD p_members = reinterpret_cast<QWORD>(&wx_members);
|
||||||
|
QWORD p_roomid = init_roomid(reinterpret_cast<QWORD>(&array), &wx_roomid);
|
||||||
|
LOG_BUFFER((uint8_t *)*(QWORD *)(*(QWORD *)p_members), 40);
|
||||||
|
|
||||||
|
return static_cast<int>(invite_members(ws_roomid.c_str(), p_members, p_roomid, reinterpret_cast<QWORD>(tmp)));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool rpc_add_chatroom_member(const MemberMgmt &m, uint8_t *out, size_t *len)
|
bool rpc_add_chatroom_member(const MemberMgmt &m, uint8_t *out, size_t *len)
|
||||||
|
@ -19,6 +19,7 @@ namespace Account
|
|||||||
namespace Chatroom
|
namespace Chatroom
|
||||||
{
|
{
|
||||||
constexpr uint64_t MGR = 0x1B8AE40;
|
constexpr uint64_t MGR = 0x1B8AE40;
|
||||||
|
constexpr uint64_t NEW = 0x262D800;
|
||||||
constexpr uint64_t DEL = 0x2163070;
|
constexpr uint64_t DEL = 0x2163070;
|
||||||
constexpr uint64_t ADD = 0x2162A30;
|
constexpr uint64_t ADD = 0x2162A30;
|
||||||
constexpr uint64_t INV = 0x2162410;
|
constexpr uint64_t INV = 0x2162410;
|
||||||
@ -37,7 +38,7 @@ namespace Contact
|
|||||||
constexpr uint64_t GENDER = 0x0E;
|
constexpr uint64_t GENDER = 0x0E;
|
||||||
constexpr uint64_t STEP = 0x6A8;
|
constexpr uint64_t STEP = 0x6A8;
|
||||||
|
|
||||||
constexpr uint64_t VERIFY_NEW = 0x262D800;
|
constexpr uint64_t VERIFY_NEW = Chatroom::NEW;
|
||||||
constexpr uint64_t VERIFY_OK = 0x1F48850;
|
constexpr uint64_t VERIFY_OK = 0x1F48850;
|
||||||
constexpr uint64_t ADD_FRIEND_HELPER = 0x4F7FB18; // a1
|
constexpr uint64_t ADD_FRIEND_HELPER = 0x4F7FB18; // a1
|
||||||
constexpr uint64_t FVDF = 0x4F9DE28; // FriendVeriyDialogFragment
|
constexpr uint64_t FVDF = 0x4F9DE28; // FriendVeriyDialogFragment
|
||||||
|
Loading…
Reference in New Issue
Block a user