int _tmain(int argc, _TCHAR* argv[])
{
	HWND hwnd = notepad("test1");
	printf("[-] hwnd: %08x\n", hwnd);
	DWORD buf[3];
	buf[0] = 1;
	buf[1] = (DWORD)hwnd;
	buf[2] = 0xba;
	NtUserConsoleControl(2, buf, 0xc);
	NtGdiSetBitmapDimension(0,0x2f,0xbe, 0x0);
	ShowOwnedPopups(hwnd, 1);
	SetWindowLong(hwnd, -16, 0x42c10000);
	SetClassLong(hwnd, -0x1a, 0x6ba99e04);
	srand( (unsigned) time(NULL));
	Sleep(rand()%1000);
}
Beispiel #2
0
int main(int argc,char *argv[]) {

  BOOL usePfe32       = FALSE;
  BOOL useWinVi32     = FALSE;
  BOOL useUltraedit32 = FALSE;
  BOOL useYikes       = FALSE;

  UINT i;
  char groupPath[MAX_PATH];

  CoInitialize(NULL);


  getExeHome(hugsHome);
  getProgramsFolder(programsFolder);

  /* process command line */
  
  for(i=1; i<argc; ++i) {
    if(strcmp(argv[i],"pfe") == 0)
      usePfe32 = TRUE;
    else if (strcmp(argv[i],"vi") == 0)
      useWinVi32 = TRUE;
    else if (strcmp(argv[i],"uedit") == 0)
      useUltraedit32 = TRUE;
    else if (strcmp(argv[i],"yikes") == 0)
      useYikes = TRUE;
  }

  /* Set editor */
  if (usePfe32)
    setOptions(Pfe32());
  else if (useWinVi32)
    setOptions(WinVi32());
  else if (useUltraedit32)
    setOptions(Ultraedit32());
  else if (useYikes)
    setOptions(Yikes());
  else /* default */
    setOptions(notepad());


  /* set path for documentation */
  writeWinhugsRegString("Doc Path","{Hugs}\\docs");

  /* Falta borrar antiguas entradas en registro */


  /* .hs and .lhs file types */
  writeHKCRString(".hs",           "",         HASKELL_SCRIPT);
  writeHKCRString(".lhs",          "",         HASKELL_SCRIPT);
  writeHKCRString(".hs\\ShellNew", "FileName", TEMPLATE);

  writeHKCRString( HASKELL_SCRIPT,                                    "",          "Haskell Script"                          );
  writeHKCRString( HASKELL_SCRIPT "\\DefaultIcon",                    "",          HASKELL_SCRIPT_ICON                       );
  writeHKCRString( HASKELL_SCRIPT "\\shell",                          "",          ""                                        );

  writeHKCRString( HASKELL_SCRIPT "\\shell\\Open",                    "",          ""                                        );
  writeHKCRString( HASKELL_SCRIPT "\\shell\\Open\\command",           "",          expandHugsPath("\"{Hugs}\\winhugs.exe\" \"%1\" ") );

  writeHKCRString( HASKELL_SCRIPT "\\shell\\Open with hugs",          "",          ""                                        );
  writeHKCRString( HASKELL_SCRIPT "\\shell\\Open with hugs\\command", "",          expandHugsPath("\"{Hugs}\\hugs.exe\" \"%1\" ")    );

  writeHKCRString( HASKELL_SCRIPT "\\shell\\Run",                     "",          ""                                        );
  writeHKCRString( HASKELL_SCRIPT "\\shell\\Run\\command",            "",          expandHugsPath("\"{Hugs}\\runhugs.exe\" \"%1\" ")    );


  /* Create program group */
  sprintf(groupPath, "%s\\" PROGRAM_GROUP, programsFolder);
  CreateFolder (groupPath);


  CreateLink(WINHUGS_EXE, groupPath, "winhugs (haskell 98 mode).lnk", "\"+98\"", NULL);
  CreateLink(WINHUGS_EXE, groupPath, "winhugs (hugs mode).lnk",       "\"-98\"", NULL);
  CreateLink(HUGS_EXE,    groupPath, "hugs (haskell 98 mode).lnk",    "+98",     HUGS_EXE_ICON);
  CreateLink(HUGS_EXE,    groupPath, "hugs (hugs mode).lnk",          "-98",     HUGS_EXE_ICON);


  CoUninitialize();
}