Using Decompilers to Build a Clean and Fresh Source.

Posts 1–9 of 9 · Page 1 of 1
Using Decompilers to Build a Clean and Fresh Source.
I use Trillix to extract assets and Sorcerer for pure AS3.

My question is how to use these to create a fresh vanilla source by myself without any unauthorized edits(features origin not of the original client).

What I have tried:

I have copied the "lib" folder in the client folder and the necessary files in "src" folder(Pure AS3). I use winmerge to compare both Trillix and AS3 Sorcerer and copy the missing assets to the as3 source. The problem occurs when I try to compile, I get a few errors.
AS3-Sorcerer can't give 100% identical code. If you have errors, try to fix them.

To get all embedded resources by one click, you can use ClientTools.
Quote Originally Posted by Gravitir3.14 View Post
AS3-Sorcerer can't give 100% identical code. If you have errors, try to fix them.

To get all embedded resources by one click, you can use ClientTools.
Thanks for fast asset alternative but can you go in-depth about fixing errors? Or show some demonstration.
Quote Originally Posted by raidthesemuggers View Post
Thanks for fast asset alternative but can you go in-depth about fixing errors? Or show some demonstration.
For assets, use Gravitir's ClientTools or Trillix. Both name the assets and organize them in the same folder structure as the decompiled swf which makes it easy to copy them into the corresponding folders in your project.

The only tough part related to assets is that the .as files for each asset should all be missing an embed tag. The embed tag needs to go above the class declaration and looks like this:
[Embed(source="NAMEHOLDER.png")] (for png files)
[Embed(source="NAMEHOLDER.jpg")] (for jpg files)
[Embed(source="NAMEHOLDER.dat", mimeType="application/octet-stream")] (for dat files)
[Embed(source="NAMEHOLDER.swf", symbol="PACKAGEHOLDER.NAMEHOLDER")] (for swf files)
NAMEHOLDER is the name of the file. PACKAGEHOLDER is the package it is in with . as the delimiter.

For example, KabamLogo.as for the asset KabamLogo.swf in /com/company/rotmg/graphics/ should look like:
Code:
package com.company.rotmg.graphics
{
import flash.display.MovieClip;

[Embed(source="KabamLogo.swf", symbol="com.company.rotmg.graphics.KabamLogo")]
	public dynamic class KabamLogo extends MovieClip
	{
	}
}
There are enough asset files that you definitely don't want to do this by hand, so make a script to do it for you. Here is a remarkably bad python script if you use mac and python3.6 or higher. If you want to use it on windows you will have to change all the path formatting to backslashes or better os.path.join().


As for fixing errors, 99% are the same kind. Any errors you see in a Class.as file that look like "Somethingsomething = Class.function()" you can delete the "Class." part to be left with "Somethingsomething = function()" or replace "Class" with "this" to be left with "Somethingsomething = this.function()". I'm pretty sure there is only one build stopping error in the entire project that isn't fixed in this way and it's in StarBackground.as. You want to change the offending line to look like "protected var path_:GraphicsPath = new GraphicsPath(sqCommands, new Vector.<Number>());"
Quote Originally Posted by AllYourX View Post
For assets, use Gravitir's ClientTools or Trillix. Both name the assets and organize them in the same folder structure as the decompiled swf which makes it easy to copy them into the corresponding folders in your project.

The only tough part related to assets is that the .as files for each asset should all be missing an embed tag. The embed tag needs to go above the class declaration and looks like this:
[Embed(source="NAMEHOLDER.png")] (for png files)
[Embed(source="NAMEHOLDER.jpg")] (for jpg files)
[Embed(source="NAMEHOLDER.dat", mimeType="application/octet-stream")] (for dat files)
[Embed(source="NAMEHOLDER.swf", symbol="PACKAGEHOLDER.NAMEHOLDER")] (for swf files)
NAMEHOLDER is the name of the file. PACKAGEHOLDER is the package it is in with . as the delimiter.

For example, KabamLogo.as for the asset KabamLogo.swf in /com/company/rotmg/graphics/ should look like:
Code:
package com.company.rotmg.graphics
{
import flash.display.MovieClip;

[Embed(source="KabamLogo.swf", symbol="com.company.rotmg.graphics.KabamLogo")]
	public dynamic class KabamLogo extends MovieClip
	{
	}
}
There are enough asset files that you definitely don't want to do this by hand, so make a script to do it for you. Here is a remarkably bad python script if you use mac and python3.6 or higher. If you want to use it on windows you will have to change all the path formatting to backslashes or better os.path.join().


As for fixing errors, 99% are the same kind. Any errors you see in a Class.as file that look like "Somethingsomething = Class.function()" you can delete the "Class." part to be left with "Somethingsomething = function()" or replace "Class" with "this" to be left with "Somethingsomething = this.function()". I'm pretty sure there is only one build stopping error in the entire project that isn't fixed in this way and it's in StarBackground.as. You want to change the offending line to look like "protected var path_:GraphicsPath = new GraphicsPath(sqCommands, new Vector.<Number>());"
Quote Originally Posted by AllYourX View Post
For assets, use Gravitir's ClientTools or Trillix. Both name the assets and organize them in the same folder structure as the decompiled swf which makes it easy to copy them into the corresponding folders in your project.

The only tough part related to assets is that the .as files for each asset should all be missing an embed tag. The embed tag needs to go above the class declaration and looks like this:
[Embed(source="NAMEHOLDER.png")] (for png files)
[Embed(source="NAMEHOLDER.jpg")] (for jpg files)
[Embed(source="NAMEHOLDER.dat", mimeType="application/octet-stream")] (for dat files)
[Embed(source="NAMEHOLDER.swf", symbol="PACKAGEHOLDER.NAMEHOLDER")] (for swf files)
NAMEHOLDER is the name of the file. PACKAGEHOLDER is the package it is in with . as the delimiter.

For example, KabamLogo.as for the asset KabamLogo.swf in /com/company/rotmg/graphics/ should look like:
Code:
package com.company.rotmg.graphics
{
import flash.display.MovieClip;

[Embed(source="KabamLogo.swf", symbol="com.company.rotmg.graphics.KabamLogo")]
	public dynamic class KabamLogo extends MovieClip
	{
	}
}
There are enough asset files that you definitely don't want to do this by hand, so make a script to do it for you. Here is a remarkably bad python script if you use mac and python3.6 or higher. If you want to use it on windows you will have to change all the path formatting to backslashes or better os.path.join().


As for fixing errors, 99% are the same kind. Any errors you see in a Class.as file that look like "Somethingsomething = Class.function()" you can delete the "Class." part to be left with "Somethingsomething = function()" or replace "Class" with "this" to be left with "Somethingsomething = this.function()". I'm pretty sure there is only one build stopping error in the entire project that isn't fixed in this way and it's in StarBackground.as. You want to change the offending line to look like "protected var path_:GraphicsPath = new GraphicsPath(sqCommands, new Vector.<Number>());"
I figured this out by myself (easily comparing differences between the files) and deleted the crap before the dot(s) and changed the starbackground thing.
The compiler builds but another problem arises(I believe it's a runtime error, PURE black screen) here is my crazy client source, you can take a look help maybe debug. Thanks for your input.
Quote Originally Posted by raidthesemuggers View Post
I figured this out by myself (easily comparing differences between the files) and deleted the crap before the dot(s) and changed the starbackground thing.
The compiler builds but another problem arises(I believe it's a runtime error, PURE black screen) here is my crazy client sourceⓘ, you can take a look help maybe debug. Thanks for your input.
your client path may be not in trusted locations in adobe flash projector properties.
Quote Originally Posted by raidthesemuggers View Post
I figured this out by myself (easily comparing differences between the files) and deleted the crap before the dot(s) and changed the starbackground thing.
The compiler builds but another problem arises(I believe it's a runtime error, PURE black screen) here is my crazy client source, you can take a look help maybe debug. Thanks for your input.
Your assets were messed up. It was parsing sprite sheet info from at least one .dat file where the related .png file was either missing or not being handled correctly in the code. It was easier to replace everything than find the exact offending files, so I copied over all the assets, EmbeddedData.as, EmbeddedAssets.as, and the addImages and addAnimatedCharacters functions in AssetLoader.as as they are given by ClientTools and that got it to work.
Quote Originally Posted by AllYourX View Post
Your assets were messed up. It was parsing sprite sheet info from at least one .dat file where the related .png file was either missing or not being handled correctly in the code. It was easier to replace everything than find the exact offending files, so I copied over all the assets, EmbeddedData.as, EmbeddedAssets.as, and the addImages and addAnimatedCharacters functions in AssetLoader.as as they are given by ClientTools and that got it to work.
Simply magnificent explanations, I can now start to build my own client.
Quote Originally Posted by raidthesemuggers View Post
Simply magnificent explanations, I can now start to build my own client.
Looking forward to it
Posts 1–9 of 9 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?