ptitSeb / box64

Box64 - Linux Userspace x86_64 Emulator with a twist, targeted at ARM64 Linux devices
https://box86.org
MIT License
3.74k stars 267 forks source link

Failed to load Zydis function ZydisDecoderDecodeBuffer on M1 #1893

Open m1m1k4tz opened 1 day ago

m1m1k4tz commented 1 day ago
📦[alex@asahi-krun ~]$ BOX64_TRACE_INIT=1 box64 ~/box64/tests/bash
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 USCAT FLAGM FLAGM2 FRINT PageSize:16384 Running on Icestorm-M1 Firestorm-M1 with 8 Cores
Will use Hardware counter measured at 24.0 MHz emulating 3.0 GHz
Params database has 90 entries
Box64 with trace with Dynarec v0.3.1 c43d34d0 built on Oct  2 2024 08:37:09
BOX64: Detected 48bits at least of address space
Initializing Zydis lib
Fail to load Zydis function ZydisDecoderDecodeBuffer
Zydis init failed. No x86 trace activated
Counted 91 Env var
BOX64 LIB PATH: BOX64 BIN PATH: ./:bin/:/home/alex/.cargo/bin/:/home/alex/.local/bin/:/home/alex/bin/:/usr/lib64/ccache/:/usr/local/bin/:/usr/bin/:/bin/:/usr/local/sbin/:/usr/sbin/:/sbin/:/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/usr/bin/:/sbin/:/bin/
Looking for /home/alex/box64/tests/bash
bash detected, disabling banner
Apply RC params for bash
ptitSeb commented 1 day ago

Have you build libZydis? Also, be aware box64 needs an older version of libZydis for now, please read the COMPILE.md about it.

m1m1k4tz commented 1 day ago

I compiled the shared build for 3.2.1 and placed it in ~/.local/bin but box64 wont recognize it for some reason

ptitSeb commented 21 hours ago

this folder ~/local/bin in not checked when looking for libs by the OS. You should use a regular folder or alter LD_LIBRARY_PATH / ldconfig...

m1m1k4tz commented 21 hours ago

I tried the env variable but it didn’t work I guess I’ll try copying it into the libs folder

m1m1k4tz commented 1 hour ago

ldconfig -p shows it but box64 can’t load it for some reason

m1m1k4tz commented 1 hour ago

Also I’m compiling with box32 enabled

m1m1k4tz commented 1 hour ago

Oh, and I’m using distrobox like the krun fex guide says so that might have something to do with it but I’m not really sure

ptitSeb commented 37 minutes ago

Box32 doesn't change anything here. Box64 is just doing some regular dlopen() to find the lib. Maybe there is some containerisation that came into play here and make the libZydis.so lib not accessible to box64?