123sherif1 (05-04-2014),dangergun (07-19-2017),droppy (03-23-2014),kensington (05-04-2013),lanzador (01-13-2015),liquidgalaxy (05-01-2013),maat7043 (04-29-2013),Suki91 (01-16-2018),tooopher (05-01-2013)
Thought these might be useful to another Mac user
Zipped 'rabcasm' folder with included Shell Scripts for the following:
ABC_Decom.sh is for Decompiling your .swf files - renames file to 'client.swf'
ABC_Comp.sh is for Compiling your .swf file back into a (hopefully) working .swf - renames file to 'New.swf'
ABC_Hexer.sh is for Hexing your .swf files from one version to another - please keep reading to learn more about the Hexing script. - renames file to 'Hexed.swf'
Don't worry about the names having ABC in them, I did that so the files sit at the top of the folder and not mixed between the rabcasm parts.
Please unzip and place the 'rabcasm' folder onto your Desktop. Why? .. The Scripts were designed to search for the rabcasm folder on your Desktop.
HOW TO USE:
Always keep these in the rabcasm folder(which should be on your Desktop), and place any .swf file that you wish to decompile/compile/hex inside the rabcasm folder also.
Double click on the scripts to run them ... thats it.
Be aware that a Terminal window will open temporarily and close again, this is normal.
Hexer:
OK, with the Hexer, it has been designed for an compiled .swf, but will still hex an already uncompiled file. The reason I mention this is so you don't think you have to use the other Scripts to Decompile, Hex, and Compile the files back again, the Hexer does it all for you.
When the game 'Versions' change, and are updated, you will need to change the version numbers in the Hexer.sh file:
Right click on Hexer.sh and select 'Open With' and select 'TextEdit.app"
Find the line below and simply change the numbers accordingly: First number is the Modded Client Version and the second number is the Current Game Build Version.
The line below changes version 13 to 13.1
Code:vi '+%s/\"13\"/\"13.1\"/g' '+wq' Parameters.class.asasm
For more on using RABCDasm for Mac manually.
[[HERE]]
[[Virustotal Scan]]
[[Jotti Scan]]
Last edited by Cyeclops; 04-29-2013 at 06:25 AM.
123sherif1 (05-04-2014),dangergun (07-19-2017),droppy (03-23-2014),kensington (05-04-2013),lanzador (01-13-2015),liquidgalaxy (05-01-2013),maat7043 (04-29-2013),Suki91 (01-16-2018),tooopher (05-01-2013)
Good Job! I glad you figured this out so mac users have to help
contribute.
Thats also a cool script for the 13 to 13.1. Im not familiar with macs but seeing that its done in one line
makes it impressive

49
Thanks @maat7043
I do hope it gives incentive to contribute, or at least to show others if they look at these scripts that they can do it too, and get away from this crappy "Im on a Mac I can't do it, please help me waaaahh!"
I've actually been sitting on these for quite a while now. I got the idea from JustAnoobROTMG after mentioning he had made batch files to do his Decompile and one for Compile.
Also the script is larger than 1 line, that line is where the numbers need changed.
Code:#!/bin/bash cd *//rabcasm mv *.swf client.swf ./swfdecompress client.swf ./abcexport client.swf ./rabcdasm client-1.abc cd ~/Desktop/rabcasm/client-1/com/company/assembleegameclient/parameters vi '+%s/\"13\"/\"13.1\"/g' '+wq' Parameters.class.asasm cd ~/Desktop/rabcasm ./rabcasm client-1/client-1.main.asasm ./abcreplace client.swf 1 client-1/client-1.main.abc mv *.swf Hexed.swf exit 0
---------- Post added at 09:30 PM ---------- Previous post was at 08:58 PM ----------
Quick Hex
If the decompile and compile is removed from the Hexer script, this thing finds and replaces in a blink, its really very quick. But the swf would need to be uncompiled firstly to access the client-1 folder.
But in case someone is reading and would rather just the hexing script for an uncompiled swf. use this:
You dont even really need the line: mv *.swf Hexed.swf :all this is doing is renaming your file from whatever.swf to Hexed.swf. so your script will be only 3 - 4 lines lolCode:#!/bin/bash cd ~/Desktop/rabcasm/client-1/com/company/assembleegameclient/parameters vi '+%s/\"13\"/\"13.1\"/g' '+wq' Parameters.class.asasm mv *.swf Hexed.swf exit 0
Creating your first Hex script
To create a shell script, open a new empty file in your editor. Any text editor will do.
Place the above code into your text file.
Save - name it any name, and remember where you are saving it to. e.g. Hexer2 and maybe place on your Desktop.
Go to your file and replace the .txt or .rtf to .sh ... e.g. Hexer2.txt and change it to Hexer2.sh
Open Terminal
Here we need to 'cd' to the directory with your file. To do this type:
press returnCode:cd ~/Desktop
Now to make your file executabe, in Terminal type:
And finally, a few ways to execute your file:Code:chmod +x Hexer2.sh
1: you would need to open Terminal and execute your file by typing:
2: What I have done to allow double clicking of your file:Code:./Hexer2.sh
Right click on your file and select "Get Info"
Down the info you will see "Open With"
Click the drop down menu, if Terminal is not in the menu, simply select "Other..." at the bottom of the drop down and go to Applications / Utilities / Terminal.
3: you could also change the .sh to .command
Thats it, you should be able to simply double click your new script![]()
Last edited by Cyeclops; 04-30-2013 at 05:11 AM.
I have these as well for windows.
I will post them here later. I have:
decompile.bat- to dissamble the swf into the .abc folders so they can be edited
recompil.bat- reassembles the modified source into a new .swf
XML.bat - Exports all of the .bin files containing all of the xml data
XML Recompile.bat - Replace a particular modified .bin file back into the .swf
You should try and figure out the .bin ones on mac. Very useful!
---------- Post added at 12:32 PM ---------- Previous post was at 12:26 PM ----------
Here they are:
For Windows
decompile.bat:
recompile.bat:Code:swfdecompress client.swf abcexport client.swf rabcdasm client-1.abc pause
XML_Export.binCode:rabcasm client-1\client-1.main.asasm abcreplace client.swf 1 client-1\client-1.main.abc pause
XML_Replace.batCode:swfbinexport client.swf pause
x=NUMBER YOU MODIFIED
Code:swfbinreplace client.swf x client-x.bin
I suggest that you should use sed instead of vi, they have the same syntax and that's what it is for. Here is what I use, it's a bit more general:
Usage: hexer <old_verison> <new_version> <swf_file_to_hex>Code:#!/bin/bash curdir=`pwd` tmpdir=`mktemp -d /tmp/hexed-XXXX` cp $3 ${tmpdir}/hexed.swf cd $tmpdir swfdecompress hexed.swf abcexport hexed.swf rabcdasm hexed-1.abc pattern=`echo $1 | sed -e "s/\./\\\./g"` replace=`echo $2 | sed -e "s/\./\\\./g"` sed -i "s/\""$pattern"\"/\""$replace"\"/g" hexed-1/com/company/assembleegameclient/parameters/Parameters.class.asasm rabcasm hexed-1/hexed-1.main.asasm || { echo "Error! Something went wrong. ($tmpdir)" ; exit 1; } abcreplace hexed.swf 1 hexed-1/hexed-1.main.abc cd $curdir cp -i ${tmpdir}/hexed.swf . rm -r $tmpdir exit
E.g.: hexer 13 13.1 client.swf
The output is a hexed.swf in the current directory.
I don't own a mac but it should work there too. Note that I have the rabcdasm in my /usr/bin directory, so I don't use ./ before those commands.
Last edited by DatCoder; 04-30-2013 at 03:47 PM.
Cyeclops (04-30-2013)

49
Ah nice, thanks DatCoder i will look at those after work, plus the xml i hadnt thought of, i had learnt vi when I was learning to understand Terminal, and the ./ is what Mac uses to execute, so your scripts should work fine adding those to the beginning of any of your executed commands.
Thanks again for that, sprry i cant thanks at the moment, using my phone at work.
That's not true.
"." just specifies the current directory, nothing more, nothing less (".." is the parent directory). If you want to run something from the current directory you should use "./command" which tells the interpreter that the executable called "command" is in the current directory.
If you don't specify a path like "./" or "/usr/bin" or "~/Desktop" before the executable then the interpreter will by default try to search for the command in the directories specified by the PATH environmental variable. (try executing "echo $PATH" command to see)
echo, rm, cp, vi, sed, mv and other commands are also executables found in one of the directories specified by PATH.
So no, ./ will not execute any commands, only the executables in the current directory.

49
Oh ok thank you, although i tried doing the 'swfdecompress somename.swf' without the ./ and it doesnt work for me, it does work with vi, sed, grep etc without the ./ but not with the rabcasm parts?
Edit:
Opps i just re-read your reply about having rabcasm in your user/bin/ directory why you dont need to use ./
I will also try this when i get home lol
Last edited by Cyeclops; 04-30-2013 at 08:13 PM.

49
No user/bin or user/local/bin? or it's hidden somewhere, I dont think so since i have "show hidden files and folders". Can I simply 'mkdir user/local/bin'? and will this approach still add it to $PATH? Also, can you run your scripts from anywhere on your system with this method, or do they still need to be in the rabcasm folder? I know I am most likely going to answer my own questions shortly when I try them lol but in case you get to me first......
EDIT:
ok I'm obviously a tard.. Managed to find the bin folder which "is hidden".. 'open /usr' will open a new Finder window with the hidden usr folder, here I find the bin folder and also /usr/local/bin? I have tried placing both rabcasm folder into bin and also just the rabcasm executables, with no results? I have tried with and without ./ and the same non result?
For now I guess I am to use my current method until I can figure out what I am doing wrong, plus I dont enjoy messing around in here lol a little intimidating for me.
Oh and where in your script do I place the 13 and 13.1? same place as mine?
Last edited by Cyeclops; 05-01-2013 at 01:12 AM.

49
lol now there is 13.2 ... great time for people to try the hexers![]()

49
I cant seem to get this to work for me.
"that's what the parameters are for" - I'm really sorry, I dont understand. How do the parameters know what part of the file to look at and know what part(s) to change without placing the numbers in, how would it know the client version to the games current version amongst all the "somethings" in a file filled with "" and numbers? I'm missing how it knows which specific numbers it needs to change without input.
I think you should reread my posts, especially the part where I told you how to use the script and gave an example. Also, even if you only a little bit into bash scripting you should have no trouble understanding what it does.
---------- Post added at 04:07 PM ---------- Previous post was at 03:22 PM ----------
Ok, here is a little bit more detailed bash script for mac and linux users:
@Cyeclops To copy something into directories outside of your home (and tmp) you probably need admin rights, run terminal and use sudo.Code:#!/bin/bash #Check the number of arguments if [ $# -ne 3 ] then echo "Usage: `basename $0` {old version} {new version} {input filename}" exit 1 fi #Check if file exists if [ ! -f $3 ] then echo "The file $3 does not exist." exit 1 fi #Save the current working directory and make a temporary directory curdir=`pwd` tmpdir=`mktemp -d /tmp/hexed-XXXX` #Make a copy of the client to the temp dir and change dir to there cp $3 ${tmpdir}/hexed.swf cd $tmpdir #Disassemble the client swfdecompress hexed.swf abcexport hexed.swf rabcdasm hexed-1.abc #Escape dot characters from the arguments pattern=`echo $1 | sed -e "s/\./\\\./g"` replace=`echo $2 | sed -e "s/\./\\\./g"` #Search for the pattern and replace it sed -i "s/\""$pattern"\"/\""$replace"\"/g" hexed-1/com/company/assembleegameclient/parameters/Parameters.class.asasm #Try to assemble the client, if unable to, notify the user and exit leaving the temp dir behind (for debugging purposes) rabcasm hexed-1/hexed-1.main.asasm || { echo "Error! Something went wrong. ($tmpdir)" ; exit 1; } abcreplace hexed.swf 1 hexed-1/hexed-1.main.abc #Go back to the saved working directory and if everything went fine copy the swf there cd $curdir cp -i ${tmpdir}/hexed.swf . #Remove the temp directory and exit rm -r $tmpdir exit
Proably the easiest way to put this script there is to runCode:sudo cp rabcdasm /usr/bin sudo cp rabcasm /usr/bin sudo cp abcexport /usr/bin sudo cp abcreplace /usr/bin sudo cp swfdecompress /usr/bin, copy-paste the code, make sure to leave a blank line at the end and press Ctrl+D. You will probably need to add execution rights:Code:sudo cat >/usr/bin/rotmghexerI hope you got a bit more familiar with Unix. (I heard Mac uses sudo and the root user is disabled but I'm not too sure)Code:sudo chmod +x /usr/bin/rotmghexer
I had to export the XMLs and I made a little script to export them all with their respective filenames (eth0nic gave me the idea).
Here is the script:
You need to have swftools installed to use this.Code:#!/bin/bash if [ $# -ne 1 ];then echo "You have to supply a filename";exit 1;fi if [ ! -f $1 ];then echo "The file does not exist.";exit 1;fi mkdir -p XMLs swfdump $1 | grep CXML | awk -v swf=$1 '{id=$2; sub(".*_",""); sub("CXML*.",""); name=$1; system("swfextract -b " id " " swf " -o XMLs/" name ".xml")}'
The output:
Code:$ ls XMLs AbyssOfDemons.xml ForestMaze.xml ManorOfTheImmortals.xml OryxChamber.xml Regions.xml Textiles.xml CandyLand.xml GhostShip.xml Mid.xml OryxWineCellar.xml Shore.xml TombOfTheAncients.xml CaveOfAThousandTreasures.xml Ground.xml Monsters.xml Permapets.xml SnakePit.xml TravisTesting.xml Dyes.xml HauntedCemetery.xml Mountains.xml Pets.xml SpriteWorld.xml TutorialObjects.xml Encounters.xml High.xml Objects.xml PirateCave.xml StaticObjects.xml TutorialScript.xml Equip.xml Low.xml OceanTrench.xml Players.xml TempObjects.xml UndeadLair.xml ForbiddenJungle.xml MadLab.xml OryxCastle.xml Projectiles.xml TestingObjects.xml WillemTesting.xml
hello first i no this is an old post but i just got here and download the file i did what is told, but dont get it to work
when i export client.swf i starts making the the client-0.abc but not the client-1.abc so the client-1 folder is also not made i have read some post and followd those even re download the file but still the same.
any one no whats coing wrong here ?