From 38db02437c78388e516271c45681d890fe025426 Mon Sep 17 00:00:00 2001 From: Changhua Date: Tue, 21 Nov 2023 19:07:07 +0800 Subject: [PATCH] Replace \ with / for path --- WeChatFerry/spy/receive_msg.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/WeChatFerry/spy/receive_msg.cpp b/WeChatFerry/spy/receive_msg.cpp index ca9abbf..03b3da1 100644 --- a/WeChatFerry/spy/receive_msg.cpp +++ b/WeChatFerry/spy/receive_msg.cpp @@ -2,6 +2,7 @@ #include "framework.h" #include +#include #include #include @@ -11,6 +12,8 @@ #include "user_info.h" #include "util.h" +namespace fs = std::filesystem; + // Defined in rpc_server.cpp extern bool gIsListening, gIsListeningPyq; extern mutex gMutex; @@ -125,12 +128,14 @@ void DispatchMsg(DWORD reg) wxMsg.thumb = GetStringByStrAddr(reg + g_WxCalls.recvMsg.thumb); if (!wxMsg.thumb.empty()) { - wxMsg.thumb = GetHomePath() + wxMsg.thumb; + wxMsg.thumb = fs::path(GetHomePath() + wxMsg.thumb).make_preferred().string(); + replace(wxMsg.thumb.begin(), wxMsg.thumb.end(), '\\', '/'); } wxMsg.extra = GetStringByStrAddr(reg + g_WxCalls.recvMsg.extra); if (!wxMsg.extra.empty()) { - wxMsg.extra = GetHomePath() + wxMsg.extra; + wxMsg.extra = fs::path(GetHomePath() + wxMsg.extra).make_preferred().string(); + replace(wxMsg.extra.begin(), wxMsg.extra.end(), '\\', '/'); } {