This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool TileTessellator::tessellateRedstoneTileInWorld(RedstoneTile* tile, int x, int y, int z, TilePos const& pos, TileSource* tilesource) { | |
Tessellator* tessellator = tessellator_inst; | |
int data = (int) tilesource->getData(x, y, z); | |
// implement my own Texture system because of issues with MCPE's normal TextureUVCoordinateSet | |
RendererTexture* cross = new RendererTexture(0.0625F, 0.0937F, 0.5F, 0.5625F, 16, 16); // Cross texture | |
RendererTexture* line = new RendererTexture(0.125F, 0.1562F, 0.5F, 0.5625F, 16, 16); // line texture | |
RendererTexture* cross_overlay = new RendererTexture(0.0938F, 0.125F, 0.5F, 0.5625F, 16, 16); // cross overlay | |
RendererTexture* line_overlay = new RendererTexture(0.1563F, 0.1875F, 0.5F, 0.5625F, 16, 16); // line overlay |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static Item* newItem() { | |
Item* myItem = (Item*) ::operator new((std::size_t) 76); // allocate memory | |
Item::Item(myItem, 55); // call the MCPE Item constructor | |
Item::items[55] = myItem; // Add the item to MCPE's global item list | |
*((void***) myItem) = *((void***) Item::items[259]); // give it a normal item vtable, in this case we steal it from flint and steel | |
Item::setDescriptionId("myitem"); // give it a name | |
I18n::_strings["item.myitem.name"] = "My YOLO itemmm"; // register the name | |
myItem->maxStackSize = 30; // max stack of 30 lololol | |
return myItem; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <dlfcn.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <stddef.h> | |
uintptr_t DynamicHookVirtual(void** vtable, char* mangled, int end, void* myfunc) { | |
int index = -1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <substrate.h> | |
#include <mach-o/dyld.h> | |
#include <string> | |
#include <stdbool.h> | |
#include <stddef.h> | |
#include <sstream> | |
#include <iomanip> | |
#include <vector> | |
#include <cstring> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Entity { | |
void** vtable; // 0 | |
SynchedEntityData data; // 4; 28 bytes | |
float x; // 32 | |
float y; // 36 | |
float z; // 40 | |
ChunkPos chunkPos; // 44; 8 bytes | |
int entityId; // 52 | |
float viewScale; // 56 | |
TileSource* region; // 60 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool TileTessellator::tessellateBrewingStandTileInWorld(BrewingStandTile* tile, int x, int y, int z, TileSource* region) { | |
Tessellator* tess = this->tessellator_inst; | |
// render the center blaze rod | |
setRenderBounds(AABB({0.4375, 0.0, 0.4375}, {0.5625, 0.875, 0.5625})); | |
tessellateBlockInWorld(tile, {x, y, z}); | |
// render the 3 blocks on the bottom | |
forcedUV = tile->getTextureUVCoordinateSet("brewing_stand_base", 0); | |
useForcedUV = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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() { |
OlderNewer