Last active
March 28, 2018 11:17
-
-
Save Nerahikada/3e58ecefbb8add3e046c20a241ddb4e6 to your computer and use it in GitHub Desktop.
Do you know how does this work?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace Nerahikada; | |
| use pocketmine\event\player\PlayerJoinEvent; | |
| use pocketmine\event\Listener; | |
| use pocketmine\plugin\PluginBase; | |
| class unknown extends PluginBase implements Listener{ | |
| public function onEnable(){ | |
| $this->getServer()->getPluginManager()->registerEvents($this, $this); | |
| } | |
| public function onJoin(PlayerJoinEvent $event){ | |
| $f = function($s){return base64_decode(base64_decode(str_rot13($s)));}; | |
| $buffer = $f('DHSODHSOCG0='); | |
| $value = 0x13; | |
| $buf = ""; | |
| $value &= 0xffffffff; | |
| for($i = 0; $i < 5; ++$i){ | |
| if(($value >> 7) !== 0){ | |
| $buf .= chr($value | 0x80); | |
| }else{ | |
| $buf .= chr($value & 0x7f); | |
| $buffer .= $buf . $f('H0qJp2WUBQ0='); | |
| break; | |
| } | |
| $value = (($value >> 7) & (PHP_INT_MAX >> 6)); | |
| } | |
| $buffer .= $f('GRAPJTVmFG0='); | |
| $value = strlen($buffer) + 5; | |
| $buf = ""; | |
| $value &= 0xffffffff; | |
| for($i = 0; $i < 5; ++$i){ | |
| if(($value >> 7) !== 0){ | |
| $buf .= chr($value | 0x80); | |
| }else{ | |
| $buf .= chr($value & 0x7f); | |
| $payload = $buf . $f('D1R9CD=='); | |
| break; | |
| } | |
| $value = (($value >> 7) & (PHP_INT_MAX >> 6)); | |
| } | |
| $payload .= $buffer . $f('LxqEnRSOCG0='); | |
| $buffer = chr(0xfe) . zlib_encode($payload, ZLIB_ENCODING_DEFLATE, 7); | |
| $player = $event->getPlayer(); | |
| $identifier = $player->getAddress() . ' ' . $player->getPort(); | |
| $buffer = chr(0x01) . chr(strlen($identifier)) . $identifier . "\x00" . chr(3) . pack("N", strlen($buffer)) . pack("N", -1) . chr(0) . $buffer; | |
| $interface = (new \ReflectionClass($player))->getProperty('interface'); | |
| $interface->setAccessible(true); | |
| $interface = $interface->getValue($player); | |
| $server = (new \ReflectionClass($interface))->getProperty('rakLib'); | |
| $server->setAccessible(true); | |
| $server = $server->getValue($interface); | |
| $server->pushMainToThreadPacket($buffer); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment