2 Scans a swf file for strings
\r
4 Part of the swftools package.
\r
6 Copyright (c) 2000,2001 Rainer Böhme <rfxswf@reflex-studio.de>
\r
8 This file is distributed under the GPL, see file COPYING for details */
\r
12 #include "../lib/rfxswf.h"
\r
13 #include "../lib/args.h"
\r
15 char * filename = 0;
\r
17 struct options_t options[] =
\r
24 int args_callback_option(char*name,char*val)
\r
26 if(!strcmp(name, "V")) {
\r
27 printf("swfstrings - part of %s %s\n", PACKAGE, VERSION);
\r
31 int args_callback_longoption(char*name,char*val)
\r
33 return args_long2shortoption(options, name, val);
\r
35 void args_callback_usage(char*name)
\r
37 printf("\nreflex SWF Text Scan Utility\n(w) 2000 by Rainer Boehme <rb@reflex-studio.de>\n\nUsage: %s filename.swf\n", name);
\r
40 int args_callback_command(char*name,char*val)
\r
43 fprintf(stderr, "Only one file allowed. You supplied at least two. (%s and %s)\n",
\r
52 void fontcallback(U16 id,U8 * name)
\r
56 FontExtract(&swf,id,&font);
\r
57 printf("#< %s %s %s>\n",name,FontIsBold(font)?"bold":"",FontIsItalic(font)?"italic":"");
\r
62 { TextPrintDefineText(t,font);
\r
69 int main (int argc,char ** argv)
\r
72 processargs(argc, argv);
\r
76 f = open(filename,O_RDONLY);
\r
78 { if FAILED(ReadSWF(f,&swf))
\r
79 { fprintf(stderr,"%s is not a valid SWF file or contains errors.\n",filename);
\r
84 FontEnumerate(&swf,&fontcallback);
\r
88 fprintf(stderr,"File not found: %s\n",argv[1]);
\r