Sunday, September 26, 2010

Bengine Race – the first game powered by Bengine released!





Objective: Drive to the destination as quickly as possible, be careful of holes on the ground and avoid crashes into the walls and road-blocks.
----------
Tips: You can use three skills when needed.

Max speed (key Z) can save your time by increasing your speed.

Max armor (key X) will let you destroy walls and create a short cut to the destination.

Max power (key C) can enable you to fly over blocks and holes.

Always remember to switch between these skills and you will find the game easier and more interesting.

And when the skills are used up, you can

move back to recharge speed,

hit the walls to exchange life for power,

and fly to gain armor.

----------

==========

Controls:

==========

W/up: move forward

S/down: move back/recharge speed

A/left: turn left

D/right: turn right

Q: look down

E: look up

----------

Z: max speed(speed*2)

X: max armor(to destroy walls)

C: max power(to fly)

----------

Space: fly

Enter: pause game

----------
Video: http://www.youtube.com/watch?v=moAD_s8FlRo


It is an experimental game. A simple “proof of concept” demo. There are many bugs.
I didn’t spend much time on the game design because my time went to the engine.
I think the interesting part is to freely explore the voxel world. Yes, just forget the time meter and the objectives! Try to go to a higher place with the flying skill, or do some destructions using the max armor skill.

Well, I think I should thank Ken Silverman for his handy tools slab6 and poly2vox.
These tools are useful when I was editing my voxel game map.
And Ken’s voxlap engine is the inspiration and motivation for me to create Bengine.
Also, thanks to Bit101, you may realized, the game UI is created by his minimalcomps library.
Finally, flashkit and sfxr for the sound effect and many other free online resources/codes I used for the game!
Next time I will give you more details on the engine and plans for the next game power by Bengine v0.2 – Blaze.

Monday, August 23, 2010

Free SWF Decompilers!

Note: Since SWF file is an open specification format, the word "editor" or "viewer" here is more suitable (literally legitimate) than the word "decompiler".

ActionScript Decompiler

UPDATE 2014_3_04
JPEXS Free Flash Decompiler (FFDec) is 2.0.0! 
(The great, open source, not just an alternative to, but even more powerful than, most commercial decompilers.)


Key Features:
SWF to FLA conversion
Direct editing ActionScript source (AS1/2) and editing via assembler source (AS1/2 and AS3) (This is the unique feature that most GUI flash decompilers don't have)
Replacing images, editing texts and fonts
Automatic deobfuscation
Multiple platforms support: Windows, Linux, Mac OS
...
Full features list: http://www.free-decompiler.com/flash/features.html

UPDATE 2011_8_16
ActionScript Extractor
http://sites.google.com/site/as3extractor/home
A free actionscript3 decompiler.

================================================

UPDATE 2011_6_19

http://www.swfwire.com/(Highly Recommended!)
https://github.com/magicalhobo/SWFWire

SWFWire Decompiler
An open source library written in ActionScript 3 for reading and writing swfs.


SWFWire Inspector
"Easily view the contents of SWF files with this open source AIR app. You can view images, shapes, and even syntax-highlighted ActionScript 3.
See what parts of your code are taking up the most space. Make sure sensitive data isn't being exposed. Gain a deeper understanding of the file format. You might even be impressed at how efficient Flash is."

================================================

UPDATE 2013_2_19
ASDEC is now JPEXS Free Flash Decompiler!
http://www.free-decompiler.com/flash(Highly Recommended!)

UPDATE 2010_2_09
asdec: Open Source ActionScript decompiler written in Java.
http://code.google.com/p/asdec/(Highly Recommended!)
"JP ActionScript decompiler (ASDec) is program for decompiling ActionScript parts from flash SWF files. Program has also basic ability to edit (assemble) ActionScript."


Features: See the update.

Opening SWF files version 10 or older
Showing source code of ActionScript1/2 and ActionScript3. (See source limitations)
Exporting sources to file (at the moment only AS3)
Editing source code via modifying assembler source (See editing limitations)
Saving modified actionscript back to the file
Built-in proxy server for editing SWF files which come through it
================================================

http://www.showmycode.com/
"Decompile flash ActionScript from the swf flash file. Use this online flash swf decompiler to get the source code of the swf file."



HP SWFScan
www.hp.com/go/swfscan
http://h30499.www3.hp.com/t5/Following-the-White-Rabbit-A/SWFScan-FREE-Flash-decompiler/ba-p/5440167
"Decompiles applications built on the Adobe Flash platform to extract the ActionScript code and statically analyzes it to identify security issues such as information disclosure."


Resource Extractor/Modifier

http://www.decompileflash.com/
(http://www.swfdecompiler.net)
"Decompile Flash Free Version is an outstanding SWF decompiling tool which allows you to convert flash between SWF and FLA format. Decompile Flash offers the powerful function of editing dynamic texts of flash movie and replacing images as your own easily and watch the edited result immediately. The easy-to-use interface helps you catch on to the system quickly."



http://www.swfdecompiler.net/free_swf_decompiler/index.html
"SWF Decompiler Premium Free Version is a 100% freeware. It allows you to convert between swf and exe format, besides, the powerful function supports edit the dynamic texts and replace images. The player window is innovatively separated from the main panel, which enables users to drag and drop the window wherever they want it to be."


http://www.swftools.org/
SWFDump "Prints out various informations about SWFs, like contained images/fonts/sounds, disassembly of contained code as well as cross-reference and bounding box data."

SWFExtract "Allows to extract Movieclips, Sounds, Images etc. from SWF files."

swfdump
The official tool by Adobe, included in the Flex SDK, to disassemble a SWF.
http://blogs.adobe.com/gosmith/2008/02/disassembling_a_swf_with_swfdu_1.html

http://www.swfmodify.com/
"swfModify software is useful tool for edit , rebuild flash file, and it's free. It’s different from other edit tools. You need no experience of flash design, all you should do is click mouse button. You can replace virtual item in .swf file, and save as another flash file. In the future, we hope every user can upload your flash resources for the others."


http://www.flashprobe.com/
"Flash Probe is a free online tool that can parse flash files and display text and images found within. The tool will create HTML versions of your flash websites. Some use it to see what part of their flash website will get indexed by search engines."


http://www.swixkit.com/
"Easy to use XML-based editor for SWF debugging and updating; Decompiling of SWF into SWiX-format XML; Reassembly of SWiX-format XML into an SWF."


SWF To Image GUI
http://bytescout.com/products/developer/swftoimagesdk/swftoimagegui.html
"SWF To Image GUI is a freeware utility to convert flash movies (SWF) into JPEG, GIF, PNG, BMP images"


Bytecode Disassembler

UPDATE 2012_3_06
Adobe SWF Investigator
The official AIR based, open source, SWF analyzer/disassembler/editor by Adobe Labs.
http://labs.adobe.com/technologies/swfinvestigator/

================================================

As3Eval
http://eval.hurlant.com/
"As3Eval is a library that packages the Tamarin ESC compiler to work within a run-of-the-mill flash player. You can also paste the output of hexdump -C on a swf to disassemble it within the UI."


Nemo 440
www.docsultant.com/nemo440/
Advanced ActionScript 3/ABC2/Flex 2/Flex 3/Flex 4/AIR disassembler.


http://segfaultlabs.com/swfutils
http://segfaultlabs.com/swf/abcflex/index.html


Apparat

http://code.google.com/p/apparat/
A framework to optmize ABC, SWC and SWF files.

Yogda
http://www.yogda.com/
http://yogda.2ka.org

AVM2 Bytecode Assembler, Disassembler, also has the functions of editing(adding/removing) swf tags.


Unprotectors

UPDATE 2012_7_20
SWF iD
"freeware tool that every flash reverser (especially beginner one) should have"

http://swfid.je1.ru/
http://blog.codestage.ru/2013/07/06/swf-id/


SWF Decrypt
http://www.swfdecrypt.com/

"SWF Decrypt will reverse and remove the few junk code these types of software add to your SWF file and charge you money for. The purpose of this software is to help you assess the protection solution that you have chosen. I hope it will also encourage the authors of SWF Encrypt and SWF Protector to either implement actual code obfuscation methods or discontinue their products and stop charging for junk."

SWF Reader
http://www.swf-reader.com

"SWF Reader Professional is first program to unprotect encrypted swf files.

Main features:
Remove/add tags.
Manipulate doABC structure (AS3).
Full unprotect AS2 files which are encrypted by SWF Encrypt 5 (http://www.amayeta.com/).
Unprotect AS3 files which are encrypted by SWF Encrypt 5 (http://www.amayeta.com/). There is not possible to recover names (class, vars, functions) because encrypter remove original names irretrievably."

This one also has a nice memory dump tool/SWF vampire(File->;Load from memory) for unpacking.

SWF-Reader Open Source Lib:
http://sourceforge.net/p/swf-reader/

Manatee SWF Decrypter V3  
http://bmanatee.blogspot.com/2013/04/manatee-swf-decrypter-v3.html

Sitelocked SWF Loader
http://bmanatee.blogspot.com/2012/05/sitelocked-swf-loader.html

UPDATE: 2012_8_18
SWF Vampire
(Tools that can scan the RAM and extract (packed) SWF files from system's running processes.)

Flash Dump: Open source tool in Python.
http://sa3.org/file/python/swfdump.py
http://sa3.org/program/flash-dump/


SWF Thief: Open source tool in C#.
http://code.google.com/p/swf-thief/


Miscellaneous Links:

Packed SWF. How to unpack?
http://blog.codestage.ru/2012/03/07/packed/
How to decrypting the doswf encryption:
http://blog.codestage.ru/2013/05/06/decrypting-doswf/

Способы ?защиты? flash-приложений
(Ways to ?protect? flash-applications, in Russian.
Try Google Translate!)
http://habrahabr.ru/blogs/Flash_Platform/110686/

Basic SWF Bytecode modification (AVM2/AS3) tutorial:
http://bmanatee.blogspot.com/2013/08/basic-swf-bytecode-modification-avm2as3.html

http://www.nowrap.de/flasm.html
http://www.nowrap.de/flare.html

Dump Flash Decompiler
http://www.dcomsoft.com/download/dfdinstall.exe

Swf Picture Extractor
http://www.dcomsoft.com/download/swf_picture_extractor.exe

http://code.google.com/p/flash-decompiler/

http://www.deitte.com/archives/2008/03/randomcompiler.htm

http://blogs.adobe.com/gosmith/2008/02/disassembling_a_swf_with_swfdu_1.html

http://dougmccune.com/flex/FOTB_Decompiling_Doug_McCune.pdf

http://dougmccune.com/blog/2008/09/21/i-just-decompiled-a-decompiler-so-i-could-use-it-to-decompile-itself/

http://shigeru-nakagaki.com/index.cfm/2008/3/18/20080318-LibraryManager-Beta-is-released

http://flashpanoramas.com/blog/2007/07/02/swf-parser-air-application/

http://www.5etdemi.com/blog/archives/2007/01/as3-decompiler/

https://www.flashsec.org/wiki/Simple_AS3_Decompiler_Using_Tamarin

http://blog.reversing.com.ar/2010/02/debugging-actionscript-jited-code/

SWF Encrypt (Flash 'obfuscator') hacking
http://www.woodmann.com/forum/showthread.php?10300-SWF-Encrypt-%28Flash-obfuscator-%29-hacking

Extract SWF files from Flash Executables(EXE):
http://www.northcode.com/blog.php/2007/08/02/Extract-SWF-files-from-Flash-Executables

Libraries for reading/writing SWF and modifying ActionScript Bytecode:
http://www.flagstonesoftware.com/transform/ (Java)
https://github.com/CyberShadow/RABCDAsm (D)
http://www.libspark.org/wiki/yossy/swfassist (AS3)
http://segfaultlabs.com/swfdb (AS3)
https://github.com/magicalhobo/SWFWire (AS3)
https://github.com/laomoi/swfdiy (AS3)
http://sourceforge.net/projects/swfdotnet/ (C# .Net or VB.Net)
http://www.codeproject.com/KB/graphics/swfdotnet-decompiler.aspx
https://github.com/RintarouTW/SWFVisualizer(AS3)
https://github.com/RintarouTW/swfparser(C++)
https://github.com/junfenggeng/libswf/(C)

UPDATE 2012_9_09 SWFRETools(SWF reverse engineering tools collection):
http://www.the-interweb.com/serendipity/
https://github.com/sporst/SWFREtools(JAVA)

Pixel Bender .pbj files Decompiler:
http://www.kaourantin.net/2008/09/pixel-bender-pbj-files.html

AGAL ByteCode Decompiler:
DEMO: http://boycy.webs.com/Disassembler.swf
Source Code: http://boycy.webs.com/Disassembler.rar

Tuesday, August 3, 2010

SWF Cry v0.02 released, protect your swf for free!

Update: August, 8, 2011
A minor version(v0.02fixed) maintenance update for SWF-Cry released!
Fixed several bugs.
Warning: this version maybe more buggy than the previous version(v0.02).
For backup purpose, you can find all old releases here:
https://flaswf.googlecode.com/svn/trunk/Swfcry/builds
A major version(v0.03) update, which has fewer bugs, more functions and better UI, will be available in the future.
==========



TUTORIAL - How to use it:

First of all, click to expand the "Advanced Configuration" window .

1. Choose your main swf to be encrypted

Press “Browse _SWF button to upload your swf.

2. Choose your water mark swf

Press “Browse _WaterMark button to upload your water mark.

If you don't need a water mark, uncheck “Use _WaterMark.

You can set the water mark swf's x, y, scaleX, scaleY and alpha properties.

Change the “LinkTo url to your sites and the final output swf will have a water mark navigates to your sites when you click it.

3. Obfuscate

Edit the names list there; add names that you wish to be changed to random strings.

Use comma (",") to separate names.

If you don't want to obfuscate, uncheck "Obfuscate".

4. Pack

Edit the name (default uploadedswfname_CryOut.swf) after “OutPut_SWF_Name. That's the encrypted swfs name. You can also change it after the encrypted swf is created.

If you don't want to pack your swf, uncheck “Pack.

Notes: if you uncheck “Pack” and “Obfuscate both, SWF Cry will do nothing. Make sure at least one is checked.

5. Save the encrypted swf

Press “Cry_and_Save button to begin the encryption process, please wait a while till it's done and then you can save the encrypted swf.

6. Save your config

Press “Save_Config button to save your current config, you can load your config by “Load_Config. The saved config is an xml file, you can edit it manually.

7. Test your output swf, if you only see a blank swf, try unchecking Pack.
If the player throw errors such as “can't find definition... check the obfuscate names list, make sure no as3 key words there!

KOWN ISSUES:

1. Only as3, AVM1 swfs (as2,as1) are not supported currently and won't be supported in the future.
2. Sometimes swfs access net files won't run on a local computer after Pack.
3. If your swf accesses stage, add code below in your main class's constructor function:

if(stage==null)
{this.addEventListener(Event.ADDED_TO_STAGE,onAdded);}
else {init();}
function onAdded(event:Event){init();}
function init(){}

Otherwise, the packed swf will throw errors. Go here (http://www.flashandmath.com/intermediate/swfload/docclass.html) for details.
4. Many other bugs...

Bugs, ideas, requirements, just drop a comment!

Links:

Wednesday, July 28, 2010

AS3 Eval Draw - Eval the AS3 drawing API!


Inspired by Ken Silverman's EVALDRAW(http://www.advsys.net/ken/evaltut/evaldraw_tut.htm),
I made this little project, AS3 Eval Draw, used to quickly test the AS3 drawing API on the fly without compiling the AS3 code. Thanks to BISE Scripting Engine, an easy to learn and use but powerful scripting engine, making everything simple. The grammar of BISE Scripting Engine is similar to AS3 and makes it easy to export the eval scripts to AS3.
I use BIT-101’s MinimalComps for the UI and Atlas's syntax highlighter to highlight the code.

AS3 Eval Draw now supports very simple AS3 drawing API, mostly 2D graphics & Bitmapdata manipulation. I also implemented other basic functions, such as load/save code, screen print and export AS3.
It is not hard to make it support text displaying and the new AS3 3D drawing, sounds generation API. Another useful thing is loading function so we can play with picture assets and use them as textures. Supporting more AS3 events (like keyboard & mouse events) will be helpful too. We can then make some little games at run-time!
Now I just like it simple as this.
One limitation is speed. Luckily the Eval Draw script can easily be ported to AS3 (thanks to BISE Scripting Engine again!).

Full source code of the project:
http://flaswf.googlecode.com/svn/trunk/AS3_Evaldraw_En/
Feel free to use it and fork it!
Play it now:
Click "Eval" to run the example code, click "Canvas" to see the result in action.
More examples:
(thanks to Zevan Rosser - http://actionsnippet.com/)
http://flaswf.googlecode.com/svn/trunk/AS3_Evaldraw_En/Evaldraw_examples/

Links:
1. Ken Silverman's EVALDRAW
http://www.advsys.net/ken/evaltut/evaldraw_tut.htm
2. BISE Scripting Engine (AS3) by Yoshihiro Shindo and Sean Givan
http://kinsmangames.wordpress.com/bise-scripting-engine/
3. MinimalComps by Keith Peters (BIT-101)
http://www.minimalcomps.com/
4. Atlas's Syntax Highlighter
http://www.atlascs.co.uk/blog/2007/02/09/as3-syntax-highlighting-in-as3
5. http://actionsnippet.com/
6. A similar project using D.eval()
http://insideria.com/2008/03/try-out-the-drawing-api-withou.html

Saturday, May 15, 2010

SWF Cry - A Free online swf Encryption/Obfuscation tool!

================================================
UPDATE 2010_8_03
SWF Cry v0.02 released:
http://bruce-lab.blogspot.com/2010/08/swf-cry-v002-released-protect-your-swf.html
================================================



I wrote this simple swf Encryption/Obfuscation tool - SWF Cry, in about two weeks' spare time.
The UI is powered by minimalcomps (http://www.minimalcomps.com/).
It can obfuscate names of packages, classes, functions and variables (Thanks to makc3d!).
It can also pack your swf into a packer/shell to prevent your swf being decompiled directly.
The (un)encryption scripts are written in C via adobe alchemy so it's very hard to unpack it simply by decompile the packer.
SWF Cry is in a very primary status now (v0.01); this is only an unstable prerelease version. It has many bugs and other serious problems. It may do damage to your swf and even crash the browser or the flash player. Please backup your files before testing it. TRY IT AT YOUR OWN RISK!
(Possible) Features of the next release (v0.1):
1. Fewer bugs
2. Better UI
3. Better execution efficiency and lower memory usage
4. Domain lock
5. Junk code injection
6. Prevent swf being extracted from RAM

TUTORIAL - How to use it:
1. Choose your main swf to be encrypted
Press “Browse _SWF” button to upload your swf.
2. Choose your water mark swf
Press “Browse _WaterMark” button to upload your water mark.
If you don't need a water mark, uncheck “Use _WaterMark”.
You can set the water mark swf's x, y, scaleX, scaleY and alpha properties.
Change the “LinkTo” url to your sites and the final output swf will have a water mark navigates to your sites when you click it.
3. Obfuscate
Edit the names list there; add names that you wish to be changed to random strings.
Use comma (",") to separate names.
If you don't want to obfuscate, uncheck "Obfuscate".
4. Pack
Edit the name (default CryOut.swf) after “OutPut_SWF_Name”. That's the encrypted swfs name. You can't change it after the encrypted swf is created.
If you don't want to pack your swf, uncheck “Pack”.
Notes: if you uncheck “Pack” and “Obfuscate both, SWF Cry will do nothing. Make sure at least one is checked.
5. Save the encrypted swf
Press “Cry_and_Save” button to begin the encryption process, please wait a while till it's done and then you can save the encrypted swf.
6. Save your config
Press “Save_Config” button to save your current config, you can load your config by “Load_Config”. The saved config is an xml file, you can edit it manually.
7. Test your output swf, if you only see a blank swf, try unchecking Pack.
If the player throw errors such as “can't find definition... check the obfuscate names list, make sure no as3 key words there!
8. Add a preloader for the encrypted swf (To-Do)

KOWN ISSUES:
1. Only as3, AVM1 swfs (as2,as1) are not fully supported currently. (But you can try your luck!)
2. Sometimes swfs access net files won't run on a local computer after Pack.
3. If your swf accesses stage, add code below in your main class's constructor function:

if(stage==null){this.addEventListener(Event.ADDED_TO_STAGE,onAdded);} else {init();}
function onAdded(event:Event){init();}function init(){}

Otherwise, the packed swf will throw errors.
Go here (http://www.flashandmath.com/intermediate/swfload/docclass.html) for details.
4. You can't rename the packed output swf anymore (the file name is protected)
5. Many other small bugs...
Bugs, ideas, requirements, just drop a comment!

Links:
1. Flash Protection Gold
Version 1.42 (Free / Full features) Now!
http://www.avimpeg.net/flash_protection.htm
2. http://makc3d.wordpress.com/2010/02/09/open-source-swf-obfuscator/
6. http://www.swfdecrypt.com/ Unprotect SWF Files
7. some SWF encryptors are worthless
8. http://flashfreeprotection.blogspot.com/ (A tool that protect your flash files from most of the decompilers, for free!)

Monday, April 5, 2010

Alchemy Ray Casting Engine source code released

This is my first project using alchemy, porting a simple ray casting engine from this tutorial (http://www.student.kuleuven.be/~m0216922/CG/raycasting.html) to flash, and finished about half a year ago. Source code is just released because Im too lazy to clean up the dirty code behind the first demo.
This engine is better than may other flash based ray caster because it can render ceil/floor and sprites. Its not hard to make a Wolfenstein-like game using this engine but Im not motivated to do that now.
We already have more powerful alchemy doom and alchemy quake engine now. There are many good game editors for these two engines; we can create a quake-like FPS even without programming now. But its strange that I havent seen any new game made.
(If you want to do this, here are tutorials:
One reason is no LAN game play, hope someone can solve this problem. I think another reason is those engines are too complicated to deal with. This little engine is much simpler and can be used personally, hope you will like it.
I wont develop it further because recently Im focus on a totally new ray casting engine BENGINE (http://flaswf.googlecode.com/files/Bengine_v01.swf ), a voxel based 2.5D/3D ray casting engine.
As to the source code of this alchemy ray caster, special thanks to Lode, the original author of the C++ code, and Ralph Hauwert (unitzeroone.com), I learned how to use alchemy from his source.
It is not well written, and maybe you wont like my way of writing C code, I dont use .h file, I prefer C to C++ (so the original C++ source is C now) and like to use include a lot.
Besides, there may be lots of bugs and many things can be optimized.
If you want to make it better, some ToDos (for you):
1.      Use 1D screen buffer ([]) instead of 2D screen buffer ([][]) to speed up rendering.
2.      Improve the sprite sorting function.
3.      Use a lookup table to calculate rays instead of vectors (#1).
4.      More controls: Strafe left/right, jump/crouch, run, look up/down (#1).
5.      Some lighting effect (#1).
6.      A better way to handle textures/sprites, doom wad like data/resources.
7.      A better way to define a map, a map editor, import Wolfenstein map format.
8.      Animated sprites.
9.      Write a simple game.

#1 Another nice ray casting tutorial you may need:

Monday, February 22, 2010

Games That Had Been Flashed - flash ports of well-known games

1.Castlevania
2.Doom
Doom*3 game-Doom Triple Pack (Doom, Heretic, and Hexen):
height=
height=
3. EA 2D’s Dragon Age Journeys
height=
height=
4. Half-Life
height=
height=
5. Infamous
height=
height=
6. James Bond: Quantum of Solace
9. Mirror’s edge
height=
height=
10. Portal
height=
height=
11. Price of Persia
15.Street Fighter 2
16. Super Mario
17. Unreal Flash
18. Witcher Versus
height= height=
==========update 2010, August, 20==========
Prince of Persia: The Forgotten Sands
http://prince-of-persia.us.ubi.com/games/game-01.php

Sponsors