Ninecraft icon indicating copy to clipboard operation
Ninecraft copied to clipboard

Add libhoudini support for running ARM MCPE APKs on x86 systems

Open ghost opened this issue 7 months ago • 4 comments

ARM MCPE Support on x86 via libhoudini

Currently when Ninecraft attempts to run ARM MCPE versions (containing lib/armeabi-v7a/libminecraftpe.so) on x86 hardware, they crash immediately due to missing ARM instruction translation.

Android-x86 addresses this through libhoudini. For Ninecraft, houdini v6 would likely be the best choice because:

  • Target MCPE versions (0.1.0-0.10.5) originally ran on Android 4.0-5.0
  • Houdini v6 was built for Android 6.0 and should handle older ARM binaries better than newer versions

Required files:

Libhoudini is used in Android-x86 like this:

  1. Place correct houdini.sfs in /data/arm/
  2. Run enable script: enable_houdini This script registers Houdini for arm binaries via below:
    echo ':arm:M::\x7f\x45\x4c\x46...::/system/bin/houdini:' > /proc/sys/fs/binfmt_misc/register
    
    

Ninecraft's existing architecture support would need enhancement to:

Detect ARM binaries on x86 systems

Initialize libhoudini translation

Route execution through the translator

While I'm familiar with C/C++, I haven't been able to figure out exactly where and how to implement this in Ninecraft's codebase. To my knowledge, architecture detection and binary loading systems would need to be modified to support this translation layer.

ghost avatar May 18 '25 17:05 ghost

I'm pretty sure libhoudini is a full-user mode emulator. At best, it would only work on Linux. Anyway, it's closed-source, and I don't think it can be easily integrated with existing software. Not to mention, it's compiled with bionic instead of glibc, so running it would be a pain.

I'm not saying using libhoudini is impossible, but it would definitely be the worst option, IMO.

You'd be better off using standard QEMU user-mode.

TheBrokenRail avatar May 18 '25 18:05 TheBrokenRail

I'm pretty sure libhoudini is a full-user mode emulator. At best, it would only work on Linux. Anyway, it's closed-source, and I don't think it can be easily integrated with existing software. Not to mention, it's compiled with bionic instead of glibc, so running it would be a pain.

I'm not saying using libhoudini is impossible, but it would definitely be the worst option, IMO.

You'd be better off using standard QEMU user-mode.

Yeah you're right about libhoudini. Being closed source and built for bionic makes it basically unusable here. It's not worth trying to integrate into Ninecraft.

Unicorn Engine could work as a solution that is separate from translation. For actual instruction translation Capstone might help but QEMU user mode seems like the most practical way forward.

Libhoudini would just create too many problems to be useful for this project.

ghost avatar May 18 '25 22:05 ghost

I've actually tried writing translation but I didn't actual get it working as there's a lot of instructions to translate. Maybe doing it manually could work but I doubt that it'd actually work with Ninecraft if I do that.

ghost avatar May 18 '25 22:05 ghost

I've actually tried writing translation but I didn't actual get it working as there's a lot of instructions to translate. Maybe doing it manually could work but I doubt that it'd actually work with Ninecraft if I do that.

Youd have to also deal with making ancmp work with the translation layer as well

MFDGaming avatar May 19 '25 11:05 MFDGaming