Browse code

bb11452 - endianess correction for swf files on sparc - patch supplied by Jim Morris.

Steven Morgan authored on 2015/12/12 07:41:38
Showing 1 changed files
... ...
@@ -458,6 +458,14 @@ int cli_scanswf(cli_ctx *ctx)
458 458
         return CL_CLEAN;
459 459
     }
460 460
     offset += sizeof(file_hdr);
461
+    /*
462
+    **  SWF stores the integer bytes with the least significate byte first
463
+    */
464
+    
465
+    file_hdr.filesize = le32_to_host (file_hdr.filesize); 
466
+
467
+    cli_dbgmsg("SWF: Version: %u\n", file_hdr.version);
468
+    cli_dbgmsg("SWF: File size: %u\n", file_hdr.filesize);
461 469
 
462 470
     if(!strncmp(file_hdr.signature, "CWS", 3)) {
463 471
         cli_dbgmsg("SWF: zlib compressed file\n");
... ...
@@ -472,9 +480,6 @@ int cli_scanswf(cli_ctx *ctx)
472 472
         return CL_CLEAN;
473 473
     }
474 474
 
475
-    cli_dbgmsg("SWF: Version: %u\n", file_hdr.version);
476
-    cli_dbgmsg("SWF: File size: %u\n", EC32(file_hdr.filesize));
477
-
478 475
     INITBITS;
479 476
 
480 477
     GETBITS(nbits, 5);