Junk Byte Code for Kicks


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

Heroes VI clone units bug / cheat

Heroes 6, great game.
Was hooked in this game till I found this bug.

It is on "resurrect units" town UI.

Basically, if you don't have a hero garrisoned to the town, hero unit slots are normally invisible on other tabs.
But they have forgotten to hide it for resurrection panel.


  • You need to have some units to clone in town without hero garrisoned.
  • Town must have unit resurrection building  ("Altar of Eternal Servitude" on Undead side)
  • There must be at least 2 free unit slots left in town.


  • Go to resurrection panel of town UI.
  • Drag unit to one of hero units' slot.
  • Click on the unit portrait, randomly you'll notice it spawned a cloned unit stack.
  • Can't remember the exact sequence here, I need to play the game again :)
    But in short you can clone unit stacks this way.
  • Make sure there is only 5 units stacks at any times (don't go over or it will crash)
This have spoiled the game for me.
Because I can make tons of units so easily and enemies get crushed like bugs.
I may have spoiled my own enjoyment here.

This was possible on Heroes VI bought on Steam. Last update, end of Dec 2011.
Not tested on multiplayer matches. I HOPE it doesn't work!

Tagged as: , , No Comments

Terraria item clone cheat

I am sure there is already a full info about this cheat,  but I'd like to write from my exploration point of view anyway.

Quite like the game. I was hooked in the game the whole weekend.

I was first curious how big the world save files are so I found the files here:

(Win 7)

C:\Users\<user>\Documents\My Games\Terraria\Worlds

Then I realised, its just named world1.wld.
So I thought ok, what if I copy the world, will I be able to clone it in game?

The answer is yes.

So here is how to clone items.

  • Put stuff in a chest (or tons of chests in my case) in single player world.
  • Save and Exit world (don't need to exit game)
  • Clone the world file by copying and renaming to world2.wld, world3.wld, world4, world5.
  • Go into 2, 3, 4, 5 worlds and collect the items in chest.
  • Go back to world 1 and deposit the items in chest.
  • If you want to clone even more, repeat from step 2.

I usually keep the original world (world1) as deposit only world now.

And pick up items/gear from its clones only, this way my stock won't run dry.

Cloned stuff can be carried to multiplayer server too.

It was a pain to copy and rename world files. so I made a bat file and place it in the same folder as world files.


COPY world1.wld world2.wld
COPY world1.wld world3.wld
COPY world1.wld world4.wld
COPY world1.wld world5.wld

This assumes you only have 1 world file and it will overwrite worlds 2/3/4/5.
Don't come blame me if you lost your files!

Perhaps, I feel comfortable cheating because I discovered it my self and I felt deserved to use it.
Then again, its not like I am playing PVP and taking advantage over other players. Now that would be unfair.

Cheater out.

Tagged as: , No Comments


Finding quite interesting stuff from flash.sampler.



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

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.


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

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

Console – next steps

Console is an amazing tool. It does loads of things and it does it well.

Under the hood tho, code is not pretty, extendable, nor friendly.
I normally don't code like this outside the project.

Particularly, I feel extend-ability is lacking a lot behind.

There are a few reasons behind this.

Filed under: Console Continue reading

Just…one…more…feature! (2.51beta4)

I am having problems stopping my self from adding more features.

2.51 was supposed to be a minor release but I was adding small features directly to trunk which in turn forced me to keep them when more bugs are found and fixed for original 2.51 features.

Now... There is 2.52 branch so I shall work safely on new features while 2.51 stays behind on trunk to fix bugs only.
2.51 already grew out of original scope, so... more change logs were added since first beta.

2.51 beta4

  • Major changes
    • HTML formatted logging support. see Cc.addHTML, Cc.addHTMLch
    • Socket remoting support
    • Extensive changes were made on remoting. Older remotes will not work with this version
    • Improved commandLine autocomplete / hinting
      • CommandLine autocomplete is now stepped so that it will stop completion at multiple matches
      • TAB key to accept autocomplete suggestion in CL (in REPLACEMENT of previous SPACE key)
    • Cc.config.rememberFilterSettings to remember channel and priority level settings as SharedObject
    • Minor changes
      • Cc button on top menu changed to Sv with additional controls:
        • Normal click copies all text with channel names to clipboard
        • Shift click copies text without channel names
        • Ctrl click copies using current filtering (channels, priority level)
        • Alt click prompts a save dialog on flash player 10 or above
        • Keys can be combiled. Example:
          • Ctrl+alt+shift click will open a dialog to save logs without channel names using current filters
      • Cc.setIgnoredChannels() to set ignored channels
      • Ctrl click on channel name now use setIgnoredChannels which function slightly differently than it used to
      • SHIFT+scroll wheel to make log text bigger / smaller
      • Reintroduced Cc.minimumPriority
      • TAB key focuses to command line if visible (in addition to previous ENTER key)
      • SWC now include argument names. However it will no longer support importing in CS3 as a component
    • Bug fixes
      • Fixed not sending very long lines to remote
      • ByteArray.toString() no longer brake console prints
      • Fixed issue where single Number/int logs to Cc.add, Cc.stack,Cc.stackch, Cc.ch doesn't work

    Preview: http://console.junkbyte.com/2.51/

    Filed under: Console, Flash No Comments

    Releasing 2.51BETA

    Here are the changes.

    ===2.51 beta ===

    • HTML formatted logging support. see Cc.addHTML, Cc.addHTMLch
    • Socket remoting support
    • Reintroduced Cc.minimumPriority
    • Fixed not sending very long lines to remote
    • ByteArray.toString() no longer brake console prints
    • SHIFT+scroll wheel to make log text bigger / smaller
    • TAB key focuses to command line if visible (in addition to previous ENTER key)
    • TAB key to accept autocomplete suggestion in CL (in addition to previous SPACE key)
    • SWC now include argument names. However it will no longer support importing in CS3 as a component

    I am quite excited about HTML formatting feature. need to write more documentation to allow using console's build in CSS formatting and how to declare your own, etc.

    Before final version, I need to do some memory profiling to reduce the hilly memory usage when remoting is connected. First thoughts, it is because I am creating new instances (ByteArray) to send buffer every frame.

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

    Filed under: Console, Flash 2 Comments