Junk Byte Code for Kicks

21Mar/150

Flash-Console repo migrated to GitHub

The new report is @ https://github.com/junkbyte/flash-console

Wiki page formatting still needs work.

Filed under: Console, Console, Flash No Comments
28Feb/125

Faster Console graphing

New graphing panel seems to run 30 graph lines at 60fps (at least on my machine).
Try it here:
http://console.junkbyte.com/graphtest/
(The actual graph does not mean much to the sound)

Filed under: Console 5 Comments
25Feb/120

ASDOC inside SWC

Just learned how to include asdoc inside swc so that it shows up in IDE
(tested with FlashBuilder).

Thanks to http://forums.adobe.com/thread/444791

Added a new console download: Console2.6+asdoc.swc

http://code.google.com/p/flash-console/downloads/list

22Feb/120

Console command prompt addon demo

Finally got time to do a simple demo of "CommandPrompt" addon.

I used this addon for a utility AIR app at my work.
The app is a simple command line where you choose what you want to do and it does stuff according to your choices.

Here is a simple greetings demo:
(your selections do not get recorded :)
http://console.junkbyte.com/addons/commandprompt/

Filed under: Console Continue reading
19Feb/129

Flash String weirdness

A long time ago...

I had this bug report in Console that FPS and memory graph is leaking memory.
Issue: http://code.google.com/p/flash-console/issues/detail?id=89
I was not able to find the exact cause of this other than the fact that if I don't update texts in graph, it doesn't show any memory problems.
I suspected back then that Strings were strange but was not able to pin point what's strange about it.

Fast forward to today

I recently learned that flash keeps 'master string' of strings when they get passed around.
See http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/sampler/package.html#getMasterString()
Quote:

For example, if you call String.substr(), the returned string will often actually be implemented as just a pointer into the original string, for the sake of efficiency. In normal usage, this is an implementation detail which is not visible to the user; however, it can be confusing when using a profiler to analyze your program's memory consumption, because the string may be shown as taking less memory than would be needed for the string's value. In addition, a string might be retained in memory solely because it is the master for other strings. getMasterString() allows profilers to show the user an accurate graph of string dependencies.

It sounds good, it is obviously saving memory by not copying the strings and reusing via referencing to original string where possible.
But...

  • What if you only need to keep a tiny part of the string (say downloaded from an external file), will it know to discard the big string?
  • What if you chain a lot of strings together, will it keep references to all its parts?
  • Could it cause memory leaks?
15Feb/120

Console 3.0 vs 2.x

This is weird. Still a lot of work left for Console 3.0 and a lot of feature ideas keeps popping up.

Wait till 3.0 or add additional 2.x versions, or addons...

I may go with add-ons for now.

Filed under: Console, Flash No Comments
3Feb/126

flash.sampler.*

Finding quite interesting stuff from flash.sampler.

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/sampler/package-detail.html

 

May be adding some cool console addons which use those API.
I do not plan to compete with Flash Builder's profiler nor other profilers.
It will probably just add a few extra niche features others do not support.

Strange thing I find:

If a method has try catch statement, it generates 'NewObjectSample' with "[activation-object]" tag in the stack.
This is also why when using Flash Builder's profiler running an app with Flash Console, it traces many cumulative instances of 'Remoting' and 'Graphing'. Annoying.

Filed under: Console, Flash 6 Comments
15Nov/112

How to piggyback Console into flash content on the web

What does it mean?

Add console into flash content that's on the web, letting you use console features as if it was your own.
Ofcourse you may not see logs unless it is hooked up, but you can still do other things such as Display roller, CommandLine, FPS / memory monitor. This is 'not a hack' but a trick, probably a security concern for a lot of the case...
Considering you can do this a lot easier with javascripts AND the fact that you can de-compile swf files, this particular method is not a massive security concern.

What can you do with it?

Mainly just out of curiosity.
Maybe you just want to know how things are structured, how good is the FPS , etc...

You can start the display roller 'RL' and see how the display list is constructed.
Capture the display list and start introspecting the properties and methods of classes.

If you know some of the code base (decompile the game?), you probably also know what classes there are, so you can access them live via console - and even modify values.

If your victim flash content have bad security checks on server end, you can probably hack it out to give your self many points / credit, etc. - or at least on that one session.

13Nov/111

Console 3.0 is coming

Just thought I'll post an update about Console.

3.0 is coming with main focus on modularity.
It will make features to be more easily modified or added on top of base console.
No new out-of-the-box functionality will be added.

Replaceable base modules: (replaceable by sub-classing and registering to console)

  • ConsoleLogger - Handles formatting the logs,  add log processors to add custom log output formats
    • IConsoleLogProcessor - adds custom log entry formatting, example, if you want to underline effect on numbers when logging, you can create ConsoleNumberProcessor, which adds <u></u> around number types.
  • ConsoleLogs - Handles keeping logs history and channels
  • MainPanelModule - There will be sub modules under this to handle Menu, Logs and Commandline
  • ChannelsPanelModule
  • TooltipsModule

Modules that can be added:

  • Referencing - handles mapping references to objects via id, for use by other modules
  • CommandLine -  implement ICommandLine to replace behavior
  • Remoting  - implement IRemoting to replace behavior
  • KeyStates - can store the state of key presses, for use by other modules
  • KeyBinder - handles binding keys to function callbacks
  • DisplayRoller
  • RulerModule
  • TraceModule - call trace() on all logs
  • UncaughtErrorsListenerModule - logs when there are uncaught errors
  • UserDataModule - allows other modules to store user data (SharedObject)
  • StayOnTopModule - Keeps console on top
  • GarbageCollectModule - calls System.gc()
  • GarbageCollectionMonitor
  • InspectorModule - allows you to introspect in UI

Not everything is there yet and its very much under construction... The general picture is coming together.

See 'spirit' svn branch for code progress. https://flash-console.googlecode.com/svn/branches/spirit

Filed under: Console, Flash 1 Comment
12Jul/110

Console logs to HTML export addon

Problem: You want to save your logs from console. Sv menu button does the job, but it is in plain text - very hard to filter through channels and priorities...

Solution: ConsoleHtmlExport addon.
It exports to HTML file like: http://console.junkbyte.com/addons/htmlexport/export.html

Filed under: Console Continue reading