Skip to content

Instantly share code, notes, and snippets.

View extremeheat's full-sized avatar
🔶

extremeheat

🔶
View GitHub Profile
template <unsigned int NBitsPerBlock, typename Word = unsigned int>
struct PalettedBlockStateStorage {
static const int wordByteSize = sizeof(Word)/*4*/;
static const int wordBitSize = wordByteSize * 8;
static const byte blocksPerWord = NAIVE_FLOOR(wordBitSize / NBitsPerBlock);
static const byte paddingPerWord = wordBitSize % NBitsPerBlock;
static const int wordsCount = NAIVE_CEIL(4096.0 / blocksPerWord);
@extremeheat
extremeheat / mcpe_proto_dumper.py
Created February 25, 2018 22:07
libminecraftpe objdump parser for MCPE network packets
import re
import json
LST_FILE = 'PATH_TO_OBJDUMPED_FILE'
def read_file(file_name):
file = open(file_name, 'r')
return file.readlines()
reading_packet_readwrite = False
@extremeheat
extremeheat / mcpe_dumped_proto_1.2.10.2.c
Created February 25, 2018 21:12
MCPE dumped protocol
// reading file '/Games/MinecraftPE/apks/1.2.10.2/disassem-all-disassem.txt'...
// read file.
00cbf9c8 <DisconnectPacket::getId() const@@Base>:
00cbf9e4 <DisconnectPacket::write(BinaryStream&) const@@Base>:
// cbf9e4: b5b0 push {r4, r5, r7, lr}
// cbf9e6: 4605 mov r5, r0
// cbf9e8: 460c mov r4, r1
// cbf9ea: 7b69 ldrb r1, [r5, #13]
---- PACKET: InteractPacket
---- PACKET: SetSpawnPositionPacket
---- PACKET: TextPacket
---- PACKET: CraftingEventPacket
---- PACKET: ClientToServerHandshakePacket
---- PACKET: DropItemPacket
---- PACKET: LoginPacket
---- PACKET: SetEntityLinkPacket
---- PACKET: RequestChunkRadiusPacket
---- PACKET: EntityEventPacket
@extremeheat
extremeheat / 0001-Keep-better-track-of-inventory-changes-on-Windows-10.patch
Last active September 11, 2018 13:42
Various Minecraft: Windows 10 Edition-related patches for PocketMine-MP. Must be applied consecutively.
From ee6d6a6154ce35a4945add6aa6bd57f2144b185c Mon Sep 17 00:00:00 2001
From: extremeheat <[email protected]>
Date: Sun, 24 Apr 2016 00:46:33 -0400
Subject: [PATCH 1/4] Keep better track of inventory changes on Windows 10
Edition, fix inventory moving issues
---
src/pocketmine/Player.php | 198 ++++++++++++++++++++-
.../inventory/SimpleTransactionGroup.php | 26 ++-
2 files changed, 221 insertions(+), 3 deletions(-)
@extremeheat
extremeheat / compressed.js
Last active November 14, 2015 05:16
re-implement select-based driver picking on downloadcenter.intel.com
javascript:$("#searchModule").after('<div id="findCategoryModule" class="findCategoryModule primary-content-box" style="display: none;"> <h2>Find By Category</h2> <div class="selector active"> <label for="prodFam" id="prodFamLabel" class="select-category-txt active"> 1. </label> <select id="prodFam" name="prodFam"><option value="">Select a product family</option><option value="24">Processors</option><option value="36">Desktop Boards</option><option value="37">Server Products</option><option value="38">Network Connectivity</option><option value="39">Graphics Drivers</option><option value="42">Software</option><option value="44">Embedded Components</option><option value="45">PC Accessories</option><option value="1093">Programs and Services</option><option value="1783">Wireless Networking</option><option value="2273">I/O Products</option><option value="2280">Ethernet Components</option><option value="3124">Solid-State Drives</option><option value="3796">Education</option><option value="3865">Boards and Kits</opt