Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
Small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
PopovEvgeniy committed Jul 22, 2019
1 parent a86162d commit 4649ae2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
20 changes: 17 additions & 3 deletions magicswf.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ char *get_short_name(const char *name);
char* get_name(const char *name,const char *ext);

unsigned long int copy_file(FILE *input,FILE *output);
void check_executable(FILE *input);
void check_signature(FILE *input);
void write_service_information(FILE *output,const unsigned long int length);
void compile_flash(const char *player,const char *flash,const char *result);
Expand All @@ -44,8 +45,8 @@ void show_intro()
{
putchar('\n');
puts("Magic swf");
puts("Version 1.1");
puts("Simple tool for converting Abobe flash movie to self-played movie");
puts("Version 1.2");
puts("Simple tool for converting Adobe flash movie to self-played movie");
puts("This sofware made by Popov Evgeniy Alekseyevich,2011-2019 years");
puts("This software distributed under GNU GENERAL PUBLIC LICENSE");
}
Expand Down Expand Up @@ -186,6 +187,18 @@ unsigned long int copy_file(FILE *input,FILE *output)
return length;
}

void check_executable(FILE *input)
{
char signature[2];
fread(signature,sizeof(char),2,input);
if (strncmp(signature,"MZ",2)!=0)
{
puts("Executable file of Flash Player Projector was corrupted");
exit(4);
}

}

void check_signature(FILE *input)
{
char signature[3];
Expand All @@ -195,7 +208,7 @@ void check_signature(FILE *input)
if (strncmp(signature,"CWS",3)!=0)
{
puts("Flash movie was corrupted");
exit(4);
exit(5);
}

}
Expand All @@ -216,6 +229,7 @@ void compile_flash(const char *player,const char *flash,const char *result)
FILE *input;
FILE *output;
input=open_input_file(player);
check_executable(input);
output=create_output_file(result);
copy_file(input,output);
fclose(input);
Expand Down
12 changes: 7 additions & 5 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Magic Swf

Simple tool for converting Abobe flash movie to self-played movie
Simple tool for converting Adobe flash movie to self-played movie
This software made by Popov Evgeniy Alekseyevich

Version 1.1.1
Version 1.2

System requirement

48 kilobytes free space on storage media.

Description and usage

This program let you convert an Abobe flash movie to stand-alone self-played movie.
This program let you convert an Adobe flash movie to stand-alone self-played movie.
Self-played movie is executable file: it combinate built-in player and the Flash movie in one file.
This program takes a file name of Flash Player Projector and Flash movie file name as command line arguments.

Expand All @@ -25,7 +25,8 @@ Exit codes
1 - Can't open input file.
2 - Can't create output file.
3 - Can't allocate memory.
4 - Flash movie was corrupted.
4 - Executable file of Flash Player Projector was corrupted.
5 - Flash movie was corrupted.

License

Expand All @@ -47,4 +48,5 @@ Version history
0.9.1 - 0.9.8 - Small changes.
0.9.9 - Small bug was fixed.
1.0 - 1.1 - Small changes.
1.1.1 - Source code was recompiled under Open Watcom.
1.1.1 - Source code was recompiled under Open Watcom.
1.2 - Small changes.

0 comments on commit 4649ae2

Please sign in to comment.