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() );
    	}
        }
    }
    




RSS Feed
About Me
Home

Posts:
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
KeyPad Bruteforcer
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
findDll
Java Hacking
Windows 8
Win7 x64
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
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


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: 58 + 56 = ? followed by the letter: N