?? swftagdumper.java
字號(hào):
return acts;
}
/**
* SWFTagTypes interface
*/
public void tagExport( String[] names, int[] ids ) throws IOException
{
println( "export" );
for( int i = 0; i < names.length && i < ids.length; i++ )
{
println( " id=" + ids[i] + " name=" + names[i] );
}
}
/**
* SWFTagTypes interface
*/
public void tagImport( String movieName, String[] names, int[] ids )
throws IOException
{
println( "import library-movie=" + movieName );
for( int i = 0; i < names.length && i < ids.length; i++ )
{
println( " id=" + ids[i] + " name=" + names[i] );
}
}
/**
* SWFTagTypes interface
*/
public void tagDefineQuickTimeMovie( int id, String filename ) throws IOException
{
println( "quicktime-movie id=" + id + " name=" + filename );
}
/**
* SWFTagTypes interface
*/
public void tagDefineBitsJPEG2( int id, byte[] data ) throws IOException
{
println( "jpeg2 id=" + id );
if( dumpHex )
{
Hex.dump( writer, data, 0L, indent + " ", false );
println( dashes );
}
}
/**
* SWFTagTypes interface
*/
public void tagDefineBitsJPEG2( int id, InputStream jpegImage ) throws IOException
{
println( "jpeg2 id=" + id + " (from input stream)" );
}
/**
* SWFTagTypes interface
*/
public SWFShape tagDefineMorphShape( int id, Rect startBounds, Rect endBounds )
throws IOException
{
println( "morph-shape id=" + id + " start: " +
startBounds + " end: " + endBounds );
return this;
}
/**
* SWFTagTypes interface
*/
public void tagDefineBitsLossless( int id, int format, int width, int height,
Color[] colors, byte[] imageData )
throws IOException
{
dumpBitsLossless( "bits-lossless", id, format, width, height, colors, imageData );
}
/**
* SWFTagTypes interface
*/
public void tagDefineBitsLossless2( int id, int format, int width, int height,
Color[] colors, byte[] imageData )
throws IOException
{
dumpBitsLossless( "bits-lossless2", id, format, width, height, colors, imageData );
}
public void dumpBitsLossless( String name, int id, int format,
int width, int height,
Color[] colors, byte[] imageData )
throws IOException
{
int size = 0;
if ( format == SWFConstants.BITMAP_FORMAT_8_BIT ) size = 8;
else if( format == SWFConstants.BITMAP_FORMAT_16_BIT ) size = 16;
else if( format == SWFConstants.BITMAP_FORMAT_32_BIT ) size = 32;
println( name + " id=" + id + " bits=" + size +
" width=" + width + " height=" + height );
if( dumpHex )
{
for( int i = 0; i < colors.length; i++ )
{
println( " " + i + ": " + colors[i] );
}
Hex.dump( writer, imageData, 0L, indent + " ", false );
println( dashes );
}
}
/**
* SWFVectors interface
* SWFText interface
*/
public void done() throws IOException
{
println( " " + dashes );
}
/**
* SWFVectors interface
*/
public void line( int dx, int dy ) throws IOException
{
println( " line " + dx + "," + dy );
}
/**
* SWFVectors interface
*/
public void curve( int cx, int cy, int dx, int dy ) throws IOException
{
println( " curve " + cx + "," + cy + " - " + dx + "," + dy );
}
/**
* SWFVectors interface
*/
public void move( int x, int y ) throws IOException
{
println( " move " + x + "," + y );
}
/**
* SWFShape interface
*/
public void setFillStyle0( int styleIndex ) throws IOException
{
println( " fill0 = " + styleIndex );
}
/**
* SWFShape interface
*/
public void setFillStyle1( int styleIndex ) throws IOException
{
println( " fill1 = " + styleIndex );
}
/**
* SWFShape interface
*/
public void setLineStyle( int styleIndex ) throws IOException
{
println( " line = " + styleIndex );
}
/**
* SWFShape interface
*/
public void defineFillStyle( Color color ) throws IOException
{
println( " fill " + color );
}
/**
* SWFShape interface
*/
public void defineFillStyle( Matrix matrix, int[] ratios,
Color[] colors, boolean radial )
throws IOException
{
println( " fill radial=" + radial + " " + matrix );
for( int i = 0; i < ratios.length && i < colors.length; i++ )
{
if( colors[i] == null ) continue;
println( " ratio=" + ratios[i] + " " + colors[i] );
}
}
/**
* SWFShape interface
*/
public void defineFillStyle( int bitmapId, Matrix matrix, boolean clipped )
throws IOException
{
println( " fill clipped=" + clipped + " image=" + bitmapId + " " + matrix );
}
/**
* SWFShape interface
*/
public void defineLineStyle( int width, Color color ) throws IOException
{
println( " line-style width=" + width + " " + color );
}
/**
* SWFText interface
*/
public void font( int fontId, int textHeight ) throws IOException
{
println( " font id=" + fontId + " size=" + textHeight );
}
/**
* SWFText interface
*/
public void color( Color color ) throws IOException
{
println( " color " + color );
}
/**
* SWFText interface
*/
public void setX( int x ) throws IOException
{
println( " x = " + x );
}
/**
* SWFText interface
*/
public void setY( int y ) throws IOException
{
println( " y = " + y );
}
/**
* SWFText interface
*/
public void text( int[] glyphIndices, int[] glyphAdvances ) throws IOException
{
StringBuffer buff1 = new StringBuffer();
StringBuffer buff2 = new StringBuffer();
buff1.append( "(" );
buff2.append( "(" );
for( int i = 0; i < glyphIndices.length && i < glyphAdvances.length; i++ )
{
buff1.append( " " );
buff2.append( " " );
buff1.append( glyphIndices[i] );
buff2.append( glyphAdvances[i] );
}
buff1.append( " )" );
buff2.append( " )" );
println( " text" );
println( " glyph indices = " + buff1 );
println( " advances = " + buff2 );
}
public void flush() throws IOException
{
writer.flush();
}
/**
* args[0] = name of SWF file to dump to System.out
* args[1] = if exists then dump-hex is true (dumps binary as hex - otherwise skips)
* args[2] = if exists then decompiles action codes
*/
public static void main( String[] args ) throws IOException
{
SWFTagDumper dumper = new SWFTagDumper( args.length > 1, args.length > 2 );
FileInputStream in = new FileInputStream( args[0] );
SWFTags tagparser = new TagParser( dumper );
SWFReader reader = new SWFReader( tagparser, in );
try
{
reader.readFile();
}
finally
{
dumper.flush();
in.close();
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -