Skip to content

Instantly share code, notes, and snippets.

@shoghicp
shoghicp / gist:3121930
Created July 16, 2012 10:11
Test PHP CLient for Minecraft
$client = new MinecraftClient("127.0.0.1");
$client->event("onTick", "spammer");
$client->connect("troll", "trollpassword");
function spammer($data, $event, $ob){
$ob->say("SPAM!!");
}
@shoghicp
shoghicp / 0x84.txt
Created October 21, 2012 21:08
0x84 Minecraft PE Compilation
//Packet 0x84 compilation
//Client -> Server
//Server ID ffffffffd7189931
00 00004000 9000000009 ffffffffd7189931 4273a8508fa03694 00
//Server -> Client
@shoghicp
shoghicp / client.txt
Created October 21, 2012 21:43
Partial Client Minecraft PE packet dump
This file has been truncated, but you can view the full file.
[1350855337.7126] [CLIENT->SERVER :0]: ID_UNCONNECTED_PING_OPEN_CONNECTIONS (0x02) [lenght 25]
0000 02 40 90 0f 3f 7e 00 00 00 00 ff ff 00 fe fe fe .@..?~..........
0010 fe fd fd fd fd 12 34 56 78 ......4Vx
0 => double(1027.8120040894)
[1350855337.7229] [SERVER->CLIENT 192.168.0.196:19132]: ID_UNCONNECTED_PONG (0x1c) [lenght 54]
0000 1c 40 90 0f 3f 7e 00 00 00 00 00 00 00 7b de dd .@..?~.......{..
0010 88 00 ff ff 00 fe fe fe fe fd fd fd fd 12 34 56 ..............4V
0020 78 00 13 4d 43 43 50 50 3b 44 65 6d 6f 3b 73 68 x..MCCPP;Demo;sh
0030 6f 67 68 69 63 70 oghicp
@shoghicp
shoghicp / server.txt
Created October 21, 2012 21:46
Partial Custom Server Minecraft PE Packet Dump
[1350855799.3375] [CLIENT->SERVER 192.168.0.196:43727]: ID_UNCONNECTED_PING_OPEN_CONNECTIONS (0x02) [lenght 25]
0000 02 00 00 00 00 00 09 76 d9 00 ff ff 00 fe fe fe .......v........
0010 fe fd fd fd fd 12 34 56 78 ......4Vx
0 => double(3.0644372276739E-318)
1 => magic(00ffff00fefefefefdfdfdfd12345678)
[1350855799.339] [SERVER->CLIENT :0]: ID_UNCONNECTED_PONG (0x1c) [lenght 54]
0000 1c 00 00 00 00 00 09 76 d9 b8 f9 7d ec fa bf d9 .......v...}....
0010 b8 00 ff ff 00 fe fe fe fe fd fd fd fd 12 34 56 ..............4V
0020 78 00 13 4d 43 43 50 50 3b 44 65 6d 6f 3b 73 68 x..MCCPP;Demo;sh
@shoghicp
shoghicp / ping.php
Created October 25, 2012 20:37
Minecraft PHP CLient 2 ping()
<?php
/*
-
/ \
/ \
/ MINECRAFT \
/ PHP \
protected function _shiftIV($IV, $str){ //Only for CFB
if(strlen($str) < 16){
$len = min($this->IVLenght, strlen($str));
return substr($IV, $len).substr($str, -$len);
}
return substr($str, -$this->IVLenght);
}
@shoghicp
shoghicp / IO.php
Created January 12, 2013 12:24
async PHP Console I/O, Needs pthreads https://github.com/krakjoe/pthreads/
<?php
if(!extension_loaded("pthreads") and @dl((PHP_SHLIB_SUFFIX === "dll" ? "php_":"") . "pthreads." . PHP_SHLIB_SUFFIX) === false){
trigger_error("Unable to find pthreads extension", E_USER_ERROR);
exit(1);
}
function kill($pid){
$uname = strtoupper(php_uname("s"));
@shoghicp
shoghicp / Comparator.php
Last active July 26, 2020 21:36
Minecraft PE .lst Information Extractor to obtain Protocol Information and Compare Versions
<?php
define("COMPARATOR_VERSION", "0.1");
ini_set("memory_limit", "512M");
$node1 = json_decode(@file_get_contents($argv[1]), true);
if($node1 == ""){
echo "Provide a valid json file produced by the Extractor".PHP_EOL;
exit(1);
}
$node2 = json_decode(@file_get_contents($argv[2]), true);
@shoghicp
shoghicp / WorldEditor.php
Last active December 12, 2015 09:19
WorldEditor 0.4dev for PocketMine-MP Alpha_1.2dev API #2
<?php
/*
__PocketMine Plugin__
name=WorldEditor
description=World Editor is a port of WorldEdit to PocketMine
version=0.4dev
author=shoghicp
class=WorldEditor
apiversion=3
           -
         /   \
      /         \
   /   PocketMine  \
/          MP         \
|\     @shoghicp     /|
|.   \           /   .|
| ..     \   /     .. |
| .. | .. |