SWF Editing Tutorial

12/23/2011 11:47 KalMoran#1
I welcome all who want to learn how to edit SWF files.

If anyone needs to know how to edit the swf just send me a private message or reply to this post.

I use the same program DarkCube does to edit SWF's. It is RABCDASM. This program disassembles the ActionScript from the SWF file to enable editing. The ActionScript contains all the juicy stuffy you want to edit, like costs and production times.

Here is a link to the RABCDASM download page : [Only registered and activated users can see links. Click Here To Register...]
There is a readme file in the directory called README.md which you can open in a text editor, such as Notepad++. It is very helpful. For my short tutorial here I am going through the commands shown in the README file.

Here is a quick tutorial for after you have downloaded and extracted RABCDASM.

1. Open up a Command Prompt window (CMD.exe)
2. navigate to the directory where you extracted RABCDASM.
3. Put the SWF you want to edit, in this case doggy.swf, in the RABCDASM directory

4. You must disassemble the ActionScript from the SWF. Do this with the following command in the Command Prompt (using your own swf in the place of doggy.swf):

abcexport doggy.swf

5. This creates the file named 'doggy-0.abc'
6. You then enter the following command into the Command Prompt to disassemble the abc file:

rabcdasm doggy-0.abc

7. This creates an export directory named 'doggy-0' which contains all of the files you will be editing and ultimately reassembling into the hacked swf file.
7.5 Go to the doggy-0 (or whatever the name of your swf is) directory and find the files you want to change. Edit them with a text editor or a program like Notepad++.
8. Once you have made the changes you like then you will use two files of interest, 'file-0.main.asasm' (the main program file) and `doggy-0.main.abc`
9. You now need to assemble the edited ActionScript classes back into a usable SWF file. To do this, enter the following commands into the Command Prompt:

rabcasm doggy-0/doggy-0.main.asasm
abcreplace doggy-0.swf 0 doggy-0/doggy-0.main.abc

This includes the spaces and zero between the two parts of the abcreplace command

Now you have a hacked SWF! It's name is the name of the original SWF file that you copied into the RABCDASM directory.

Good luck hacking! Ask questions if you have them.
12/23/2011 13:11 Jenice98#2
I got an error. It says ~Error while processing MM.swf : std.file.FileException@std\file.d<308>: MM.swf: The system canot find the file specified
-------------
43B3CC
43B243
402116
405498
4054D7
4050D3
45C411

any idea????
12/23/2011 13:16 Succubuzz#3
you DO realise you dont have to use cmd to use rabcdasm.
12/23/2011 13:19 Jenice98#4
what is that suppose to mean>???
12/23/2011 14:34 Dilicroix#5
i manage to extract it. but when i want to recompile it. i get an error like jenice
C:\RABCDAsm__v1.8>abcreplace game-0.swf 0 game-0\game-0.main abc
std.file.fileexception@std'file.d<308>: game-0.swf: The system cannot find the file specified
--------------
43564c
4354c3
102094
403573
40316f
162ce9

the swf im trying to recompile is Edgeworld

This was with a .BAT


This is without the .BAT , i use
rabcasm game-0/game-0.main.asasm
abcreplace game-0.swf 0 game-0/game-0.main.abc

and got this diff error

[Only registered and activated users can see links. Click Here To Register...]
12/23/2011 20:24 KalMoran#6
Quote:
Originally Posted by Jenice98 View Post
I got an error. It says ~Error while processing MM.swf : std.file.FileException@std\file.d<308>: MM.swf: The system canot find the file specified
-------------
43B3CC
43B243
402116
405498
4054D7
4050D3
45C411

any idea????
What you should do is decompile the game, then recompile it without any modifications just to test the recompilation process. If it works, then you should make a few edits at a time, recompiling every now and then to make sure the new edits worked.

Often times when I am editing it I change numbers but I forget to change their type. If you change something like "pushbyte 20" to "pushbyte 20000" then you have to change the byte in pushbyte to int since 20000 must be stored in an int. A byte is not big enough to handle this number. You would change the entry to "pushint 20000"

Hope that helps.



Quote:
Originally Posted by Succubuzz View Post
you DO realise you dont have to use cmd to use rabcdasm.
Of course I do. I just use cmd all the time. You can make batch files if you want. I like the command line. I might start using batch files if I think that is a faster way.
12/25/2011 19:56 menidi#7
I need to try it. thanks
12/26/2011 04:14 Jenice98#8
can i know how to decompile it????
12/26/2011 04:16 sapoha#9
gonna try.... tomorrow. ;D
12/26/2011 11:08 warcraft112#10
after extract what item will i edit? and what word will i type in
that file?
12/26/2011 17:51 kolokoy00#11
Quote:
Originally Posted by KalMoran View Post
I welcome all who want to learn how to edit SWF files.

If anyone needs to know how to edit the swf just send me a private message or reply to this post.

I use the same program DarkCube does to edit SWF's. It is RABCDASM. This program disassembles the ActionScript from the SWF file to enable editing. The ActionScript contains all the juicy stuffy you want to edit, like costs and production times.

Here is a link to the RABCDASM download page : [Only registered and activated users can see links. Click Here To Register...]
There is a readme file in the directory called README.md which you can open in a text editor, such as Notepad++. It is very helpful. For my short tutorial here I am going through the commands shown in the README file.

Here is a quick tutorial for after you have downloaded and extracted RABCDASM.

1. Open up a Command Prompt window (CMD.exe)
2. navigate to the directory where you extracted RABCDASM.
3. Put the SWF you want to edit, in this case doggy.swf, in the RABCDASM directory

4. You must disassemble the ActionScript from the SWF. Do this with the following command in the Command Prompt (using your own swf in the place of doggy.swf):

abcexport doggy.swf

5. This creates the file named 'doggy-0.abc'
6. You then enter the following command into the Command Prompt to disassemble the abc file:

rabcdasm doggy-0.abc

7. This creates an export directory named 'doggy-0' which contains all of the files you will be editing and ultimately reassembling into the hacked swf file.
7.5 Go to the doggy-0 (or whatever the name of your swf is) directory and find the files you want to change. Edit them with a text editor or a program like Notepad++.
8. Once you have made the changes you like then you will use two files of interest, 'file-0.main.asasm' (the main program file) and `doggy-0.main.abc`
9. You now need to assemble the edited ActionScript classes back into a usable SWF file. To do this, enter the following commands into the Command Prompt:

rabcasm doggy-0/doggy-0.main.asasm
abcreplace doggy-0.swf 0 doggy-0/doggy-0.main.abc

This includes the spaces and zero between the two parts of the abcreplace command

Now you have a hacked SWF! It's name is the name of the original SWF file that you copied into the RABCDASM directory.

Good luck hacking! Ask questions if you have them.
after i finish edit file how to save my edit in swf file....
12/26/2011 18:51 MmaBaki#12
@kolokoy00


save as.. compile.bat then all files.. and save..
12/26/2011 22:17 Succubuzz#13
Quote:
Originally Posted by KalMoran View Post
What you should do is decompile the game, then recompile it without any modifications just to test the recompilation process. If it works, then you should make a few edits at a time, recompiling every now and then to make sure the new edits worked.

Often times when I am editing it I change numbers but I forget to change their type. If you change something like "pushbyte 20" to "pushbyte 20000" then you have to change the byte in pushbyte to int since 20000 must be stored in an int. A byte is not big enough to handle this number. You would change the entry to "pushint 20000"

Hope that helps.





Of course I do. I just use cmd all the time. You can make batch files if you want. I like the command line. I might start using batch files if I think that is a faster way.
i dont use batch files. i simply drag and drop the SWF onto the export, and then drag and drop the file created onto rabcdasm file, which creates the folder with all the stuff in. its working fine for me tht way.
12/28/2011 03:34 warcraft112#14
when i compile i see the swf properties nothing changes in the file size when i extract them its back to original
12/28/2011 04:17 ichilouch#15
I'm very new to these and i dont understand anything here .