Clients packaged as SC_AES/sRDI shellcode run the payload image as raw shellcode inside the loader stub, so the chat manager was handed the stub's module handle. The stub's resource section only carries a manifest, and Windows resource APIs reject manually mapped images outright, so creating IDD_CHAT failed and the chat thread exited before the window ever existed. The chat window now falls back to an embedded compiled dialog template that is byte-identical to the IDD_CHAT resource, and the title-bar icon is rebuilt directly from the module's own resource directory instead of LoadIcon, bypassing the loader on both paths. The PE walking code checks every offset against SizeOfImage and the resource directory size, so a malformed or truncated image returns NULL instead of faulting. Deployments where the resource lookup already works keep the original code path unchanged. The dialog is now created and driven with the wide-character API. The client is still an MBCS build, but an ANSI dialog renders text with the system code page, so GBK chat text turned into mojibake on German and other non-936 systems. Incoming text is converted CP936 to UTF-16 and outgoing text strictly back to CP936; characters GBK cannot represent (emoji, accented letters) are refused with a visible notice instead of silently becoming '?'. Static labels follow the system UI language, and IDD_CHAT now uses the scalable MS Shell Dlg face so font linking can supply CJK glyphs. The window is now positioned explicitly as well. DS_CENTER in the template put it at the work area origin on the three-monitor host: the centred position came out negative there and Windows clamps out-of-range creation coordinates to that origin. It is centred in the work area of the monitor under the cursor instead, falling back to SPI_GETWORKAREA. Teardown no longer leaves a hidden window behind either. The dialog thread blocked in GetMessageW and never saw m_bRun cleared, while the destructor waited for that thread before sending the message that would have destroyed the window, so a close command that never arrived (the sub-connection already gone, or WaitSendIdle timing out before CancelIO) leaked the window, the dialog thread and the manager loop. The destructor now destroys the window first, the loop checks m_bRun before blocking, and it destroys the window itself if it exits first. Co-Authored-By: deepseek-flash
165 lines
3.7 KiB
Plaintext
165 lines
3.7 KiB
Plaintext
// Microsoft Visual C++ generated resource script.
|
|
//
|
|
#include "resource.h"
|
|
|
|
#define APSTUDIO_READONLY_SYMBOLS
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// Generated from the TEXTINCLUDE 2 resource.
|
|
//
|
|
#include "winres.h"
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
#undef APSTUDIO_READONLY_SYMBOLS
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// 中文(简体,中国) resources
|
|
|
|
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)
|
|
LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
|
|
#pragma code_page(936)
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// Dialog
|
|
//
|
|
|
|
IDD_DIALOG DIALOGEX 0, 0, 180, 108
|
|
STYLE DS_SYSMODAL | DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
|
CAPTION "消息提示"
|
|
FONT 10, "System", 0, 0, 0x0
|
|
BEGIN
|
|
LTEXT "Static",IDC_EDIT_MESSAGE,5,5,170,95
|
|
END
|
|
|
|
IDD_CHAT DIALOGEX 0, 0, 235, 155
|
|
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
|
CAPTION "Remote Chat"
|
|
FONT 9, "MS Shell Dlg", 400, 0, 0x1
|
|
BEGIN
|
|
EDITTEXT IDC_EDIT_CHATLOG,3,3,229,107,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL
|
|
EDITTEXT IDC_EDIT_NEWMSG,3,113,170,38,ES_MULTILINE | ES_AUTOVSCROLL | WS_VSCROLL
|
|
DEFPUSHBUTTON "Send",IDC_BUTTON_SEND,178,116,54,14
|
|
PUSHBUTTON "End Chat",IDC_BUTTON_END,178,133,54,14
|
|
END
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// DESIGNINFO
|
|
//
|
|
|
|
#ifdef APSTUDIO_INVOKED
|
|
GUIDELINES DESIGNINFO
|
|
BEGIN
|
|
IDD_DIALOG, DIALOG
|
|
BEGIN
|
|
END
|
|
|
|
IDD_CHAT, DIALOG
|
|
BEGIN
|
|
END
|
|
END
|
|
#endif // APSTUDIO_INVOKED
|
|
|
|
|
|
#ifdef APSTUDIO_INVOKED
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// TEXTINCLUDE
|
|
//
|
|
|
|
1 TEXTINCLUDE
|
|
BEGIN
|
|
"resource.h\0"
|
|
END
|
|
|
|
2 TEXTINCLUDE
|
|
BEGIN
|
|
"#include ""winres.h""\r\n"
|
|
"\0"
|
|
END
|
|
|
|
3 TEXTINCLUDE
|
|
BEGIN
|
|
"\r\n"
|
|
"\0"
|
|
END
|
|
|
|
#endif // APSTUDIO_INVOKED
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// WAVE
|
|
//
|
|
|
|
IDR_WAVE WAVE "Res\\msg.wav"
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// Version
|
|
//
|
|
|
|
VS_VERSION_INFO VERSIONINFO
|
|
FILEVERSION 1,0,4,1
|
|
PRODUCTVERSION 1,0,0,1
|
|
FILEFLAGSMASK 0x3fL
|
|
#ifdef _DEBUG
|
|
FILEFLAGS 0x1L
|
|
#else
|
|
FILEFLAGS 0x0L
|
|
#endif
|
|
FILEOS 0x40004L
|
|
FILETYPE 0x2L
|
|
FILESUBTYPE 0x0L
|
|
BEGIN
|
|
BLOCK "StringFileInfo"
|
|
BEGIN
|
|
BLOCK "080404b0"
|
|
BEGIN
|
|
VALUE "CompanyName", "FUCK THE UNIVERSE"
|
|
VALUE "FileDescription", "A GHOST"
|
|
VALUE "FileVersion", "1.0.4.1"
|
|
VALUE "InternalName", "ServerDll.dll"
|
|
VALUE "LegalCopyright", "Copyright (C) 2019-2026"
|
|
VALUE "OriginalFilename", "ServerDll.dll"
|
|
VALUE "ProductName", "A GHOST"
|
|
VALUE "ProductVersion", "1.0.0.1"
|
|
END
|
|
END
|
|
BLOCK "VarFileInfo"
|
|
BEGIN
|
|
VALUE "Translation", 0x804, 1200
|
|
END
|
|
END
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// Icon
|
|
//
|
|
|
|
// Icon with lowest ID value placed first to ensure application icon
|
|
// remains consistent on all systems.
|
|
IDI_ICON_MAIN ICON "Res\\ghost.ico"
|
|
|
|
IDI_ICON_MSG ICON "Res\\msg.ico"
|
|
|
|
#endif // 中文(简体,中国) resources
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef APSTUDIO_INVOKED
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// Generated from the TEXTINCLUDE 3 resource.
|
|
//
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
#endif // not APSTUDIO_INVOKED
|
|
|