Issue 75 in as3-commons: Error decompressing byte array via ByteCodeType.fromByteArray

165 views
Skip to first unread message

as3-c...@googlecode.com

unread,
Sep 3, 2011, 10:20:09 PM9/3/11
to as3-commons...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 75 by Orgi...@gmail.com: Error decompressing byte array via
ByteCodeType.fromByteArray
http://code.google.com/p/as3-commons/issues/detail?id=75

What steps will reproduce the problem?
1. Use ByteCodeType.fromByteArray(ba, ApplicationDomain.currentDomain);
where ba is the byte array for a swf ( as included in the
example :[Embed(source="someswf.swf", mimeType="application/octet-stream")]
private var swfInput:Class;
function parseSWF():void {
var ba:ByteArray = new swfInput() as ByteArray;
ByteCodeType.fromByteArray(ba, ApplicationDomain.currentDomain);
})

What is the expected output? What do you see instead?
I was expecting some sort of information, but instead I got this error:
Exception fault: Error: Error #2058: There was an error decompressing the
data.
at flash.utils::ByteArray/_uncompress()
at flash.utils::ByteArray/uncompress()
at
org.as3commons.bytecode.reflect::ReflectionDeserializer/read()[C:\projects\as3-commons\as3-commons-bytecode\src\main\actionscript\org\as3commons\bytecode\reflect\ReflectionDeserializer.as:83]
at
org.as3commons.bytecode.reflect::ByteCodeTypeProvider/fromByteArray()[C:\projects\as3-commons\as3-commons-bytecode\src\main\actionscript\org\as3commons\bytecode\reflect\ByteCodeTypeProvider.as:119]
at
org.as3commons.bytecode.reflect::ByteCodeType$/fromByteArray()[C:\projects\as3-commons\as3-commons-bytecode\src\main\actionscript\org\as3commons\bytecode\reflect\ByteCodeType.as:149]
at inspect::C()[/Users/george/Documents/fdt/PointTest/src/inspect/C.as:16]

What version of the product are you using? On what operating system?
as3commons-bytecode-1.0-RC5.swc
as3commons-lang-0.3.5-SNAPSHOT.swc
as3commons-logging-2.5.2.swc
as3commons-reflect-1.4.2.swc
Flash Player 11.0.0.60 (Incubator build) on osx 10.6.8

Please provide any additional information below.

This is the first time I use the library, so not sure what to expect in
this case.
I have however printed some ABC related data via:
var io:SWFFileIO = new SWFFileIO();
var swfFile:SWFFile = io.read(ba);
var abcTags:Array = swfFile.getTagsByType(DoABCTag);
for each(var tag:DoABCTag in abcTags) trace(tag.abcFile);

Any other options for reflection ?

Thank you for your time,
George

as3-c...@googlecode.com

unread,
Sep 4, 2011, 2:54:16 AM9/4/11
to as3-commons...@googlegroups.com

Comment #1 on issue 75 by roland.z...@gmail.com: Error decompressing byte

I see you're using flashplayer 11, did you compile this SWF with these new
compression settings perhaps?

as3-c...@googlecode.com

unread,
Sep 4, 2011, 10:02:56 AM9/4/11
to as3-commons...@googlegroups.com

Comment #2 on issue 75 by Orgi...@gmail.com: Error decompressing byte array
via ByteCodeType.fromByteArray
http://code.google.com/p/as3-commons/issues/detail?id=75

I've switched SDKs in test project and tried Flex 3.6 with Flash Player 10
and Flex 4.1 with Flash Player 10.1 (compiling both B.as and C.as) and got
the exact same error.
So far I've used FDT 4.5.3.1358 and there was a default option ticked on
project to use Apparat for optimizations. I've unticked the option,
thinking Apparat might compress data in way that isn't compatible with
as3-commons-bytecode, but had no luck.

Switched to Flash Builder 3 (Flex 3.2) and Flash Player 10 and still no
luck (got the same error).

Am I missing something ? Should I add some sort of compiler flag to avoid
compression ?

Thanks for the help,
George

as3-c...@googlecode.com

unread,
Sep 4, 2011, 10:30:17 AM9/4/11
to as3-commons...@googlegroups.com

Comment #3 on issue 75 by Orgi...@gmail.com: Error decompressing byte array
via ByteCodeType.fromByteArray
http://code.google.com/p/as3-commons/issues/detail?id=75

Still no joy with the fromByteArray method, but fromLoader work fine:

var ba:ByteArray = new swfInput() as ByteArray;

l = addChild(new Loader()) as Loader;
l.loadBytes(ba);
ByteCodeType.fromLoader(l.contentLoaderInfo);
l.contentLoaderInfo.addEventListener(Event.COMPLETE,lready);

A bit off topic: Is is possible to get the body of a method as a human
readable value ?

as3-c...@googlecode.com

unread,
Sep 11, 2011, 2:47:05 PM9/11/11
to as3-commons...@googlegroups.com

Comment #5 on issue 75 by roland.z...@gmail.com: Error decompressing byte

Hey there,

I guess the problem is with parsing an embedded SWF then. I'll try to look
into it.
As for your question 'Is is possible to get the body of a method as a human
readable value'. What I suspect is that you would like to convert the
opcodes back to actionscript source code.
This is technically possible, but it would mean writing a full-blown
actionscript based de-compiler, which is a task that I am not prepared to
undertake, I'm sorry :)

cheers,

Roland

as3-c...@googlecode.com

unread,
Sep 11, 2011, 5:58:36 PM9/11/11
to as3-commons...@googlegroups.com

Comment #6 on issue 75 by Orgi...@gmail.com: Error decompressing byte array
via ByteCodeType.fromByteArray
http://code.google.com/p/as3-commons/issues/detail?id=75

Hello,

Thank you for taking you time to look into this. It's good that I have the
other option so it's not an urgent matter.
Regarding actionscript code, I imagine it's not a simple task. I did manage
to get my head around the bytecode by reading the documentation
(http://learn.adobe.com/wiki/display/AVM2/5.+AVM2+instructions) ...so
yeah..sorry, just me being lazy (clear case of RTFM :) )

I imagine the ByteCodeType.fromByteArray will get attention at some point,
so thank you in advance.

All the best,
George

as3-c...@googlecode.com

unread,
Jun 12, 2012, 8:10:56 AM6/12/12
to as3-commons...@googlegroups.com

Comment #8 on issue 75 by ndalp...@gmail.com: Error decompressing byte
array via ByteCodeType.fromByteArray
http://code.google.com/p/as3-commons/issues/detail?id=75

Still not working

as3-c...@googlecode.com

unread,
Mar 8, 2013, 6:34:38 AM3/8/13
to as3-commons...@googlegroups.com

Comment #9 on issue 75 by nick.wig...@gmail.com: Error decompressing byte
array via ByteCodeType.fromByteArray
http://code.google.com/p/as3-commons/issues/detail?id=75

Still not working.

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

as3-c...@googlecode.com

unread,
Mar 11, 2013, 6:13:53 AM3/11/13
to as3-commons...@googlegroups.com

Comment #10 on issue 75 by ihatelivelyids: Error decompressing byte array
via ByteCodeType.fromByteArray
http://code.google.com/p/as3-commons/issues/detail?id=75

Hi there,

currently I don't have any time to work on as3-bytecode, I am simply too
busy with my dayjob and other things.
Any effort on your part to help fix this will be greatly appreciated. I'm
afraid just dumping a 'Still not working' comment is not a great motivator
for me...
Reply all
Reply to author
Forward
0 new messages