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 Aug 11, 2022
1 parent ff89cb6 commit 3463a84
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 30 deletions.
35 changes: 9 additions & 26 deletions magicswf.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,16 @@
#include <string.h>

void show_intro();
void show_help();
void show_start_message();
void show_end_message();

void show_message(const char *message);
FILE *open_input_file(const char *name);
FILE *create_output_file(const char *name);
void fast_data_dump(FILE *input,FILE *output,const size_t length);
void data_dump(FILE *input,FILE *output,const size_t length);
unsigned long int get_file_size(FILE *file);

char *get_string_memory(const size_t length);
size_t get_extension_position(const char *source);
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);
Expand All @@ -31,42 +26,30 @@ int main(int argc, char *argv[])
show_intro();
if(argc==3)
{
show_start_message();
show_message("Working... Please wait");
work(argv[1],argv[2]);
show_end_message();
show_message("Work finish");
}
else
{
show_help();
show_message("You must give file name of Flash Player Projector and Flash movie file name as command line argument!");
}
return 0;
}

void show_intro()
{
putchar('\n');
puts("Magic swf. Version 1.4.3");
puts("Magic swf. Version 1.4.4");
puts("Simple tool for converting Adobe flash movie to self-played movie");
puts("This sofware made by Popov Evgeniy Alekseyevich,2011-2022 years");
puts("This software distributed under GNU GENERAL PUBLIC LICENSE");
}

void show_help()
{
putchar('\n');
puts("You must give file name of Flash Player Projector and Flash movie file name as command line argument!");
}

void show_start_message()
{
putchar('\n');
puts("Working... Please wait");
}

void show_end_message()
void show_message(const char *message)
{
putchar('\n');
puts("Work finish");
puts(message);
}

FILE *open_input_file(const char *name)
Expand Down Expand Up @@ -199,7 +182,7 @@ void check_executable(FILE *input)
fread(signature,sizeof(char),2,input);
if (strncmp(signature,"MZ",2)!=0)
{
puts("Executable file of Flash Player Projector was corrupted");
puts("Executable file of Flash Player Projector corrupted");
exit(4);
}

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

Expand Down
9 changes: 5 additions & 4 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Simple tool for converting Adobe flash movie to self-played movie
This software made by Popov Evgeniy Alekseyevich

Version 1.4.3.4
Version 1.4.4

System requirement

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

License

Expand All @@ -52,4 +52,5 @@ Version history
1.2 - 1.4.1 - Small changes.
1.4.2 - Small bug fixed.
1.4.3 - Small changes.
1.4.3.1 - 1.4.3.4 - Documentation updated.
1.4.3.1 - 1.4.3.4 - Documentation updated.
1.4.4 - Small changes.

0 comments on commit 3463a84

Please sign in to comment.