columbia / egalito

Self-hosting binary instrumentation framework for security research
GNU General Public License v3.0
209 stars 37 forks source link

Unable to recompile aarch64 binaries #32

Open cyanpencil opened 3 years ago

cyanpencil commented 3 years ago

OS: Ubuntu 18.04 (docker) Host arch: x86_64

I am unable to recompile the binary /bin/ls (from Ubuntu18.04 ARM64), here's the command I used:

./etharden -m /mnt/aarch64/ls /tmp/hello

Here's the error I get:

Parsing ELF file...
etharden: analysis/usedef.cpp:1949: void UseDef::fillMovabs(UDState*, AssemblyPtr): Assertion `mode == AssemblyOperands::MODE_IMM_REG' failed.
Aborted (core dumped)

is there a special flag I should provide to support cross-recompilation?

Also: I tried to build egalito directly on ubuntu18.04 ARM64 but compilation fails because of a makefile error while building capstone:

make -C dep
make[1]: Entering directory '/home/luca/egalito/dep'
make -C rtld
make[2]: Entering directory '/home/luca/egalito/dep/rtld'
make[2]: Leaving directory '/home/luca/egalito/dep/rtld'
make -C ifunc
make[2]: Entering directory '/home/luca/egalito/dep/ifunc'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/luca/egalito/dep/ifunc'
Makefile:43: recipe for target 'capstone' failed
make[1]: *** [capstone] Error 1
make[1]: Leaving directory '/home/luca/egalito/dep'
Makefile:30: recipe for target 'dep/built' failed
make: *** [dep/built] Error 2
cyanpencil commented 3 years ago

Here's the binary, if you need to test it yourself ls.zip

xiaoyong-z commented 3 years ago

Hi, i also have the same problem, did you solve it ?

Yiruma96 commented 2 months ago

Hi, i also have the same problem, did you solve it ?

看起来18年后随着egalito前端feature的不断更新,这些feature大部分都是针对x64设计的,导致编译arm64版本时各种报错。可以在commit里面找下Fix AArch64的版本,手动改几个地方还是可以编译通过的。