`
MauerSu
  • 浏览: 495190 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

Accessing a corrupted shared library

 
阅读更多
源:https://stackoverflow.com/questions/30419857/accessing-a-corrupted-shared-library
评:
As you've sort of realized, you're trying to compile assembly for a 32 bit machine, on a 64 bit machine. With the commands you copied and pasted, you're letting as and ld know that you're compiling something 32 bit.

The issue you've run into is that you don't have a 32 bit version of libc available to link against.

apt-get install libc6:i386 libc6-dev-i386

Then assemble the code with:

as --32 -o cpuid2.o cpuid2.s

and finally link it with:

ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o cpuid2 -lc cpuid2.o

Then it should work:

[jkominek@kyatt /tmp]$ ./cpuid2
The processor Vendor ID is 'GenuineIntel'
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics