Skip to content

Instantly share code, notes, and snippets.

@shoghicp
shoghicp / gist:3121930
Created Jul 16, 2012
Test PHP CLient for Minecraft
View gist:3121930
$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 Oct 21, 2012
0x84 Minecraft PE Compilation
View 0x84.txt
//Packet 0x84 compilation
//Client -> Server
//Server ID ffffffffd7189931
00 00004000 9000000009 ffffffffd7189931 4273a8508fa03694 00
//Server -> Client
@shoghicp
shoghicp / client.txt
Created Oct 21, 2012
Partial Client Minecraft PE packet dump
View client.txt
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
@shoghicp
shoghicp / server.txt
Created Oct 21, 2012
Partial Custom Server Minecraft PE Packet Dump
View server.txt
[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 Oct 25, 2012
Minecraft PHP CLient 2 ping()
View ping.php
<?php
/*
-
/ \
/ \
/ MINECRAFT \
/ PHP \
View gist:3968829
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 Jan 12, 2013
async PHP Console I/O, Needs pthreads https://github.com/krakjoe/pthreads/
View IO.php
<?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 Jul 26, 2020
Minecraft PE .lst Information Extractor to obtain Protocol Information and Compare Versions
View Comparator.php
<?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 Dec 12, 2015
WorldEditor 0.4dev for PocketMine-MP Alpha_1.2dev API #2
View WorldEditor.php
<?php
/*
__PocketMine Plugin__
name=WorldEditor
description=World Editor is a port of WorldEdit to PocketMine
version=0.4dev
author=shoghicp
class=WorldEditor
apiversion=3
View events.md
           -
         /   \
      /         \
   /   PocketMine  \
/          MP         \
|\     @shoghicp     /|
|.   \           /   .|
| ..     \   /     .. |
|    ..    |    ..    |