ByteArray.readUTFBytes()

var m:ByteArray = new ByteArray();
var bytes:Array = [0x41, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x20, 
				   0x53, 0x6E, 0x69, 0x70, 0x70, 0x65, 0x74]
for (var i:int = 0; i < bytes.length; i++){
	m.writeByte(bytes[i]);
}

m.position = 0;
 
trace(m.readUTFBytes(bytes.length));

I was messing around with a hex editor today and decided to start playing with ByteArray for the first time in awhile. Just wrote this as a little warm up… Try running it to see what it traces out…

2 comments

  1. Kind of sounds like “try typing rm -fr /”, but I trust Flash not to do anything too bad to me (maybe I shouldn’t given your Project Time-bomb). Anyhow, I get “Action Snippet”. Pretty cool.

  2. yeah you could potentially do some funny stuff with this in conjunction with fileReference… like write a .app or .exe file and give it a name that will make the user curious enough to open it… heh…. but yeah, this just traces out Action Snippet…

Leave a Reply

Your email address will not be published. Required fields are marked *