• 1

    posted a message on Programming mods in Fortran
    Experimenting with mod development and due to a conversation with 500ISE, I've successfully gotten Fortran code to compile and run as a MCPE/BlockLauncher mod.

    About building toolchains with languages not shipped with stock Android NDK:
    Although this thread has Fortran in the title, these methods could theoretically be adapted to program mods in most of GCC's supported languages. This is for native BlockLauncher mods.

    Note: building toolchains isn't an exact science and many times you may run into troubles at every step. Please don't report what does and doesn't work in the process. Many of your build problems can be solved by searching the web. This guide is strictly a rough idea of building a toolchain for Android with more than just C and C++ enabled.

    Requisites:

    • A copy of Android/Google's version of GCC 4.8's source.
    • A copy of Android/Google's version of Binutils 2.24's source.
    • Recent Android NDK.
    • Recent Android SDK.
    • Native library template.
    • Some low-level understanding of programming in target language.
    • A terminal (linux/mac/unix) or terminal emulator (cygwin/mingw on windows)
    • git and gcc installed on your machine.
    • Fortran Mod source template (download:here)
    Downloading:

    Open your terminal and type/copy-paste the following commands:
     mkdir mytoolkit
    cd mytoolkit
    git clone https://android.googlesource.com/toolchain/gcc
    git clone https://android.googlesource.com/toolchain/binutils
    cd gcc/gcc-4.8
    ./contrib/download_prerequisites
    cd ../..
    mkdir binutils-build
    cd binutils-build
    ../binutils/binutils-2.24/configure --prefix=/tmp/ndk-User/build/toolchain/prefix --target=arm-linux-androideabi
    make
    make install
    cd ..
    mkdir gcc-build
    cd gcc-build
    ../gcc/gcc-4.8/configure --prefix=/tmp/ndk-User/build/toolchain/prefix --target=arm-linux-androideabi --enable-languages=c,c++,fortran --disable-ppl-version-check --disable-cloog-version-check --disable-isl-version-check --enable-cloog-backend=isl --with-host-libstdcxx='-static-libgcc -lstdc++ -lm' --disable-libssp --enable-threads --disable-nls --disable-libmudflap --disable-libgomp --disable-libstdc__-v3 --disable-sjlj-exceptions --disable-shared --disable-tls --disable-libitm --with-float=soft --with-fpu=vfp --with-arch=armv5te --enable-target-optspace --enable-initfini-array --disable-nls --prefix=/tmp/ndk-User/build/toolchain/prefix --with-sysroot=SYSROOT --with-binutils-version=2.24 --with-mpfr-version=3.1.1 --with-mpc-version=1.0.1 --with-gmp-version=5.0.5 --with-gcc-version=4.8 --with-gdb-version=7.6 --with-python=/Users/User/mydroid/ndk/prebuilt/darwin-x86_64/bin/python-config.sh --with-gxx-include-dir=/tmp/ndk-User/build/toolchain/prefix/include/c++/4.8 --with-bugurl=http://source.android.com/source/report-bugs.html --disable-bootstrap --disable-libquadmath --enable-plugins --enable-libgomp --disable-libsanitizer --enable-gold --enable-graphite=yes --with-cloog-version=0.18.0 --with-isl-version=0.11.1 --enable-eh-frame-hdr-for-static --with-arch=armv5te --program-transform-name='s&^&arm-linux-androideabi-&' --enable-gold=default CC=gcc CXX=g++
    make
    make install



    Note: Replace SYSROOT with the the full path to your NDK and add "/platforms/android-14/arch-arm". You should've received an error while libgfortran was being built and during installation. Ignore those and continue anyways as libgfortran isn't needed a this time.

    Now you should have a toolchain located in /tmp/ndk-User/build/toolchain/prefix. Open this folder and merge it with the /toolchains/arm-linux-androideabi-4.8/prebuilt/ folder in your NDK. This should overwrite most of the GCC files in that toolchain. Now copy the following from /toolchains/arm-linux-androideabi-4.6/prebuilt/SYSTEM_OS/bin/ to /toolchains/arm-linux-androideabi-4.8/prebuilt/SYSTEM_OS/bin/
    • arm-linux-androideabi-ld
    • arm-linux-androideabi-ld.bfd
    • arm-linux-androideabi-ld.gold
    • arm-linux-androideabi-ld.mcld
    Now copy the following from linux-androideabi-4.6/prebuilt/SYSTEM_OS/arm-linux-androideabi/bin/ to /toolchains/arm-linux-androideabi-4.8/prebuilt/SYSTEM_OS/arm-linux-androideabi/bin/

    • ld
    • ld.bfd
    • ld.gold
    • ld.mcld
    Your toolchain should now be ready.
    Included with the Fortran mod source download are Fortran bindings for 500ISE's mcpelauncher functions, the Unix dynamic linker functions (dlopen, dlsym, dlclose, dlerror), and a sample mod that prints to Logcat when an arrow entity ticks (after it is fired). Build: ndk-build in the source directory then ant debug/ant debug install.

    My mods:
    Coming soon..?

    Not useful for players:
    Prebuilt Fortran mod download:here
    Fortran mod source/template download:here
    Posted in: MCPE: Mods / Tools
  • 30

    posted a message on [Android] PocketTool
    Hello Everyone,


    I now work on PocketTool everyday and I plan on releasing updates every week. It is being designed as an all-in-one package to install texture packs, skins, and mods. It does not require root. Simply download your favorite texture pack/skin and use PocketTool to install it. No computer or file browser required.


    Pretty cool PocketTool tutorial found here (Outdated as of Mar 21, 2012):

    Mod Patching information:
    http://www.minecraft...8-mod-patching/

    Change log (no longer actively being update, please see What's New section on Google Play):

    Google Play Release:
    -Massive code changes
    -Compatible with all (or atleast 98%) texture packs
    (No more worrying about the structure of the zip folder, just download and place in "download" folder on sdcard or download directly from phone internet browser)
    -GUI changes
    -New Icon
    -Will recognize any zip file as a texture pack
    -Now uses a separate installer for texture packs and skins in the "download" folder
    -Allows the usage of the "originals" textures
    -Mod Patching
    -Auto-detect new MC PE versions


    UPDATE Mar 6:
    -Added Settings (Menu > Settings)
    -Disable the uninstaller under Settings
    -Settings saved on sdcard ("/sdcard/PocketTool/settings.bin")

    UPDATE Mar 4:
    -GUI implemented
    -Supports multiple skins
    -Added zipped texture pack support
    -Searches download folder for skins/textures

    Manual:

    Features:
    Install char skin and/or texture pack.



    Planned features:
    Inventory editor.
    Previews of the changes before they are applied.


    NOTICE:
    Please uninstall any previous version of PocketTool before installing this update.


    Directions:
    You must have Minecraft PE or Minecraft PE Demo installed in order for PocketTool to run.
    Launch PocketTool.

    Install Downloaded Skins/Texture Packs:
    Click "Install Downloaded Content"
    You may install a skin by long pressing the skin you wish to install and click "Install"
    You may install a texture pack by long pressing the texture pack name you wish to install and click "Install"
    Return to the MainScreen (hit Back button)


    Use Installed Skins/Texture Packs:
    Click "Change Textures/Skins"
    You may install a skin by long pressing the skin you wish to install and click "Use"
    You may install a texture pack by long pressing the texture pack name you wish to install and click "Use"

    Install:
    Press your device's "Menu" button/key then click "Apply Changes"
    Confirm the uninstall. Confirm the install.
    Launch Minecraft PE (or Demo) and enjoy your new skin and texture pack!

    Feedback is always appreciated!



    Known Issues:

    -PocketTool will now check /sdcard/Download/ and /sdcard/download/ for skins/textures. If your phone uses a different folder for downloads, please inform me.
    -PocketTool only recognizes skins if the skin has ".png" in its name (i.e. "insertrandomnamehere.png")

    Credits:
    Ken Ellinwood (Creator of Zip Signer 2) for his amazing zip-signer api, which made this tool possible.
    SpoutDev team for SimpleNBT
    500 Internal Server Error (Code)
    hotwingsKFC (Dutch translation)

    PocetTool is open source?!? Yes, get the source here:
    https://github.com/j...sman/PocketTool
    Download it here:
    https://github.com/j...tTool/downloads
    Posted in: MCPE: Mods / Tools
  • 2

    posted a message on Updater for Android PTPatches
    I havent experimented with modding in some time: Please help me test my PTPatchUpdater mod!

    Just run the JAR!

    No spoilers!

    Download:
    https://dl.dropboxusercontent.com/u/75899548/PTPatchUpdater/ptpatchupdater-gui-test.jar
    Posted in: MCPE: Mods / Tools
  • 1

    posted a message on WE WANT REAL MODS!
    Quote from Jocopa3

    Unless Apple/Android magically allow us to reverse engineer apps...

    It is not really either of their faults and neither of them are really in the way. It would be less of an issue if there was actually the technology available to "decompile" machine code. Most decompilers that exist are usually for Intel (there are some ARM decompilers, I think, somewhere), but they aren't advanced enough to get usable (I use "usable" loosely here; some decompilers will spit out garbage) C/C++ code IDA has an ARM decompiler but its not cheap. The best we could do is disassemble it. If we could cleanup the assembly dumps using some sort of tool, we might be able to re-assemble some *maybe* working code. Of course, we can't re-distribute the code as that would violate the license.
    Posted in: MCPE: Mods / Tools
  • 6

    posted a message on [WIP]TauInvEditor
    Hello everyone,
    I've been working on an inventory editor for iOS devices. This is for Jailbroken devices only.
    This release is a test build for NBT reading capabilities.

    EDIT:
    Please use this temporary repo:
    http://cydia.myrepospace.com/huelsmanj/


    Version Changes:

    0.1-3
    *Now can traverse the entire NBT tree of a level.
    0.1-2
    *Main screen automatically reloads list of worlds when returning to app.

    Screenshot:



    This is a limited test build. It will read your world files and dump the NBT info to a viewable list. Nothing else. It is useful for viewing world seeds at the moment. Editing features will be released <this page left intentionally blank>.

    To uninstall, please use Cydia!
    Posted in: MCPE: Mods / Tools
  • 3

    posted a message on TauEditor - A general purpose NBT tool
    Hello,

    Some recent projects of mine prompted me to start building an NBT editor. Some of the current editors are: old, are not cross-platform, do not support 19133, are not simple enough, or only support one version of Minecraft. I began writing TauEditor as a general purpose NBT editor. It supports not only Minecraft NBT files, but also Minecraft Pocket Edition and Minecraft Pi edition NBT files.

    Right now, it is only useful for viewing the structure of NBT trees as the editing code is not implemented yet.

    Features:
    0.0.1a:
    - On Mac systems, it uses the top Menu/Navigation bar rather than an in-window menu bar.
    - Can read Desktop, Pocket, or Pi edition NBT files, even if they're GZipped.
    0.0.2a:
    - Export NBT tree to XML file
    - Save an NBT tree as Desktop or Pocket/Pi edition file.
    0.0.3a:
    - Import XML file into NBT tree.
    0.0.4a:
    - Formats XML export with new lines and indentations (currently set to 2 spaces).
    0.0.4b:
    - Recognizes .schematic as an NBT file.

    TODO:
    - Saving code (mostly implemented)
    - Creating new NBT files
    - Custom Node/Leaf icons for each NBT tag
    - Editing a Tag
    - Adding Tags
    - Duplicate a NBT tree or node
    - Cut, Copy, and Paste (?)
    - Search, regex
    - Other NBT file types/extensions
    - Preferences

    Screenshots:




    Download Version 0.0.4b:
    http://adf.ly/JF7m9
    Posted in: Minecraft Tools
  • 3

    posted a message on snow's tools.
    TauEditor:
    This is a simple tool to edit Minecraft Pi edition levels. As of right now (0.0.1) it only reads the first world created by MCPi 0.1.1 alpha. It will dump some useful data (including the seed) to a window. As I learn more about developing with GTK 2.0, I will update it to view any of the levels the user has created as well as edit the data to the user's liking (like changing the game mode). In the download is the compiled binary as well as an icon. They should remain in the same folder as the editor uses this icon for its window icon. You can execute in the terminal if you wish but you can just execute it as a standalone app. I will update this post as updates are released.

    Download:
    http://adf.ly/J4Psm

    patchtool:
    Recently, 500 Internal Server Error posted several mods to the game client. These mods are in the PTPatch format. Previously, a Pi user needed access to a JavaVM in order to patch these mods as patchtool was written in Java, but no more! Today, I am happy to release an experimental C++ build of patchtool built from the ground up. This version runs natively on the Pi, so just download the mods you want to use then use the tool to patch them to the game.


    Usage:
    patchtool patch_file old_file new_file

    patch_file is the file name of the desired patch.
    old_file is the unmodified Minecraft Pi game.
    new_file is the desired file name of the patched game.

    I have tested and built the tool on my own RaspberryPi. It seems to function fine. If a mod doesnt seem to work when using a patch, but works when hex edited by hand, please inform me.

    Download the zip file below, unzip it. You should get an executable named 'patchtool-pi.'
    Place 'patchtool-pi' into your mcpi folder along with any of your patches.
    Run patchtool from LXTerminal:
    ./patchtool-pi modnamehere.mod minecraft-pi patched_minecraft-pi

    Run the patched game:
    ./patched_minecraft-pi

    Happy Patching!


    EDIT:The previous download had a bug where it was patching in incorrect places. This new download corrects the issue.
    Downloads:
    http://adf.ly/Ixcfm
    Posted in: Minecraft: Pi Edition
  • 1

    posted a message on Simple Flatmap Script
    Hello,

    Minecraft Pi currently does not have an option to create flat maps (or any world options for that matter), so I created this simple script to create a flat world made of a single type of block.

    Usage:
    python flatmap.py [blockid]


    This will erase every block in the current world! Be careful!
    It also takes a long time for Minecraft Pi to execute (approximately 2~3 minutes), so please be patient.
    blockid is an optional parameter. Use a block's id here to use that specific block for the flat generation. If no block id is specified, sandstone is used, by default. Block id's range from 0-108.

    Also, if I happen to write anymore scripts, I will post them here and change the thread title accordingly.

    The code:

    import sys
    import mcpi.minecraft as minecraft
    import mcpi.block as block
    
    mc = minecraft.Minecraft.create()
    mc.setBlocks(-128,0,-128,128,64,128,0)
    if(len(sys.argv) > 1):
    bid = int(sys.argv[1])
    else:
    bid = block.SANDSTONE.id
    
    if bid < 0 or bid > 108:
    bid = block.SANDSTONE.id
    
    mc.setBlocks(-128,0,-128,128,-64,128,bid)


    Download:
    http://dl.dropbox.co...ipts/flatmap.py
    Posted in: Minecraft: Pi Edition
  • 1

    posted a message on [Android] PocketTool
    Hello,
    After some testing, I successfully got PocketTool to run in an emulator on Jellybean (4.1).
    If anyone has experienced "error -24" or "parse error" please try out this test release. This test only uses internal storage, not sdcard! Beware!
    Please post back with test results and device info as follows:
    Device:
    Android Version:
    SDCARD (Real, Emulated, None):
    Success (Yes, No):
    Error(s):
    Comments:


    Download PocketTool 1.6 Nexus Experiment Test:
    http://dl.dropbox.co...xperimental.apk


    Sources indicate that this also causes error -24 :\
    Posted in: MCPE: Mods / Tools
  • 5

    posted a message on Mod Patching
    Hello everyone,

    PocketTool was released on Google Play a few moments ago. The new update includes mod patching. This post is a documentation for modders to create patches to the game that are compatible with PocketTool.


    PocketTool (PT) uses a custom file format for patches (PTPatch). The PTPatch format is a binary patching format to modify game files with as little amount of data as possible.

    NEW: patchtool now can create patches
    based on the differences of two binary files. Both files, however,
    must be the same exact length in bytes. Creates patch.mod by default.
    Usage: java -jar patchtool.jar diff old.so new.so


    Specification:

    PT now uses a new version of the PTPatch format. The difference being that now two or more patches can now be combined into one patch. The maximum number of patches that can be combined is 255. This is useful as it allows Modders to now edit multiple functions of MC PE with only one patch. I have created a tool to combine patches to the new format: patchtool.jar
    Usage:
    java -jar patchtool.jar -cl patch1.mod patch2.mod patch3.mod


    Currently, only "legacy" patches can be combined. The default output of patch tool is "patch.mod," this will be changed in an update. Running patchtool on a single file will update it to the new format. Patches are combine in the order that they are listed on the command line.

    New PTPatch format:

    The new format shares the same first 5 bytes as the legacy format. The first 4 being the magic number. the 5th being the the current version code of MC PE. The 6th byte is the number of patches within the patch file. Following the first 6 bytes is an int[] of indices. These indices point to the locations within the patch file to where the patches start. The patch data is the same for every patch in the file, there's a four-byte address then the instructions following. To get a good understanding of how this works, I suggest using patch tool to combine the patch from the Legacy section of this post with another patch (perhaps 500 ISE's ambient occlusion mod? http://www.minecraft...et-edition-mod/) and open the all three patches in a hex editor to compare their differences.

    Old PTPatch format:

    Download example patch here (MC PE 0.3.0 alpha):
    patch.mod

    To try this out, place "patch.mod" on the root of your sdcard ("/sdcard/patch.mod") and open the newest version of PocketTool. Click "Patch Mod". Click "Patch". When you see PocketTool say "Done patching", hit Menu &--#62; Apply Changes. Comfirm uninstall. Comfirm install. Open Minecraft PE and you should have 9 item slots instead of 3 (+1 for the inventory button).

    Here's a look at the hex representation of a patch that changes the number of inventory slots to 9:
    FF 50 54 50 BF 00 09 B1 EC 09 20 00 BF


    The first 9 bytes is the header. This contains a 4 byte magic number (to verify that its a PTPatch file), a 1 byte minecraft versionCode, and a 4 byte address. The magic number
    FF 50 54 50
    should be the 4 first bytes. The versionCode
    E9
    can be found as the second byte of the settings.bin in your PocketTool folder. The next 4 bytes is the address that you wish to make changes to. The address in this example points to the getNumSlots() function in the full version of Minecraft PE 0.2.2.

    The rest of the file (can be as large as you need it) is the little edian instructions that you would normally hex into your libminecraftpe.so. In this example the instructions are :
    movs r0, #9
    nop


    patchtool source: https://github.com/S...nd/PTPatchTools
    Posted in: MCPE: Discussion
  • To post a comment, please .