c - Problem with converting compressed swf with cws2fws -


I am trying to convert encoded swf files to uncompressed swf files using the cws2fws utility written by Alex Berregazzy I am using a FFMPEG set of conversion routine which is part of it and I am using compressed files that are valid files because they can be opened and played by Firefox and other programs, but when I send them through cws2fws If I run the error in the program (-5) shows that the file is corrupted I have downloaded the source for the program and compiled it using Visual Studio when I run my file through the new compiled program, The program downloaded from has the same results. While debugging the program, I noticed that two of the four bytes used to determine the uncompressed file size of SVF are negative (see line 64 below).

  00056 if (buf_in [0]! = 'C' || bug_in [1]! = 'W' || buff_in [2]! = 'S') 00057 {00058 printf ( "Not a compressed flash file \ n"); 00059 exit (1); 00060} 00061 00062 fstat (fd_in, and statbuf); 00063 comp_len = statbuf.st_size; 00064 uncomp_len = buf_in [4] | (Buf_in [5] < 

1) I am feeling a bit dense, so someone can understand the reasoning of determining the file size from 4 bytes, as shown in line 64. I think the size is probably in addition to a series of 2 to 2 ^ 32's powers, but how are bits operators working on bytes to get the right numbers?

2) Both buf_in [5] and buf_in [6] are negative which can be a problem in the OS because I'm on a Windows machine and this code was apparently developed on a * nick machine Was there. For me it indicates a bug in the program that has to do with the signed and unsigned integer. Am I right and how can I move forward?

3) Is it possible that this code can not handle the new SWF files?

4) Has anyone recently used this program with success?

Thanks in advance for you.

buf_in ? If it is four * , then switch it to unsigned char * : The signature of char is according to the platform and compiler and option, and the obvious The unsigned arithmetic of its form here is here, it is taking 4 byte in offset 3 in buf_in and reading them up to little-end as 32-bit integer.

As it is said, I write a dumb little SWF decompresser.

  #! Use / usr / bin / perl compressed :: Zlib; Undef $ / / binmode (argv); While (<($ a, $ b, $ c) = unpack 'a3a5a *' = & gt; $ _; If ($ a eq 'CWS') {FH, '& gt; Raw ',' $ {ARGV}. Syswrite FH, "FWS $ B"; Syswrite FH, uncompressed ($ c); }}  

Should work on any appropriate Pearl installation.


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

kernel - How to create a "Block device" in Windows -