Closed vpmedia closed 2 months ago
Public variable (Class A):
trait slot QName(PackageNamespace(""), "myVar") type QName(PackageNamespace(""), "Number") end
Public static const (Class B):
trait const QName(PackageNamespace(""), "MY_VAR") type QName(PackageNamespace(""), "String") value Utf8("myVar") end
As I've checked the swfobfuscated.d iterates over abc.strings array. This array of strings contains EVERY strings in the SWF? Both property names and string values? I've found an isObfuscatable method which checks for abc.isNamespace(n) || abc.isMultiname(n) .. So const values are sorted to Multiname?
Yeah this is an issue I knew about. To work around it you can either exclude the string or rename the string or variable name so they don't match. The reason why I don't check for string usage is because I believe it will require digging through the byte code to determine if that string is being uses as a string value. The look ups it does right now just use the name tables the disassembler had already created so it was an easier check.
And the name tables it uses (namespace and multiname) do not include strings, only symbol names. The code you mention above is exactly what we would need to search through the byte code to find. I bet there are probably other ways strings can be used as well. It will be a bit of work to fix this one.
Thank you for the quick response, I'll go with excluding these vars for a while, there are only a few of them..
string values should not be changed at all, seems like a pretty huge issue, @vpmedia are you still using this library?
No, I don't use it anymore, AS3 lost its popularity so I'm with the 'enemy' now (JS) :)
@CyberShadow if I cleanup Teesquared's fork would you be willing to accept a merge request into your RABCDAsm repo?
You mean, the entire project?
I've been planning to refactor RABCDAsm's code base so it's easier to use it as a library.
@CyberShadow this fork https://github.com/Teesquared/RABCDAsm , essentially building on top of your repo and adding support for obfuscating SWFs.
What do you mean by cleanup?
Example:
ClassA contains a public variable myVar : String; ClassB contains a static public const MY_VAR : String = "myVar";
Flasturbating ...
ClassA.myVar -> 1t7688s0 ClassB MY_VAR : String = "1t7688s0"; // Error
In my opinion string values should not be renamed at all.
Thanks!