cherriesandmochi / gdmaim

GDMaim is a GDScript obfuscation plugin for the Godot Engine.
MIT License
145 stars 13 forks source link

Line Shuffling #7

Closed Ethosa closed 2 months ago

Ethosa commented 8 months ago

This feature can be helpful to obfuscate source code I think:

Before:

var some: int = 0
var other: String = "222"

func test() -> void:
    pass

class TestClass:
    func hello():
        pass

After, seed NNNN

class D_FsXk:
    func _xgSx_k():
        pass
var _sXsfS: int = 0
func _JSfXf8Sso() -> void:
    pass
var _xsFs: String = "222"

After, seed MMMM

var _sXsfS: int = 0
class D_FsXk:
    func _xgSx_k():
        pass
func _JSfXf8Sso() -> void:
    pass
var _xsFs: String = "222"
Ethosa commented 8 months ago

This can works because GDScript top-level declaration is not importantly

Ethosa commented 7 months ago

Some lines, that can seems like a problem:

var x: int = 100
var y: int = x + 100

In GDScript at top-level statement sequence is not important 👀 So this wotks:

var y: int = x + 100
var x: int = 100
cherriesandmochi commented 2 months ago

Implemented in 7faaac7.

cherriesandmochi commented 2 months ago

Thanks for the suggestion! It definitely helps a lot in making the scripts less readable!