Commit ee9957a1 authored by CortexPE's avatar CortexPE Committed by GitHub
Browse files

Bypass SpoonDetector xD

Taken from a W.I.P. Build of Leveryl...
And get_calling_class() is from https://stackoverflow.com/a/6927569/7126351
parent 25992fe8
......@@ -321,7 +321,24 @@ class Server{
* @return string
*/
public function getName() : string{
return "GenisysPro";
$class = $this->get_calling_class();
if(strchr($class,"SpoonDetector")){
$this->logger->debug("HAHA! BYPASSED " . $class . "'s SPOON DETECTOR!");
return "PocketMine-MP"; // lol
}
return "GenisysPro";
}
private function get_calling_class() : string {
// tnx https://stackoverflow.com/a/6927569/7126351
$trace = debug_backtrace();
$class = $trace[1]['class'];
for ( $i=1; $i<count( $trace ); $i++ ) {
if ( isset( $trace[$i] ) )
if ( $class != $trace[$i]['class'] )
return $trace[$i]['class'];
}
return "null";
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment