Page 1 of 1

Decompiling TOJ's Flash games

PostPosted: Mon Jul 18, 2011 6:49 am
by BlankedOutBox
Yes, ActionScript of most of the TOJ's Flash games (http://toj.mooo.com/toj_flash/) can be decompiled by using a tool named Flare (http://www.nowrap.de/flare.html).
The engine is named Garlic, which is the same engine as TOJ's client. (Try searching "GarlicImpl" in tetris.exe)

List of interesting things from Tetris Dash (dash_090707_toj_594px.swf):
  • O Tetromino doesn't rotate at all.
  • There is an unused class named "TetrisAI". Probably they wanted to put AI battle?
  • There are some partial implementations of Anti Miss Drop item.
  • There are some partial implementations of Replayer.
  • There is a protection that prevents the game from working on local drive. But the protection is simple. It just checks the existence of "http" in the URL.

Re: Decompiling TOJ's Flash games

PostPosted: Tue Jul 26, 2011 6:57 pm
by Wojtek
stardust tetris has bit better protection, it connects some url on tetrisonline.jp to get authorization to play, so you can't make it work without moddification. but because if is .NET application, you can decompile it easily with ILSPy or dotPeek.

GarlicClone v1.0 release

PostPosted: Tue Oct 11, 2011 12:41 pm
by BlankedOutBox
I created a Java port of (Flash games version of) Garlic engine, "GarlicClone".
It allows you to play simple Tetris game on near-perfectly cloned TOJ engine.
It also includes AI codes that can run TOJ's Lua scripts. (But you need JRE1.6+ and "kahlua2-v6.jar" from https://github.com/krka/kahlua2/downloads)
So you can create your own TOJ minigames now. Have fun!
You can change some of settings by editing "config/config.properties" file by any text editor. (Sorry, no key config yet)

Wojtek: Thanks for the tip! The code of Stardust is interesting too. Too bad they didn't port AI at all...

EDIT:v1.1 Released!
    T-Spin AI will now use instant lock. (It wasn't in original Flash codes)
    You can select the game mode in start-up screen. Push Left/Right keys to select.
    Anti-miss added. (kahlua2 and JRE1.6 required)

Download GarlicClone from below:

Re: Decompiling TOJ's Flash games

PostPosted: Wed Oct 12, 2011 1:59 am
by farter
so cool
but seems t-spin AI doesn't use hard drop when performing t-spin..?

Re: Decompiling TOJ's Flash games

PostPosted: Wed Oct 12, 2011 7:59 pm
by Wojtek
great to see this released!

Re: Decompiling TOJ's Flash games

PostPosted: Sat Oct 15, 2011 8:44 am
by BlankedOutBox
GarlicClone v1.1 is now available! See my above post to download.

@farter:
Yeah, the T-Spin AI didn't use hard drop for T-Spins because there were no codes for it.
It appears that who ported the AI codes didn't do the good job for T-Spin portions.

@Wojtek:
Thanks for the beta testing it :)

Re: Decompiling TOJ's Flash games

PostPosted: Sat Apr 14, 2012 1:05 am
by Wojtek
finally i found free AS3 decompiler: http://sites.google.com/site/as3extractor/

Re: Decompiling TOJ's Flash games

PostPosted: Sun Dec 01, 2013 1:27 pm
by morningpee
I've had the most success with Sothink SWF Decompiler, which costs $80 if you're an honest person, which I'm not.