Subversion Repositories spk

Rev

Rev 323 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 323 Rev 341
Line 4... Line 4...
4
void PrintError ( int err )
4
void PrintError ( int err )
5
{
5
{
6
	switch ( err )
6
	switch ( err )
7
	{
7
	{
8
		case CATERR_NODATFILE:
8
		case CATERR_NODATFILE:
9
			printf ( "No dat file found\n" );
9
			wprintf(L"No dat file found\n" );
10
			break;
10
			break;
11
		case CATERR_NOCATFILE:
11
		case CATERR_NOCATFILE:
12
			printf ( "Unable to open cat file\n" );
12
			wprintf(L"Unable to open cat file\n" );
13
			break;
13
			break;
14
		case CATERR_FILEEMPTY:
14
		case CATERR_FILEEMPTY:
15
			printf ( "Cat file is empty\n" );
15
			wprintf(L"Cat file is empty\n" );
16
			break;
16
			break;
17
		case CATERR_READCAT:
17
		case CATERR_READCAT:
18
			printf ( "Unable to read cat file\n" );
18
			wprintf(L"Unable to read cat file\n" );
19
			break;
19
			break;
20
		case CATERR_DECRYPT:
20
		case CATERR_DECRYPT:
21
			printf ( "Unable to decrypt cat file\n" );
21
			wprintf(L"Unable to decrypt cat file\n" );
22
			break;
22
			break;
23
		case CATERR_MISMATCH:
23
		case CATERR_MISMATCH:
24
			printf("Dat file size mismatch\n");
24
			wprintf(L"Dat file size mismatch\n");
25
			break;
25
			break;
26
		case CATERR_CREATED:
26
		case CATERR_CREATED:
27
			printf("Cat file does not exist\n");
27
			wprintf(L"Cat file does not exist\n");
28
			break;
28
			break;
29
		default:
29
		default:
30
			printf("Unknown error code: %d\n", err);
30
			wprintf(L"Unknown error code: %d\n", err);
31
			break;
31
			break;
32
	}
32
	}
33
}
33
}
34
 
34
 
35
void ListFiles(const Utils::CommandLine &cmd)
35
void ListFiles(const Utils::CommandLine &cmd)
Line 47... Line 47...
47
	}
47
	}
48
	
48
	
49
	wprintf(L"Listing files in %s...", filename.c_str());
49
	wprintf(L"Listing files in %s...", filename.c_str());
50
	if (!searchmask.empty())
50
	if (!searchmask.empty())
51
		wprintf(L"(%s)", searchmask.c_str() );
51
		wprintf(L"(%s)", searchmask.c_str() );
52
	printf("\n");
52
	wprintf(L"\n");
53
 
53
 
54
	CCatFile catfile;
54
	CCatFile catfile;
55
	int err = catfile.open(File.fullFilename(), L"", CATREAD_CATDECRYPT);
55
	int err = catfile.open(File.fullFilename(), L"", CATREAD_CATDECRYPT);
56
 
56
 
57
	int listed = 0;
57
	int listed = 0;
Line 441... Line 441...
441
	wprintf(L"\t\tConverts between BOB and BOD files\n");
441
	wprintf(L"\t\tConverts between BOB and BOD files\n");
442
}
442
}
443
 
443
 
444
int main ( int argc, char **argv )
444
int main ( int argc, char **argv )
445
{
445
{
446
	printf ( "\nCATPCK Tool V1.22 17/05/2025 (SPK: %.2f) Created by Cycrow\n\n", GetLibraryVersion() );
446
	wprintf(L"\nCATPCK Tool V1.22 17/05/2025 (SPK: %.2f) Created by Cycrow\n\n", GetLibraryVersion() );
447
 
447
 
448
	// parse the cmd name
448
	// parse the cmd name
449
	Utils::CommandLine cmd(argc, argv);
449
	Utils::CommandLine cmd(argc, argv);
450
 
450
 
451
	if ( argc < 2 )
451
	if ( argc < 2 )
Line 519... Line 519...
519
		}
519
		}
520
	}
520
	}
521
 
521
 
522
#ifdef _DEBUG
522
#ifdef _DEBUG
523
	char pause;
523
	char pause;
524
	printf ( "\n\nPress a key to end\n" );
524
	wprintf(L"\n\nPress a key to end\n");
525
	scanf ( "%c", &pause );
525
	scanf ( "%c", &pause );
526
#endif
526
#endif
527
 
527
 
528
	return 0;
528
	return 0;
529
}
529
}