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