I don’t know much about PHP I just watched a tutorial on how to make this obfuscation tool and it doesn’t work can someone help me fix the what mistake did I do?, when I use this it doesn’t work as a PMMP APi 2.0.0 normal PHP file anymore, it errors like, IamToqstMain not found on BaseClassLoader like that.
import base64
# Define the plugin code
plugin_code = r"""namespace IamToqst;
use pocketminepluginPluginBase;
use pocketmineeventListener;
use pocketmineeventplayerPlayerJoinEvent;
class Main extends PluginBase implements Listener {
public function onEnable(){
$this->getLogger()->info("HelloWorld plugin has been enabled!");
$this->getServer()->getPluginManager()->registerEvents($this, $this);
}
public function onJoin(PlayerJoinEvent $event){
$player = $event->getPlayer();
$player->sendMessage("Hello, " . $player->getName() . "! Welcome to the server!");
}
}
"""
# Encode the plugin code using base64 and gzindeflate method
encoded_gzindeflate = base64.b64encode(plugin_code.encode()).decode()
encoded_gzindeflate = ''.join([chr(ord(c) ^ 0xFF) for c in encoded_gzindeflate]) # gzindeflate method
# Encode the plugin code using base64 and gzinflate
encoded_gzinflate = base64.b64encode(plugin_code.encode()).decode()
encoded_gzinflate = f'base64_decode(gzinflate(base64_decode("{encoded_gzinflate}")))'
# Encode the plugin code using base36
encoded_base36 = base64.b64encode(plugin_code.encode()).decode()
encoded_base36 = 'base64_decode(strrev(' + '"' + encoded_base36[::-1] + '"' + '))' # base36 encoding
# Combine all enhancements into one
enhanced_code = f"""<?php
@eval(base64_decode({encoded_gzindeflate}));
@eval({encoded_gzinflate});
@eval({encoded_base36});"""
print(enhanced_code)
New contributor
Tadashi Hamada is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1