void Usage() { Logo(); printf("usage: rcrack rainbow_table_pathname -h hash\n"); printf(" rcrack rainbow_table_pathname -l hash_list_file\n"); printf(" rcrack rainbow_table_pathname -f pwdump_file\n"); printf("rainbow_table_pathname: pathname of the rainbow table(s), wildchar(*, ?) supported\n"); printf("-h hash: use raw hash as input\n"); printf("-l hash_list_file: use hash list file as input, each hash in a line\n"); printf("-f pwdump_file: use pwdump file as input, this will handle lanmanager hash only\n"); printf("\n"); printf("example: rcrack *.rt -h 5d41402abc4b2a76b9719d911017c592\n"); printf(" rcrack *.rt -l hash.txt\n"); printf(" rcrack *.rt -f hash.txt\n"); }
void main(int argc, char *argv[]) { if (argc==1) { Tipo_Usuario *Tat; Tipo_Estacion *Estacion; Tipo_Bicicleta *Bici; Tat=Carga_memoria_usuarios(); Bici=Carga_memoria_bicicleta(); Estacion=Carga_memoria_estacion(); system("clear"); printf("\t\t\t\t\t\tDesarrollado por: Alonso de Cosio y Manuel Nader\n"); Logo(); printf("\n\n\t\t\t\t\t\t\t\t:D Bienvenido :D\n\n"); printf("\t\t\t\t\t\tPor favor llene los siguientes campos correctamente\n\n"); Acceso(Tat,Estacion,Bici); } else { if(argc>3) { printf("Esos parametros no son validos. Usa -h para obtener ayuda.\n"); } switch(argv[1][1]) { case 'h': case 'H': Ayuda(); break; case 'c': case 'C': Creditos(); break; case 'u': case 'U': if((argv[1][2]=='s' && argv[1][3]=='u') || (argv[1][2]=='S' && argv[1][3]=='U')) { Usuarios(); } else { printf("Esos parametros no son validos. Usa -h para obtener ayuda.\n"); } break; default: printf("Esos parametros no son validos. Usa -h para obtener ayuda.\n"); break; } } }
// Vẽ board void VeBoardMenu() { cBoard board; system("Color 3F"); resizeBuffer(79, 35); Logo(); board.drawBoard(27, 20, 51, 30, 2, 14, "* Menu *", 14); board.drawBoard(28, 21, 50, 29, 2); gotoxy(30, 23); cout << "_ So nguyen 8 byte"; gotoxy(30, 25); cout << "_ So nguyen 16 byte"; gotoxy(30, 27); cout << "_ So thuc 16 byte"; gotoxy(21, 32); cout << "* Su dung phim mui ten de di chuyen"; gotoxy(25, 33); cout << "* Su dung phim ENTER de chon"; }
/******************************************************************************************* > BOOL BitmapPreviewData::GenerateHTMLStub(BrowserPreviewOptions BrowserOptions) Author: Stefan_Stoykov (Xara Group Ltd) <*****@*****.**> Created: 24/6/97 Inputs: BrowserOptions - the options for generating the html page Purpose: Generate a html file which includes our bitmap, together with some other optional stuff. Used for browser preview. *******************************************************************************************/ BOOL BitmapPreviewData::GenerateHTMLStub(BrowserPreviewOptions BrowserOptions) { PORTNOTE("other","Removed _R(IDD_TIMAPOPTIONS) - isn't wanted yet") #ifndef EXCLUDE_FROM_XARALX // sanity checks // check for export options ERROR3IF(m_pOptions == NULL, "BitmapPreviewData::GenerateHTMLStub - need export options"); if (m_pOptions == NULL) // we need export options return FALSE; // get the path for the exported bitmap from the options PathName TempPath = m_pOptions->GetPathName(); // check for exported bitmap ERROR3IF((m_pOptions->HasTempFile() == FALSE) || (TempPath.IsValid() == FALSE), "BitmapPreviewData::GenerateHTMLStub - need exported bitmap"); if ((m_pOptions->HasTempFile() == FALSE) || (TempPath.IsValid() == FALSE)) return FALSE; // delete the previous temp file, if any if (m_pTempHTMLPath != NULL) FileUtil::DeleteFile(m_pTempHTMLPath); else m_pTempHTMLPath = new PathName; // safety check if (m_pTempHTMLPath == NULL) return FALSE; // create a new temp file if (FileUtil::GetTemporaryPathName( _T("htm"),m_pTempHTMLPath) == FALSE) { delete m_pTempHTMLPath; m_pTempHTMLPath = NULL; return FALSE; } // start creating the html page // create a disk file CCDiskFile TempDiskFile(1024, FALSE, TRUE); // get path name to server, so we can find the logo bitmaps CString str; AfxGetModuleShortFileName(AfxGetInstanceHandle(), str); String_256 strPathName(str.GetBuffer(0)); // create a path name object from the program name PathName ProgramPath(strPathName); try { // open it for reading if (!TempDiskFile.open(*m_pTempHTMLPath, ios::out)) return FALSE; // output header String_256 s(_R(IDS_HTML_HEAD)); TempDiskFile.write(s); // set the background attributes switch (BrowserOptions.m_Background) { case BROWSER_BGR_DOC: { // set the background from the document page if (!SetBackgroundFromPage(TempDiskFile, BrowserOptions.m_pSpread)) ERROR3("Setting the html background from the document page failed\n"); } break; case BROWSER_BGR_CHECKER: { // display the checkered bitmap as background // get the checkered bitmap name String_256 Checker(_R(IDS_HTML_CHECKER)); // set it in the path ProgramPath.SetFileNameAndType(Checker); // set the checkered bitmap as background image s.MakeMsg(_R(IDS_CHECK_BACK), (TCHAR *)ProgramPath.GetWebAddress()); TempDiskFile.write(s); } break; case BROWSER_BGR_BITMAP: { // set our bitmap as background image s.MakeMsg(_R(IDS_BITMAPED_BACKGROUND), (TCHAR *)TempPath.GetWebAddress()); TempDiskFile.write(s); } break; case BROWSER_BGR_NONE: { String_256 background(_R(IDS_PLAIN_BACKGROUND)); TempDiskFile.write(background); } break; default: ERROR3("Unknown type of BrowserOptions.m_Background"); break; } // end of switch(BrowserOptions.m_Background) block // Get a pointer to the actual bitmap so that we can get some details from it. // OILBitmap *pOilBitmap = m_pBitmap->ActualBitmap; // ERROR3IF(pOilBitmap == NULL,"BitmapPreviewData::GenerateBitmapInfoStrings NULL oil bitmap pointer"); // Get the details from the specified bitmap // BitmapInfo BmInfo; // pOilBitmap->GetInfo(&BmInfo); // output our bitmap, but only if it wasn't already set as background String_256 s2(_R(IDS_PAGE_TITLE)); TempDiskFile.write(s2); if (BrowserOptions.m_Background != BROWSER_BGR_BITMAP) { // output the bitmap if (m_pOptions->GetFilterType() == MAKE_BITMAP_FILTER) { // GIF animation s.MakeMsg(_R(IDS_DISPLAY_PIC), (const TCHAR *)TempPath.GetFileName()); } else { if( m_pOptions->GetFilterNameStrID() == _R(IDN_FILTERNAME_GIF) || m_pOptions->GetFilterNameStrID() == _R(IDS_JPG_EXP_FILTERNAME) || m_pOptions->GetFilterNameStrID() == _R(IDT_FILTERNAME_BMP) ) { s.MakeMsg(_R(IDS_DISPLAY_BMP), (const TCHAR *)TempPath.GetFileName()); } else if( m_pOptions->GetFilterNameStrID() == _R(IDS_FILTERNAME_PNG) ) s.MakeMsg(_R(IDS_DISPLAY_PNG), (const TCHAR *)TempPath.GetFileName()); } TempDiskFile.write(s); } else { s.MakeMsg(_R(IDS_EMPTY_BOX)); TempDiskFile.write(s); } switch (m_pOptions->GetFilterNameStrID()) { case _R(IDT_FILTERNAME_BMP): s2.MakeMsg(_R(IDS_BMP_MESSAGE)); s.MakeMsg(_R(IDS_WARNING_BOX), (TCHAR *)s2); TempDiskFile.write(s); break; case _R(IDS_FILTERNAME_PNG): s2.MakeMsg(_R(IDS_PNG_MESSAGE)); s.MakeMsg(_R(IDS_WARNING_BOX), (TCHAR *)s2); TempDiskFile.write(s); break; } // end of switch(m_pOptions->GetFilterNameStrID()) s.MakeMsg(_R(IDS_DETAILS_BUILD)); TempDiskFile.write(s); // output the bitmap info, if requested if (BrowserOptions.m_bInfo != FALSE) { String_64 ImageSize; String_64 FileSize; BOOL m_bTransparent = FALSE; INT32 count; count=0; // generate the info strings if (m_pOptions->GetFilterType() == MAKE_BITMAP_FILTER) { // This is actually the export animated GIF using the frame gallery system MakeBitmapExportOptions* pMkBOptions = (MakeBitmapExportOptions*)m_pOptions; ERROR3IF(!pMkBOptions->IS_KIND_OF(MakeBitmapExportOptions), "pMkBOptions isn't"); PALETTE Palette = PAL_OPTIMISED; DITHER DitherType; UINT32 colDepth; String_64 sPalette; String_64 Dither; UINT32 NoOfColours; NoOfColours=m_pOptions->GetNumColsInPalette(); // Palette = pMkBOptions->GetPalette(); DitherType = pMkBOptions->GetDither(); colDepth = pMkBOptions->GetDepth(); s2.MakeMsg(_R(IDS_ANIMATED_GIF)); if (pMkBOptions->WantTransparent()) { s2.MakeMsg(_R(IDS_TRANSPARENT),"animated GIF"); } s.MakeMsg(_R(IDS_TEXTLINE_BR),(const TCHAR*)s2); TempDiskFile.write(s); switch (Palette) { case PAL_OPTIMISED: sPalette.MakeMsg(_R(IDS_OPTIMISED_PAL)); break; case PAL_BROWSER: case PAL_STANDARD: sPalette.MakeMsg(_R(IDS_BROWSER_PAL)); break; case PAL_GLOBALOPTIMISED: sPalette.MakeMsg(_R(IDS_GLOBAL_OPT)); break; } if (colDepth == 8 && (Palette == PAL_STANDARD || Palette == PAL_BROWSER) ) { NoOfColours = 216; } switch (colDepth) { case 32: case 24: s2.MakeMsg(_R(IDS_TRUECOLOUR),colDepth); break; case 8: { // Include the transparent colour in the colour depth check UINT32 RealNumberOfColours = NoOfColours; if (colDepth <= 8 && pMkBOptions->WantTransparent()) { UINT32 MaxColours = UINT32(pow(2,colDepth)); RealNumberOfColours++; if (RealNumberOfColours > MaxColours) RealNumberOfColours = MaxColours; } // We say 8 but we really mean the number of colours deep // We cannot say 2 colours = 2bpp as we save it as 10 colours due // to having 1 transparent colour and the usual lets pick 10 as the // transparent colour. Cannot allow the user to choose 1 as the code // then outputs 8bpp as GRenderOptPalette::GetOptimisedPalette has the // test if (ReservedColours < NumColours), which fails. /* if (RealNumberOfColours <= 2) s2.MakeMsg(_R(IDS_PALETTEINFO),2,NoOfColours,(const TCHAR*)sPalette); else */ if (RealNumberOfColours <= 16) s2.MakeMsg(_R(IDS_PALETTEINFO),4,NoOfColours,(const TCHAR*)sPalette); else s2.MakeMsg(_R(IDS_AN_PALINFO),colDepth,NoOfColours,(const TCHAR*)sPalette); break; } case 1: s2.MakeMsg(_R(IDS_MONO),colDepth); break; case 4: default: s2.MakeMsg(_R(IDS_PALETTEINFO),colDepth,NoOfColours,(const TCHAR*)sPalette); break; } TempDiskFile.write(s2); s.MakeMsg(_R(IDS_NODITHER)); switch (DitherType) { case XARADITHER_ORDERED: case XARADITHER_ORDERED_GREY: Dither.MakeMsg(_R(IDS_DITH_ORDER)); s.MakeMsg(_R(IDS_DITHERING),(const TCHAR*) Dither); break; case XARADITHER_ERROR_DIFFUSION: case XARADITHER_SIMPLE: Dither.MakeMsg(_R(IDS_DITH_ERROR)); s.MakeMsg(_R(IDS_DITHERING),(const TCHAR*) Dither); break; case XARADITHER_NONE: s.MakeMsg(_R(IDS_NODITHER)); break; } TempDiskFile.write(s); } // if (m_pOptions->GetFilterType() == MAKE_BITMAP_FILTER) block ends else { switch (m_pOptions->GetFilterNameStrID()) { case _R(IDN_FILTERNAME_GIF): { GIFExportOptions* pGIFOptions = (GIFExportOptions*)m_pOptions; ERROR3IF(!pGIFOptions->IS_KIND_OF(GIFExportOptions), "pGIFOptions isn't"); PALETTE Palette = PAL_OPTIMISED; DITHER DitherType; UINT32 colDepth; String_64 sPalette; String_64 Dither; UINT32 NoOfColours; NoOfColours=m_pOptions->GetNumColsInPalette(); // Palette = pGIFOptions->GetPalette(); DitherType = pGIFOptions->GetDither(); colDepth = pGIFOptions->GetDepth(); if (pGIFOptions->WantTransparent()) count=count+1; if (pGIFOptions->WantInterlaced()) count=count+2; s.MakeMsg(_R(IDS_GIF)); s2.MakeMsg(_R(IDS_A), (const TCHAR*)s); switch (count) { case 1: s2.MakeMsg(_R(IDS_TRANSPARENT),"GIF"); break; case 2: s2.MakeMsg(_R(IDS_INTERLACED),"GIF"); break; case 3: s2.MakeMsg(_R(IDS_INTER_TRANS),"GIF"); break; case 0: break; } s.MakeMsg(_R(IDS_TEXTLINE_BR),(const TCHAR*)s2); TempDiskFile.write(s); switch (Palette) { case PAL_OPTIMISED: sPalette.MakeMsg(_R(IDS_OPTIMISED_PAL)); break; case PAL_BROWSER: case PAL_STANDARD: sPalette.MakeMsg(_R(IDS_BROWSER_PAL)); break; case PAL_GLOBALOPTIMISED: sPalette.MakeMsg(_R(IDS_GLOBAL_OPT)); break; } if (colDepth == 8 && (Palette == PAL_STANDARD || Palette == PAL_BROWSER) ) { NoOfColours = 216; } s2.MakeMsg(_R(IDS_PALETTEINFO),colDepth,NoOfColours,(const TCHAR*)sPalette); if (colDepth == 8) s2.MakeMsg(_R(IDS_AN_PALINFO),colDepth,NoOfColours,(const TCHAR*)sPalette); if (colDepth == 1) s2.MakeMsg(_R(IDS_MONO),colDepth); if (colDepth > 8) s2.MakeMsg(_R(IDS_TRUECOLOUR),colDepth); TempDiskFile.write(s2); s.MakeMsg(_R(IDS_NODITHER)); switch (DitherType) { case XARADITHER_ORDERED: case XARADITHER_ORDERED_GREY: Dither.MakeMsg(_R(IDS_DITH_ORDER)); s.MakeMsg(_R(IDS_DITHERING),(const TCHAR*) Dither); break; case XARADITHER_ERROR_DIFFUSION: case XARADITHER_SIMPLE: Dither.MakeMsg(_R(IDS_DITH_ERROR)); s.MakeMsg(_R(IDS_DITHERING),(const TCHAR*) Dither); break; case XARADITHER_NONE: s.MakeMsg(_R(IDS_NODITHER)); break; } TempDiskFile.write(s); } // end case _R(IDN_FILTERNAME_GIF) break; case _R(IDS_JPG_EXP_FILTERNAME): { JPEGExportOptions* pJPEGOptions = (JPEGExportOptions *)m_pOptions; ERROR3IF(!pJPEGOptions->IS_KIND_OF(JPEGExportOptions), "pJPEGOptions isn't"); INT32 Quality = pJPEGOptions->GetQuality(); // Default Quality BOOL Progressive = pJPEGOptions->DoAsProgressive(); if (Quality > 100) Quality = 100; s.MakeMsg(_R(IDS_JPEG)); s2.MakeMsg(_R(IDS_A), (const TCHAR*)s); if (Progressive) s2.MakeMsg(_R(IDS_PROGRESSIVE)); s.MakeMsg(_R(IDS_TEXTLINE_BR),(const TCHAR*)s2); TempDiskFile.write(s); s.MakeMsg(_R(IDS_JCOMPRESSION),Quality); TempDiskFile.write(s); } // end case _R(IDS_JPG_EXP_FILTERNAME) break; case _R(IDT_FILTERNAME_BMP): { BMPExportOptions* pBMPOptions = (BMPExportOptions*)m_pOptions; ERROR3IF(!pBMPOptions->IS_KIND_OF(BMPExportOptions), "pBMPOptions isn't"); PALETTE Palette; DITHER DitherType; UINT32 colDepth; String_64 sPalette; String_64 Dither; UINT32 NoOfColours; NoOfColours=m_pOptions->GetNumColsInPalette(); Palette = pBMPOptions->GetPalette(); DitherType = pBMPOptions->GetDither(); colDepth = pBMPOptions->GetDepth(); s.MakeMsg(_R(IDS_BMP)); s2.MakeMsg(_R(IDS_A), (const TCHAR*)s); s.MakeMsg(_R(IDS_TEXTLINE_BR),(const TCHAR*)s2); TempDiskFile.write(s); switch (Palette) { case PAL_OPTIMISED: sPalette.MakeMsg(_R(IDS_OPTIMISED_PAL)); break; case PAL_BROWSER: case PAL_STANDARD: sPalette.MakeMsg(_R(IDS_BROWSER_PAL)); break; case PAL_GLOBALOPTIMISED: sPalette.MakeMsg(_R(IDS_GLOBAL_OPT)); break; } if (colDepth == 8 && (Palette == PAL_STANDARD || Palette == PAL_BROWSER) ) { NoOfColours = 216; } if (colDepth == 8 && NoOfColours > 256) NoOfColours = 256; s2.MakeMsg(_R(IDS_PALETTEINFO),colDepth,NoOfColours,(const TCHAR*)sPalette); if (colDepth == 8) s2.MakeMsg(_R(IDS_AN_PALINFO),colDepth,NoOfColours,(const TCHAR*)sPalette); if (colDepth == 1) s2.MakeMsg(_R(IDS_MONO),colDepth); if (colDepth > 8) s2.MakeMsg(_R(IDS_TRUECOLOUR),colDepth); TempDiskFile.write(s2); s.MakeMsg(_R(IDS_NODITHER)); switch (DitherType) { case XARADITHER_ORDERED: case XARADITHER_ORDERED_GREY: Dither.MakeMsg(_R(IDS_DITH_ORDER)); s.MakeMsg(_R(IDS_DITHERING),(const TCHAR*) Dither); break; case XARADITHER_ERROR_DIFFUSION: case XARADITHER_SIMPLE: Dither.MakeMsg(_R(IDS_DITH_ERROR)); s.MakeMsg(_R(IDS_DITHERING),(const TCHAR*) Dither); break; case XARADITHER_NONE: s.MakeMsg(_R(IDS_NODITHER)); break; } TempDiskFile.write(s); } // end case _R(IDT_FILTERNAME_BMP) break; case _R(IDS_FILTERNAME_PNG): { PNGExportOptions* pPNGOptions = (PNGExportOptions*)m_pOptions; ERROR3IF(!pPNGOptions->IS_KIND_OF(PNGExportOptions), "pPNGOptions isn't"); PALETTE Palette = PAL_OPTIMISED; DITHER DitherType; UINT32 colDepth; String_64 sPalette; String_64 Dither; UINT32 NoOfColours; NoOfColours=m_pOptions->GetNumColsInPalette(); // Palette = pPNGOptions->GetPalette(); DitherType = pPNGOptions->GetDither(); colDepth = pPNGOptions->GetDepth(); if (pPNGOptions->WantTransparent()) count=count+1; if (pPNGOptions->WantInterlaced()) count=count+2; s.MakeMsg(_R(IDS_PNG)); s2.MakeMsg(_R(IDS_A), (const TCHAR*)s); switch (count) { case 1: s2.MakeMsg(_R(IDS_TRANSPARENT),"PNG"); break; case 2: s2.MakeMsg(_R(IDS_INTERLACED),"PNG"); break; case 3: s2.MakeMsg(_R(IDS_INTER_TRANS),"PNG"); break; case 0: break; } s.MakeMsg(_R(IDS_TEXTLINE_BR),(const TCHAR*)s2); TempDiskFile.write(s); switch (Palette) { case PAL_OPTIMISED: sPalette.MakeMsg(_R(IDS_OPTIMISED_PAL)); break; case PAL_BROWSER: case PAL_STANDARD: sPalette.MakeMsg(_R(IDS_BROWSER_PAL)); break; case PAL_GLOBALOPTIMISED: sPalette.MakeMsg(_R(IDS_GLOBAL_OPT)); break; } if (colDepth == 8 && (Palette == PAL_STANDARD || Palette == PAL_BROWSER) ) { NoOfColours = 216; } s2.MakeMsg(_R(IDS_PALETTEINFO),colDepth,NoOfColours,(const TCHAR*)sPalette); if (colDepth == 8) s2.MakeMsg(_R(IDS_AN_PALINFO),colDepth,NoOfColours,(const TCHAR*)sPalette); if (colDepth == 1) s2.MakeMsg(_R(IDS_MONO),colDepth); if (colDepth > 8) s2.MakeMsg(_R(IDS_TRUECOLOUR),colDepth); TempDiskFile.write(s2); s.MakeMsg(_R(IDS_NODITHER)); switch (DitherType) { case XARADITHER_ORDERED: case XARADITHER_ORDERED_GREY: Dither.MakeMsg(_R(IDS_DITH_ORDER)); s.MakeMsg(_R(IDS_DITHERING),(const TCHAR*) Dither); break; case XARADITHER_ERROR_DIFFUSION: case XARADITHER_SIMPLE: Dither.MakeMsg(_R(IDS_DITH_ERROR)); s.MakeMsg(_R(IDS_DITHERING),(const TCHAR*) Dither); break; case XARADITHER_NONE: s.MakeMsg(_R(IDS_NODITHER)); break; } TempDiskFile.write(s); } // end case _R(IDS_FILTERNAME_PNG) break; } // end switch (m_pOptions->GetFilterNameStrID()) } // end else block GenerateBitmapInfoStrings(ImageSize, FileSize); // output the bitmap info s.MakeMsg(_R(IDS_HTML_INFO1), (TCHAR *)ImageSize); TempDiskFile.write(s); // output the bitmap file size info s.MakeMsg(_R(IDS_HTML_INFO2), (TCHAR *)FileSize); TempDiskFile.write(s); s.MakeMsg(_R(IDS_CLOSE_CENTER)); TempDiskFile.write(s); s.MakeMsg(_R(IDS_TDTR_CLOSE)); TempDiskFile.write(s); s.MakeMsg(_R(IDS_BANNER_BOX)); TempDiskFile.write(s); s.MakeMsg(_R(IDS_SPEED_BUILD)); TempDiskFile.write(s); // s.MakeMsg(_R(IDS_SPEED_BUILD2)); // TempDiskFile.write(s); s.MakeMsg(_R(IDS_ES_TR)); TempDiskFile.write(s); String_64 times; s.MakeMsg(_R(IDS_TIME_ENTRY),"14.4k"); TempDiskFile.write(s); CalculateTime(times,14400.0); TempDiskFile.write(times); s.MakeMsg(_R(IDS_ES_TR)); TempDiskFile.write(s); s.MakeMsg(_R(IDS_TIME_ENTRY),"28.8k"); TempDiskFile.write(s); CalculateTime(times,28800.0); TempDiskFile.write(times); s.MakeMsg(_R(IDS_ES_TR)); TempDiskFile.write(s); s.MakeMsg(_R(IDS_TIME_ENTRY),"33.6k"); TempDiskFile.write(s); CalculateTime(times,33600.0); TempDiskFile.write(times); s.MakeMsg(_R(IDS_ES_TR)); TempDiskFile.write(s); s.MakeMsg(_R(IDS_TIME_ENTRY),"57.6k"); TempDiskFile.write(s); CalculateTime(times,57600.0); TempDiskFile.write(times); s.MakeMsg(_R(IDS_ES_TR)); TempDiskFile.write(s); s.MakeMsg(_R(IDS_TIME_ENTRY),"64k"); TempDiskFile.write(s); CalculateTime(times,65536.0); TempDiskFile.write(times); s.MakeMsg(_R(IDS_ES_TR)); TempDiskFile.write(s); s.MakeMsg(_R(IDS_TIME_ENTRY),"128k"); TempDiskFile.write(s); CalculateTime(times,131072.0); TempDiskFile.write(times); // s.MakeMsg(_R(IDS_ES_TR)); // TempDiskFile.write(s); s.MakeMsg(_R(IDS_SPEED_END)); TempDiskFile.write(s); TRACE( _T("m_FileSize = %d"), m_FileSize); } // end of if (BrowserOptions.m_bInfo != FALSE) String_64 webaddy(_R(IDS_HTML_URL_PROGRAM)); //Mark Howitt, 29/10/97. Setup the _R(IDS_HTML_URL_VISITMSG) To be a TCHAR* Also. It likes it that way! String_64 webvmess(_R(IDS_HTML_URL_VISITMSG)); s.MakeMsg(_R(IDS_LINK_BOX),(TCHAR *)webaddy,(TCHAR *)webvmess); TempDiskFile.write(s); //end of my stuff s.MakeMsg(_R(IDS_END_TABLE)); TempDiskFile.write(s); s.MakeMsg(_R(IDS_CLOSE_CENTER)); TempDiskFile.write(s); // output the "Exported from" string // get the xara logo file name String_256 Logo(_R(IDS_HTML_XARALOGO)); // set it in the path ProgramPath.SetFileNameAndType(Logo); // get the xara link String_256 URL(_R(IDS_HTML_URL_XARA)); // output the xara link and the xara logo s.MakeMsg(_R(IDS_HTML_XARA), (TCHAR *)URL, (TCHAR *)ProgramPath.GetWebAddress()); TempDiskFile.write(s); // Do not display the Xara X logo bottom right... /* // get the program logo file name Logo.Load(_R(IDS_HTML_PROGRAMLOGO)); // set it in the path ProgramPath.SetFileNameAndType(Logo); // output the program link URL.Load(_R(IDS_HTML_URL_PROGRAM)); s.MakeMsg(_R(IDS_HTML_PROGRAM), (TCHAR *)URL, (TCHAR *)ProgramPath.GetWebAddress()); TempDiskFile.write(s); */ // output the end of the file s.Load(_R(IDS_HTML_END)); TempDiskFile.write(s); // close the file TempDiskFile.close(); // now export the image map, if the option for that is set if (BrowserOptions.m_bImagemap != FALSE) { // export the image map ExportImagemap( TempDiskFile, m_pTempHTMLPath, m_pOptions->GetSelectionType(), m_pOptions->GetDPI(), BrowserOptions.m_ifoImagemapOptions); } TCHAR *FileWebAddress = m_pTempHTMLPath->GetWebAddress(); //Graham 17/9/97 ProgramPath.SetFileNameAndType(PRODUCT_WEBLINKEXENAME); const TCHAR *PathToWebLink = (const TCHAR *)ProgramPath.GetPath(); String_256 CmdLine = PathToWebLink + String_256(" -f ") + FileWebAddress; //TCHAR *CommandLine = (TCHAR *)CmdLine; if (!InvokeWeblink(CmdLine)) return FALSE; } // end of TRY block catch( CFileException ) { // any disk problems - come here // not much we can do really - just close the file and return FALSE if (TempDiskFile.isOpen()) TempDiskFile.close(); return FALSE; } #endif return TRUE; }
int main(int argc, char* argv[]) { if (argc != 3) { Logo(); printf("usage: rtdump rainbow_table_pathname rainbow_chain_index\n"); return 0; } string sPathName = argv[1]; int nRainbowChainIndex = atoi(argv[2]); int nRainbowChainLen, nRainbowChainCount; if (!CChainWalkContext::SetupWithPathName(sPathName, nRainbowChainLen, nRainbowChainCount)) return 0; if (nRainbowChainIndex < 0 || nRainbowChainIndex > nRainbowChainCount - 1) { printf("valid rainbow chain index range: 0 - %d\n", nRainbowChainCount - 1); return 0; } // Open file FILE* file = fopen(sPathName.c_str(), "rb"); if (file == NULL) { printf("failed to open %s\n", sPathName.c_str()); return 0; } // Dump if (GetFileLen(file) != nRainbowChainCount * 16) printf("rainbow table size check fail\n"); else { // Read required chain RainbowChain chain; fseek(file, nRainbowChainIndex * 16, SEEK_SET); fread(&chain, 1, 16, file); // Dump required chain CChainWalkContext cwc; cwc.SetIndex(chain.nIndexS); int nPos; for (nPos = 0; nPos < nRainbowChainLen - 1; nPos++) { cwc.IndexToPlain(); cwc.PlainToHash(); printf("#%-4d %s %s %s\n", nPos, uint64tohexstr(cwc.GetIndex()).c_str(), cwc.GetPlainBinary().c_str(), cwc.GetHash().c_str()); cwc.HashToIndex(nPos); } printf("#%-4d %s\n", nPos, uint64tohexstr(cwc.GetIndex()).c_str()); if (cwc.GetIndex() != chain.nIndexE) printf("\nwarning: rainbow chain integrity check fail!\n"); } // Close file fclose(file); return 0; }
int main() { std::vector<int> table; for (int i = 0; i < table.size(); ++i) { table[i]++; x++; } int x = 10; for (int i = 0; i < x; ++i) { x += i; } while (x != 0) { printf("%d\n", x); x--; } int const MIN = 41, MAX = 44; int i, item = MIN; char itemsMenu[4][21]; char key; CharToOem("ďî ÔČÎ\0", itemsMenu[0]); CharToOem("ďî ďŕńďîđňíűě äŕííűě\0", itemsMenu[1]); CharToOem("ďî äŕňĺ çŕńĺëĺíč˙\0", itemsMenu[2]); CharToOem("ďî äŕňĺ âűńĺëĺíč˙\0", itemsMenu[3]); done = False; do { int x; int YELLOW; int d; for (int i = 0; i < count; ++i) { for (std::vector<int>::iterator i = ta.begin(); i != ta.end(); ++i) { ta[i]++; } } window(21, 19, 44, 24); //ăëŕâíîĺ ěĺíţ textbackground(LIGHTCYAN); textcolor(WHITE); clrscr(); cprintf("\r\n"); for (i = MIN; i <= MAX; i++) { if (i == item) { textcolor(YELLOW); cprintf(" %s\r\n", itemsMenu[i-MIN]); textcolor(WHITE); } else { cprintf(" %s\r\n", itemsMenu[i-MIN]); } } key = getch(); PressKeyMenu(key, &item, MIN, MAX); textbackground(BLACK); clrscr(); } while ((key != '\x1b') && (!done)); //Alt+F4 or ESC clrscr(); if (done) { _setcursortype(_NOCURSOR); window(1, 1, 80, 25); textbackground(BLACK); clrscr(); Logo(); } return 0; }
int Starcon2Main (void *threadArg) { #if CREATE_JOURNAL { int ac = argc; char **av = argv; while (--ac > 0) { ++av; if ((*av)[0] == '-') { switch ((*av)[1]) { #if CREATE_JOURNAL case 'j': ++create_journal; break; #endif //CREATE_JOURNAL } } } } #endif // CREATE_JOURNAL { /* TODO: Put initAudio back in main where it belongs once threading * is gone. */ extern sint32 initAudio (sint32 driver, sint32 flags); initAudio (snddriver, soundflags); } if (!LoadKernel (0,0)) { log_add (log_Fatal, "\n *** FATAL ERROR: Could not load basic content ***\n\nUQM requires at least the base content pack to run properly."); log_add (log_Fatal, "This file is typically called uqm-%d.%d.0.uqm. UQM was expecting it", P6014_MAJOR_VERSION, P6014_MINOR_VERSION); log_add (log_Fatal, "in the %s/packages directory.", baseContentPath); log_add (log_Fatal, "Either your installation did not install the content pack at all, or it\ninstalled it in a different directory.\n\nFix your installation and rerun UQM.\n\n *******************\n"); exit (EXIT_FAILURE); } log_add (log_Info, "We've loaded the Kernel"); Logo (); GLOBAL (CurrentActivity) = 0; // show splash and init the kernel in the meantime SplashScreen (BackgroundInitKernel); // OpenJournal (); while (StartGame ()) { // Initialise a new game if (!SetPlayerInputAll ()) { log_add (log_Fatal, "Could not set player input."); explode (); // Does not return; } InitGameStructures (); InitGameClock (); AddInitialGameEvents(); do { #ifdef DEBUG if (debugHook != NULL) { void (*saveDebugHook) (void); saveDebugHook = debugHook; debugHook = NULL; // No further debugHook calls unless the called // function resets debugHook. (*saveDebugHook) (); continue; } #endif SetStatusMessageMode (SMM_DEFAULT); if (!((GLOBAL (CurrentActivity) | NextActivity) & CHECK_LOAD)) ZeroVelocityComponents (&GLOBAL (velocity)); // not going into talking pet conversation else if (GLOBAL (CurrentActivity) & CHECK_LOAD) GLOBAL (CurrentActivity) = NextActivity; if ((GLOBAL (CurrentActivity) & START_ENCOUNTER) || GET_GAME_STATE (CHMMR_BOMB_STATE) == 2) { if (GET_GAME_STATE (CHMMR_BOMB_STATE) == 2 && !GET_GAME_STATE (STARBASE_AVAILABLE)) { /* BGD mode */ InstallBombAtEarth (); } else if (GET_GAME_STATE (GLOBAL_FLAGS_AND_DATA) == (BYTE)~0 || GET_GAME_STATE (CHMMR_BOMB_STATE) == 2) { GLOBAL (CurrentActivity) |= START_ENCOUNTER; VisitStarBase (); } else { GLOBAL (CurrentActivity) |= START_ENCOUNTER; RaceCommunication (); } if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD))) { GLOBAL (CurrentActivity) &= ~START_ENCOUNTER; if (LOBYTE (GLOBAL (CurrentActivity)) == IN_INTERPLANETARY) GLOBAL (CurrentActivity) |= START_INTERPLANETARY; } } else if (GLOBAL (CurrentActivity) & START_INTERPLANETARY) { GLOBAL (CurrentActivity) = MAKE_WORD (IN_INTERPLANETARY, 0); DrawAutoPilotMessage (TRUE); SetGameClockRate (INTERPLANETARY_CLOCK_RATE); ExploreSolarSys (); } else { // Entering HyperSpace or QuasiSpace. GLOBAL (CurrentActivity) = MAKE_WORD (IN_HYPERSPACE, 0); DrawAutoPilotMessage (TRUE); SetGameClockRate (HYPERSPACE_CLOCK_RATE); Battle (&on_battle_frame); } LockMutex (GraphicsLock); SetFlashRect (NULL); UnlockMutex (GraphicsLock); LastActivity = GLOBAL (CurrentActivity); if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)) && (LOBYTE (GLOBAL (CurrentActivity)) == WON_LAST_BATTLE || LOBYTE (GLOBAL (CurrentActivity)) == BLACK_ORB_CUTSCENE // JMS: End demo at cutscene upon finding black orb. || GLOBAL_SIS (CrewEnlisted) == (COUNT)~0)) // if died for some reason { if (GET_GAME_STATE (KOHR_AH_KILLED_ALL)) InitCommunication (BLACKURQ_CONVERSATION); // surrendered to Ur-Quan else if (GLOBAL (CurrentActivity) & CHECK_RESTART) GLOBAL (CurrentActivity) &= ~CHECK_RESTART; break; } } while (!(GLOBAL (CurrentActivity) & CHECK_ABORT)); StopSound (); UninitGameClock (); UninitGameStructures (); ClearPlayerInputAll (); } // CloseJournal (); UninitGameKernel (); FreeMasterShipList (); FreeKernel (); MainExited = TRUE; (void) threadArg; /* Satisfying compiler (unused parameter) */ return 0; }