Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef _TESTAPP_CPP
- #define _TESTAPP_CPP
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- #define _CRT_SECURE_NO_WARNINGS //Disables strcpy() security warning on Microsoft compilers.
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- #include <Windows.H>
- #include <StdIO.H>
- #include <StdLib.H>
- #include <iostream>
- #include <fstream>
- #include <string>
- using namespace std;
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- #include "../CCRC32.H"
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- int main(int iArg, char *sArg[])
- {
- char sSourceFile[MAX_PATH];
- memset(sSourceFile, 0, sizeof(sSourceFile));
- CCRC32 crc32;
- crc32.Initialize(); //Only have to do this once.
- unsigned int iCRC = 0;
- strcpy(sSourceFile, "map.spak");
- int compare = 399857339;
- ifstream checkfile(sSourceFile);
- if (checkfile){
- cout << "Checking file " << sSourceFile << "..." << endl;
- crc32.FileCRC(sSourceFile, &iCRC);
- if(iCRC == compare){
- cout << "File " << sSourceFile << " complete!\nCRC Result: " << iCRC << endl;
- }else{
- cout << "File " << sSourceFile << " incomplete!\nCRC Result: " << iCRC << endl;
- }
- }else{
- cout << "File tidak ditemukan!" << endl;
- }
- system("pause");
- return 0;
- }
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement