ActionScript Tips


Author: David Zimmer
Date: 06.18.11 - 7:00am



I have never really had to code in ActionScript before but its obviously has quite a developed API.

This entry will house various code tidbits and resources as I stumbled across them.
  • Misc ActionScript Helper Class Features:
    • Text Logging - (trace window for any player w/scroll support)
    • Save ByteArray to File
    • Load ByteArray from File
    • Hexdump ByteArray
    • Msgbox Shellcode
    • HeapSpray
    • CreateButton w/text label
    • Download File

  • ActionScript Hexdump function
  • Shellcode2Exe now supports writeInt,writeUnsignedInt, and endian ActionScript commands

  • FlashDevelop
    • is a nice UI for ActionScript code development.
    • You can use it with the free flex sdk so you dont need Flash.
    • To use classes like the FileSystem stuff, you can use an AIR project.
    • fl.* and mx.* classes (such as UIScrollBar) are not included in the free flex sdk, however you can use them if you make your own swc file and include it in your project using a trial version of flash. (drag and drop the classes you want to the library window from the components window and click generate swc in the publish options)
    • Sample using helper.as and a swc library in FlashDevelop


  • Working with hex numbers:
    var n:Number;
    trace(parseInt("7FFFFFFF", 16));
    n = 2147483647;
    trace(n.toString(16));
    
  • To dump a byte array to disk: (must call from a user event for browser)
    import flash.net.*;
    import flash.system.*;
    import flash.utils.*;
    var code:ByteArray = new ByteArray();
    code.endian = Endian.BIG_ENDIAN;
    code.writeUnsignedInt(1094795585);
    ...
    var fR:FileReference=new FileReference();
    fR.save(code,"xxx.bin");
    
  • To log text to the main display at runtime: (no debug player needed, see helper class for scrolling support)
    package  {
    
        import flash.display.*;
        import flash.system.*;
        import flash.text.*;
    
        public class Main extends MovieClip {
    		
    	private var myTextBox:TextField = new TextField(); 
    		
    	function xx(x){
    		myTextBox.text += x + "\n";
    	}
    		
    	public function Main() {
    		myTextBox.autoSize = TextFieldAutoSize.LEFT;
                    var format:TextFormat = new TextFormat();
                    format.font = "Verdana";
                    format.size = 15;
                    myTextBox.defaultTextFormat = format;
    		addChild(myTextBox); 
    		xx("Starting flash version: " + Capabilities.version.toLowerCase() );
    	}
        }
    }
    





Comments: (3)

On 06.18.11 - 6:51pm Dave wrote:
this looks interesting too..flash remote debugging protocol info

On 06.20.11 - 7:47am Dave wrote:
I have to say, the amount of code it requires to create a simple button with text, or to create a textbox that scrolls is pretty nutty. Having to scatter your logic across async event handlers is a bit infuriating too.

On 06.29.11 - 1:38pm Dave wrote:
couple interesting links

 
Leave Comment:
Name:
Email: (not shown)
Message: (Required)
Math Question: 67 + 25 = ? followed by the letter: R 



About Me
More Blogs
Main Site
Posts: (All)
2024 ( 1 )
2023 ( 4 )
2022 ( 5 )
2021 ( 2 )
2020 ( 5 )
2019 ( 6 )
2017 ( 5 )
2016 ( 4 )
2015 ( 5 )
2014 ( 5 )
2013 ( 9 )
2012 ( 13 )
2011 (19)
     Graphing ideas
     .Net Hacking
     Old iDefense Releases
     BootLoaders
     hll shellcode
     ActionScript Tips
     -patch fu
     scdbg ordinal lookup
     scdbg -api mode
     Peb Module Lists
     scdbg vrs Process Injection
     GetProcAddress Scanner
     scdbg fopen mode
     scdbg findsc mode
     scdbg MemMonitor
     demo shellcodes
     scdbg download
     api hashs redux
     Api hash gen
2010 ( 11 )
2009 ( 1 )