단순 바이너리 덩어리를 AT&T 스타일로 디어셈블하려고 하려면 어떻게 해야 하나요?
글쓴이: vudghkzm / 작성시간: 목, 2010/09/02 - 6:27오후
단순 바이너리 덩어리가 있습니다. 쉽게 말하면, object 파일 또는 실행 파일의 code 영역만을 담고 있는 파일이라고 생각하시면 됩니다.
이 파일을 AT&T 스타일의 어셈블리 코드로 변환하고 싶습니다.
그래서 binutils의 objdump 명령을 사용하려고 시도해보았습니다만, objdump는 이미 정해진 포맷의 object 파일이 아니면 disassemble을 못하더라구요. "File format not recognized"라는 에러가 뜨면서요.
nasm의 ndisasm 커맨드는 위와 같은 단순 바이너리 코드 덩어리를 단순히 linear traverse하면서 disassemble해주는데, 아쉽게도 Intel 스타일로 변환해주더라구요.
이럴땐 어떻게 하면 되나요?
Forums:
objdump -b binary -m i386 -D a.bin
objdump -b binary -m i386 -D a.bin
답변
답변 감사드립니다.
근데 한 가지 더 궁금한게 있습니다.
-b 옵션이 bfdname을 지정하는 것인데,
objdump에서 사용가능한 bfdname에는 어떤 것들이 있는지 알고 싶습니다. man 페이지에선 알 수가 없더라구요.
man 페이지에 나옵니다.
-b bfdname
--target=bfdname
Specify that the object-code format for the object files is bfd-
name. This option may not be necessary; objdump can automatically
recognize many formats.
For example,
objdump -b oasys -m vax -h fu.o
displays summary information from the section headers (-h) of fu.o,
which is explicitly identified (-m) as a VAX object file in the
format produced by Oasys compilers. You can list the formats
available with the -i option.
맨 밑에 보이시죠
You can list the formats
available with the -i option.
objdump -i 해 보시죠
지원 가능한 목록이 나옵니다.
아래 링크는 한글 맨페이지 입니다.
http://man.kldp.net/wiki/ManPage/objdump.1
---------------------------------------------
git init
git add .
git commit -am "project init"
---------------------------------------------
---------------------------------------------
git init
git add .
git commit -am "project init"
---------------------------------------------
감사합니다.
감사합니다.
댓글 달기