Advertisement
HEX0x29A

Total Commander Loader (AntiNag) x86

Mar 12th, 2014
581
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.96 KB | None | 0 0
  1. #include <windows.h>
  2.  
  3. #pragma comment(linker,"/MERGE:.rdata=.text")
  4. #pragma comment(linker,"/MERGE:.data=.text")
  5. #pragma comment(linker,"/FILEALIGN:512 /SECTION:.text, /IGNORE:4078")
  6. #pragma comment(linker,"/ENTRY:WinMain")
  7.  
  8. HWND GetButtonHandle(){
  9.   HWND nag = 0;
  10.   HWND result = 0;
  11.   do{
  12.     nag = FindWindowA("TNASTYNAGSCREEN", "Total Commander");
  13.     if (nag != 0){
  14.       HWND notebook = FindWindowExA(nag, NULL, "TNotebook", NULL);
  15.       if (notebook != 0){
  16.         HWND nagpage = FindWindowExA(notebook, NULL, NULL, "NagPage");
  17.         if (nagpage != 0){
  18.           HWND panel = FindWindowExA(nagpage, NULL, "TPanel", NULL);
  19.           if (panel != 0){
  20.             HWND panel1 = FindWindowExA(panel, NULL, "TPanel", NULL);
  21.             if (panel1 != 0){
  22.               char buf[3];
  23.               GetWindowText(panel1, buf, 2);
  24.               switch (atoi(buf)){
  25.                 case (1) : {
  26.                   result = FindWindowExA(panel, NULL, "TButton", "&1");
  27.                   break;
  28.                 }
  29.                 case (2) : {
  30.                   result = FindWindowExA(panel, NULL, "TButton", "&2");
  31.                   break;
  32.                 }
  33.                 case (3) : {
  34.                   result = FindWindowExA(panel, NULL, "TButton", "&3");
  35.                   break;
  36.                 }
  37.                 default: result = 0;
  38.               }
  39.             }
  40.           }
  41.         }
  42.       }
  43.     }
  44.   } while (result == 0);
  45.   return result;
  46. }
  47.  
  48. int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdParam, int nCmdShow){
  49.   WinExec("TOTALCMD.EXE", SW_SHOWNORMAL);
  50.   HWND btn = GetButtonHandle();
  51.   if (btn != 0){
  52.     SendMessage(btn, WM_SETFOCUS, NULL, NULL);
  53.     SendMessage(btn, WM_LBUTTONDOWN, MK_LBUTTON, NULL);
  54.     SendMessage(btn, WM_LBUTTONUP, MK_LBUTTON, NULL);
  55.     HWND tcmd = FindWindow("TTOTAL_CMD", NULL);
  56.     if (tcmd != 0){
  57.       SetWindowText(tcmd, "Total Commander");
  58.     }
  59.   }
  60.   ExitProcess(0);
  61.   return 0;
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement