From ebb45d3cb1fcc075d6bd22bea9f5f80f7fb7375b Mon Sep 17 00:00:00 2001 From: Changhua Date: Fri, 26 Apr 2024 23:23:00 +0800 Subject: [PATCH] Refactoring --- WeChatFerry/spy/funcs.cpp | 3 +++ WeChatFerry/spy/funcs.h | 1 + WeChatFerry/spy/rpc_server.cpp | 2 -- WeChatFerry/spy/spy.cpp | 2 -- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/WeChatFerry/spy/funcs.cpp b/WeChatFerry/spy/funcs.cpp index eeb63f0..eeea91c 100644 --- a/WeChatFerry/spy/funcs.cpp +++ b/WeChatFerry/spy/funcs.cpp @@ -24,6 +24,9 @@ namespace fs = std::filesystem; extern bool gIsListeningPyq; extern WxCalls_t g_WxCalls; extern DWORD g_WeChatWinDllAddr; + +int IsLogin(void) { return (int)GET_DWORD(g_WeChatWinDllAddr + g_WxCalls.login); } + #if 0 static string get_key(uint8_t header1, uint8_t header2, uint8_t *key) { diff --git a/WeChatFerry/spy/funcs.h b/WeChatFerry/spy/funcs.h index ec4e0f8..2b33509 100644 --- a/WeChatFerry/spy/funcs.h +++ b/WeChatFerry/spy/funcs.h @@ -3,6 +3,7 @@ #include "stdint.h" #include +int IsLogin(void); std::string GetAudio(uint64_t id, std::string dir); std::string DecryptImage(std::string src, std::string dst); int RefreshPyq(uint64_t id); diff --git a/WeChatFerry/spy/rpc_server.cpp b/WeChatFerry/spy/rpc_server.cpp index 57fec0d..5357ffb 100644 --- a/WeChatFerry/spy/rpc_server.cpp +++ b/WeChatFerry/spy/rpc_server.cpp @@ -40,8 +40,6 @@ namespace fs = std::filesystem; -extern int IsLogin(void); // Defined in spy.cpp - bool gIsListening = false; bool gIsListeningPyq = false; mutex gMutex; diff --git a/WeChatFerry/spy/spy.cpp b/WeChatFerry/spy/spy.cpp index fd116f4..61bcd67 100644 --- a/WeChatFerry/spy/spy.cpp +++ b/WeChatFerry/spy/spy.cpp @@ -41,5 +41,3 @@ void CleanupSpy() LOG_DEBUG("CleanupSpy"); RpcStopServer(); } - -int IsLogin(void) { return (int)GET_DWORD(g_WeChatWinDllAddr + g_WxCalls.login); }