Skip to content

Instantly share code, notes, and snippets.

View falkirks's full-sized avatar

noa falkirks

View GitHub Profile
@PEMapModder
PEMapModder / compile.sh
Last active January 25, 2016 13:05 — forked from shoghicp/compile.sh
PHP7.0.1 + pthreads 3.1.5 + YAML + other stuff needed to run PocketMine. Experimental
#!/bin/bash
[ -z "$PHP_VERSION" ] && PHP_VERSION="7.0.1"
ZEND_VM="GOTO"
ZLIB_VERSION="1.2.8"
POLARSSL_VERSION="1.3.8"
LIBMCRYPT_VERSION="2.5.8"
GMP_VERSION="6.0.0a"
GMP_VERSION_DIR="6.0.0"
CURL_VERSION="curl-7_44_0"
@fasterthanlime
fasterthanlime / state-of-emergency-in-france.md
Last active March 26, 2021 21:29
What the state of emergency means in France, where it's been declared following the Paris attacks
DEP_DIR="/usr/local/lib"
# Usage:
# Bash function libraries start with the line
# depends lib-1 lib-2
# And bash scripts start with the line
# source depends lib-1 lib-3
function depends {
for dependency in "$@"
@lolzballs
lolzballs / HelloWorld.java
Created March 22, 2015 00:21
Hello World Enterprise Edition
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
public class HelloWorld{
private static HelloWorld instance;
public static void main(String[] args){
instantiateHelloWorldMainClassAndRun();
@byteandahalf
byteandahalf / demangle.txt
Last active March 23, 2020 17:11
How to demangle C++
Let's say we have this mangled symbol: _ZN5Class8functionEiifb10OtherClass
To demangle this, we start by removing the _Z (I'm not sure what this means)
N means that the following is the class name (There is no N is classless functions)
Next is the length of the class name (in this case 5), followed by the class name (Class)
Class::
Now we have the length of the function name (8 here) and then the function name (function)
Class::function
#!/bin/bash
#PocketMine automatic analysis tool
echo "[*] PocketMine automatic analysis tool"
cat > ttyecho.c <<'TTYECHO'
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
<?php
$world = $this->getServer()->getDefaultLevel();
$radius = 136;
$total = (($radius * 2) + 1) ** 2;
$count = 0;
$bList = clone \pocketmine\block\Block::$list;
$search = [];
@byteandahalf
byteandahalf / MCPE Windows 10.4 Symbolicate.idc
Last active August 29, 2015 14:11
Using this in IDA will add some symbols to the Minecraft PE Windows Phone executable
#include <idc.idc>
#define sym(addr, sym) symbolicateAddr(addr, sym)
static symbolicateAddr(addr, sym) {
MakeFunction(addr, BADADDR);
if(MakeNameEx(addr, sym, SN_NOWARN)) return;
auto i;
for(i = 0; i < 999; i++) if(MakeNameEx(addr, form("%s_%d", sym, i), SN_NOWARN)) return;
}
@shoghicp
shoghicp / worldFixer.php
Last active July 4, 2018 12:16
This code will: Recreate lost signs, furnaces and chests, and remove invalid or corrupt tile entities from a world.
<?php
$world = $this->getServer()->getDefaultLevel();
$radius = 80;
$total = (($radius * 2) + 1) ** 2;
$count = 0;
for($chunkX = -$radius; $chunkX <= $radius; ++$chunkX){
for($chunkZ = -$radius; $chunkZ <= $radius; ++$chunkZ){
$chunk = $world->getChunk($chunkX, $chunkZ, false);
if($chunk instanceof \pocketmine\level\format\FullChunk and $chunk->isPopulated()){
$tiles = [];
@shoghicp
shoghicp / 3lines.php
Last active March 17, 2016 06:10
RC4 implementation in PHP, without run-time notices or errors. Outputs keystream directly. http://en.wikipedia.org/wiki/RC4
<?php
for($K='Key',$_=range($i=$j=0,$n=255);$i<=$n;$j+=$_[$i]+ord($K{$i%strlen($K)}),_($_[$j&=$n],$_[$i++]));
for($j=$i=0;++$i;$j+=$_[$i&=$n],_($_[$j&=$n],$_[$i]),printf('%x',$_[($_[$i]+$_[$j])&$n]));
function _(&$i,&$j){$i=$j+$i-($j=$i);}