Skip to content

Instantly share code, notes, and snippets.

View byteandahalf's full-sized avatar

Byteandahalf byteandahalf

View GitHub Profile
@byteandahalf
byteandahalf / mcpe_symbolicate_arm64.idc
Created July 29, 2016 01:16
Adds some symbols to IDA for MCPE iOS 0.15.2
#include <idc.idc>
static symbol(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;
}
static main() {
@byteandahalf
byteandahalf / LevelRenderer.h
Last active June 17, 2016 17:21
Some LevelRenderer functions that I decompiled by hand.
void LevelRenderer::_buildSkyMesh()
{
Tessellator& tessellator = Tessellator::instance;
tessellator.begin(mce::PrimitiveMode::MODE_2, 12);
tessellator.color(Color::BLACK);
tessellator.vertex(0.0F, 128.0F, 0.0F);
double x = 1.0;
double z = 0.0;
double f = Math::TAU * 0.1;
@byteandahalf
byteandahalf / symbols.txt
Last active August 15, 2016 12:44
symbols for 0.14.3
This file has been truncated, but you can view the full file.
AABB::AABB(Vec3 const&,Vec3 const&) .text 0000000000617BD4 00000096 00000010 FFFFFFFFFFFFFFF0 R
AABB::AABB(Vec3 const&,float) .text 0000000000617D94 0000003A 00000018 FFFFFFFFFFFFFFF8 R
AABB::AABB(float,float,float,float,float,float) .text 0000000000617B48 00000088 00000000 0000000C RT .
AABB::AABB(void) .text 0000000000617B28 0000001E 00000004 00000000 RT .
AABB::centerAt(Vec3 const&) .text 0000000000619658 0000007A 00000020 FFFFFFFFFFFFFFF0 RT .
AABB::clip(Vec3 const&,Vec3 const&) .text 0000000000619748 00000736 00000080 FFFFFFFFFFFFFFD8 RT .
AABB::clipXCollide(AABB const&,float) .text 0000000000618720 000000B0 RT .
AABB::clipYCollide(AABB const&,float) .text 00000000006187D0 000000B0 RT .
AABB::clipZCollide(AABB const&,float) .text 0000000000618880 000000B0 RT .
AABB::cloneMove(Vec3 const&) .text 00000000006186B8 00000068 00000020 FFFFFFFFFFFFFFF8 RT .
@byteandahalf
byteandahalf / customblocksnippet.cpp
Last active February 7, 2016 13:41
Add a custom block to Minecraft Windows 10 Edition (not complete code)
static uintptr_t** mBlocks = (uintptr_t**) (((uint8_t*)baseAddr) + 0xA75750);
static TextureUVCoordinateSet myCustomTexture{0.0F,0.0F,0.0625F,0.0625F,16,16,1,1};
TextureUVCoordinateSet& customGetTexture()
{
return myCustomTexture;
}
uint32_t customGetColor()
{
@byteandahalf
byteandahalf / Level.cpp
Created January 31, 2016 20:08
Decompilation of Level::_playerChangeDimension()
bool Level::_playerChangeDimension(Player* player, ChangeDimensionRequest& request)
{
if(request.idk == 0)
{
Dimension* destination = createDimension(request.newDim);
Dimension* currentDimension = getDimension(request.oldDim);
player->field_3272 = 3;
player->suspendRegion(); // VIRTUAL 215
if(this->field_5440.field_12 == 0)
{
@byteandahalf
byteandahalf / tiny_hook.cpp
Last active February 19, 2016 07:17
My totally working attempt at hooking 8 byte functions
#include "sys/mman.h"
void tiny_hook(uint32_t* addr, uint32_t hook) {
bool thumb = (uint32_t)addr & 1;
if(thumb)
addr = (uint32_t*) ((uint32_t) addr - 1);
mprotect(addr, 9, PROT_READ | PROT_WRITE);
*addr = (uint32_t) (thumb)? 0xF000F8DF : 0xE51FF008; // LDR PC, [PC] on Thumb and LDR PC, [PC, #-8] on ARM.
*(addr + 1) = hook;
mprotect(addr, 9, PROT_READ | PROT_EXEC);
@byteandahalf
byteandahalf / Main.cpp
Last active November 16, 2015 21:23 — forked from Khristian-kun/Main.cpp
Override Lava Bucket
#include <string>
class TextureUVCoordinateSet;
struct Item {
void** vtable; // 0
static void initItems();
static TextureUVCoordinateSet getTextureUVCoordinateSet(const std::string&, int);
static Item* mItems[512];
@byteandahalf
byteandahalf / Item.h
Last active February 20, 2016 17:36
Item header for 0.14.0
#pragma once
#include <string>
#include <memory>
class TextureUVCoordinateSet;
struct SeedItemComponent;
class FoodItemComponent;
class Block;
class CreativeItemCategory;
@byteandahalf
byteandahalf / Entity.h
Last active June 22, 2016 14:46
Entity header for MCPE 0.14.3
#pragma once
#include <string>
#include <memory>
#include <vector>
#include "../phys/Vec3.h"
class BlockSource;
class Level;
@byteandahalf
byteandahalf / Block.h
Last active February 20, 2016 06:04
Block header for MCPE 0.14.0
#pragma once
#include <string>
#include <vector>
#include "minecraftpe/client/renderer/texture/TextureUVCoordinateSet.h"
#include "minecraftpe/client/renderer/renderer/Color.h"
#include "minecraftpe/world/phys/AABB.h"
struct Material;