본문 바로가기

Echo

run and compile 32bit apps on 64bit ubuntu

<install>
$ cat /etc/issue

Ubuntu 14.04.3 LTS \n \l

sudo dpkg --add-architecture i386

sudo apt-get update

sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386

sudo apt-get install gcc-multilib


<test> 

ksg@ubuntu:~/test$ uname -a

Linux ubuntu 3.19.0-25-generic #26~14.04.1-Ubuntu SMP Fri Jul 24 21:16:20 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

ksg@ubuntu:~/test$ gcc -m32 -o test test.c

ksg@ubuntu:~/test$ file test

test: ELF 32-bit LSB  executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=8c9e101b1711ffbb957adc92902b9a5d04ae869a, not stripped

ksg@ubuntu:~/test$ ./test

it is 32bit operating system!

'Echo' 카테고리의 다른 글

맥 SSH 터미널 재실행  (0) 2015.11.26
소스에서 특정 문자열 찾기  (0) 2015.10.30
pwntools 설치  (0) 2015.09.24
IDA 원격 디버깅 (Attach, Run)  (0) 2015.09.24