Skip to content

Instantly share code, notes, and snippets.

View Frago9876543210's full-sized avatar

Frago9876543210

View GitHub Profile
diff --git a/compile.sh b/compile.sh
index e660c98..baf7a7b 100755
--- a/compile.sh
+++ b/compile.sh
@@ -14,6 +14,7 @@ LIBZIP_VERSION="1.7.3"
SQLITE3_YEAR="2021"
SQLITE3_VERSION="3340100" #3.34.1
LIBDEFLATE_VERSION="448e3f3b042219bccb0080e393ba3eb68c2091d5" #1.7
+LIBFFI_VERSION="3.3"
@Frago9876543210
Frago9876543210 / black_magic.cpp
Created June 30, 2020 13:21
get RTTI type name in runtime
#include <cstdio>
//black magic
struct Hacked {
void **vt;
};
template<typename T>
const char *getRuntimeTypename(T *type) {
auto type_info = (void **) ((Hacked *) type)->vt[-1];
#![no_std]
macro_rules! has_impl {
($ty:ty: $tr:path) => {
{
struct Test<T: ?Sized>(core::marker::PhantomData<T>);
#[allow(dead_code)]
impl<T: ?Sized + $tr> Test<T> {
const HAS_IMPL: bool = true;
@Frago9876543210
Frago9876543210 / main.rs
Created November 30, 2019 18:46
resistance-calculator in rust
use Connection::*;
type Resistor = f64;
enum Connection {
Wrapper(Vec<Self>),
Parallel(Vec<Self>),
Serial(Vec<Resistor>),
}
@Frago9876543210
Frago9876543210 / dump.php
Last active September 30, 2021 11:50
bedrock_server packet tracer
<?php
declare(strict_types=1);
use pocketmine\network\mcpe\protocol\PacketPool;
use pocketmine\utils\BinaryDataException;
require_once "vendor/autoload.php";
$packetPool = PacketPool::getInstance();
diff --git a/appveyor.yml b/appveyor.yml
index d59cfd2..7c77a1f 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -1,13 +1,14 @@
-image: Visual Studio 2017
+image: Ubuntu1804
version: php-7.2-appveyor{build}
-clone_folder: c:\pmmp\windows-php
build_script:
//frida-trace -U -i "_ZN14TransferPacket4readER12BinaryStream" com.mojang.minecraftpe
//Tested on MCPE 1.1.4
{
onEnter: function(log, args, state) {
this.ptr = args[0];
},
onLeave: function(log, retval, state) {
realAddr = Memory.readPointer(this.ptr.add(12));
rlen = Memory.readU32(realAddr.sub(12));
uint8arr = new Uint8Array(Memory.readByteArray(realAddr, rlen));
<?php
declare(strict_types=1);
ini_set("memory_limit", "1M");
global $i;
register_shutdown_function(function() : void{
if(error_get_last() !== null){
<?php
declare(strict_types=1);
use Mdanter\Ecc\Crypto\{Key\PrivateKeyInterface, Signature\Signature};
use Mdanter\Ecc\Serializer\PrivateKey\{DerPrivateKeySerializer, PemPrivateKeySerializer};
use Mdanter\Ecc\Serializer\PublicKey\{DerPublicKeySerializer, PemPublicKeySerializer};
use Mdanter\Ecc\Serializer\Signature\DerSignatureSerializer;
class JWT{
diff --git a/hybris/src/hooks.c b/hybris/src/hooks.c
index cc65f8a..5b94236 100644
--- a/hybris/src/hooks.c
+++ b/hybris/src/hooks.c
@@ -38,6 +38,7 @@
#include <errno.h>
#include <dirent.h>
#include <sys/types.h>
+#include <sys/uio.h>
#include <stdarg.h>