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 and a swc library in FlashDevelop

  • Working with hex numbers:
    var n:Number;
    trace(parseInt("7FFFFFFF", 16));
    n = 2147483647;
  • To dump a byte array to disk: (must call from a user event for browser)
    import flash.system.*;
    import flash.utils.*;
    var code:ByteArray = new ByteArray();
    code.endian = Endian.BIG_ENDIAN;
    var fR:FileReference=new FileReference();,"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;
    		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:
Email: (not shown)
Message: (Required)
Math Question: 1 + 69 = ? followed by the letter: U 

About Me
More Blogs
Main Site
Yara WorkBench
vbdec dbg updates
vb6 PCode NOP
vb6 API and call backs
how pcode works Pt1
Reversing PCode Args
VB6 PCode Disassembly
VB6 PCode Debugger
UConnect Disable Cell Modem
IDA python over IPC
dns wildcard blocking
64bit IDA Plugins
anterior lines
misc news/updates
Decoders again
CDO.Message Breakpoints
SysAnalyzer Updates
SysAnalyzer and Site Updates
crazy decoder
ida js w/dbg
flash patching #2
JS Graphing
packet reassembly
Delphi IDA Plugin
scdbg IDA integration
API Hash Database
Winmerge plugin
IDACompare Updates
Guest Post @ hexblog
TCP Stream Reassembly
SysAnalyzer Updates
Apilogger Video
Shellcode2Exe trainer
scdbg updates
IDA Javascript w/IDE
Rop Analysis II
scdbg vrs ROP
flash patching
x64 Hooks
micro hook
jmp api+5 *2
SysAnalyzer Updates
InjDll runtime config
C# Asm/Dsm Library
Shellcode Hook Detection
Updates II
Java Hacking
Windows 8
Win7 x64
Graphing ideas
.Net Hacking
Old iDefense Releases
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
Retro XSS Chat Codes
Exe as DLL
Olly Plugins
Debugging Explorer
Attach to hidden process
JS Refactoring
Asm and Shellcode in CSharp
Fancy Return Address
PDF Stream Dumper
Malcode Call API by Hash
WinDbg Cheat Sheet
GPG Automation