function checkmessage($hash, $read, $username, $i) { $out = substr($read, 4); $AMF1 = new YaBOB_AMF(); $out = $AMF1->destructAMF($out); if (@$out->data['fromUser'] === $username) { echo "[HASH FOUND]: " . $hash . ", sent " . $i . " Uniuqe hashes.\n"; exit; } }
$password = "******"; $s = new Socket\Client($address, $port); echo "[INFO] Connecting to {$address}:{$port} WhoRunIt", PHP_EOL; $AMF = new YaBOB_AMF(); $amfHandshake = new YaBOB_Handshake(); $amfReg = new YaBOB_Register(); $regInfo = $amfReg->_($emailgen, $password); unset($amfReg); $regData = $AMF->AMFlength($regInfo) . $regInfo; echo "[INFO] Waiting for a response" . PHP_EOL; $s->write($amfHandshake); unset($amfHandshake); $s->write($regData); $in = @$s->read(); $in = substr($in, 4); $response = $AMF->destructAMF($in); echo "[INFO] Recieved reply!", PHP_EOL; //var_dump($response); if (!isset($response->data)) { echo "[ERROR] Look's like someone pissed in Evony's Cheerios today; Most likely just 1 hour IP banned by Evony." . PHP_EOL; exit("[EXIT] Unexpected Error"); } if ($response->data['errorMsg'] === "need create player") { echo "[INFO] Creating player using generated email: {$emailgen} and password: {$password}"; $createplayer = new YaBOB_Common_Createnewplayer(); $player = $createplayer->_($UID, '', '', '', 11, ''); $createplayer = $AMF->AMFlength($player) . $player; $s->write($createplayer); $in = $s->read(); while ($in) { $out = @$out . $in;
<?php require_once 'amfphp/core/amf/app/Gateway.php'; require_once AMFPHP_BASE . 'amf/io/AMFSerializer.php'; require_once AMFPHP_BASE . 'amf/io/AMFDeserializer.php'; require_once 'YaBOB/AMF.php'; //$amf = NEW AMFObject(); $amfdata = (object) ['cmd' => 1, 'data' => ['cmd1' => "this is a string", 'cmd2' => (double) 2]]; //$amf->addBody($amfdata); //$amf = NEW AMFObject(""); //$amf->addBody($amfdata); //var_dump($amf); //$serializer = NEW AMFSerializer(); //$result = $serializer->writeAmf3Object($amf->_bodys[0]); //echo "Output: ".bin2hex($serializer->outBuffer)."\n\nAttempting to deserialize\n\n"; // flush the binary data // //$amf = NEW AMFObject($serializer->outBuffer); // //$deserializer = new AMFDeserializer($amf->rawData); // //var_dump($amfD = (object)$deserializer->readAmf3Data()); $AMF = new YaBOB_AMF(); $rawData = $AMF->buildAMF($amfdata); $pLength = $AMF->AMFlength($rawData); echo "Encoded Packet: " . bin2hex($pLength . $rawData) . "\n\nDecoded Packet:\n"; var_dump($AMF->destructAMF($rawData));