2011-07-01から1ヶ月間の記事一覧

Chap ELF

readelf -h elf header readelf -l program header 小文字のエル readelf -S section header readelf -x sectionの中身(番号で指定) - section header情報取得 size -A hello.o objdump -h hello.o - section 情報取得 objdump -j -s hello.o ex) .text .da…

ChaptAddendum

以下はIPAのセキュアプログラミング講座からのパクリです。 肝はstack_dump()のところねなにをやっているかといえば、hexdump -C と似たようなことをやってますね。 [hirasawa@ubunt1004-32-2 ~]$ cat stack_dump.c #include <stdio.h> #include <stdlib.h> #include <string.h> #define F</string.h></stdlib.h></stdio.h>…

Chap8

when will be this happen??

Chap7 dynamic link

libxxxx.so ... shared object$nm libxx.so ... no symbol show instead readelf -s /lib/libxxx.so .. this shows symbol informaiongcc -l option ... -lc for libc.so and -lm for libm.socrt1.o , crti.o , crtn.o (/usr/lib/crt1.o,crtio,crtn.o ..) hi…

Chap6 static link

xxx.o ... relocatable, not executable. (diff is "program header") executables has "program header", on the other hand relocatable not. readelf -l /bin/pwd .. to see "program header" /usr/bin/ld nm hello.o (to find "symbol informaion" insid…

Chapt5 Assemble

/usr/bin/as as -v as hello_byhand.s ... output file is a.out as -o hello.o hello_byhand.s gcc -save-temps -c -v hello.c ... output file hello.o objdump -d hello.o ... for reverse-assy objdump -j .rodata -s hello.o ... choose section ".roda…

Chap4 compile

adding this while staying Okinawa, hehegcc -save-temps -S -v hello.c cpp hello.c > hello_byhand.i ( I think this format valid only after gcc ver4)`gcc -print-prog-name=CC1` -o hello_byhand.s hello.i

Chap3 pre-proocess

.... pre process (cc1, pcc) `gcc -print-prog-name=cc1` -E -H -quiet hello_define.c > /dev/null so as to observe include info cc1 -quiet cc1 -E .. exec pre-processing (re-direct to stdout) cc1 -H .. show more detail include info (re-direct …

Chap2 build using gcc

gcc -save-temps -v ... good for debuggingchecking behavior using -v options, - Configured with: ... display configuration option - preprocess ... CC1 -E (gcc -E hello.c > hello.i) - compile ... CC1 (gcc -S hello.c) - assemble ... as (gcc -…

Chap1

/etc/profile ~/.bash_profile ~/.bash_login ~/.profile ld -v gcc -v gcc -dumpversiontrue ;echo $? return 0 false ; echo $? return 1(return code is unsigned char)ls -l ls -F ( I have not used this ever)

GNU development tools -- memo

Here is my reminder,picking up something from "GNU development tool"(author Wataru Nishida).

hello from shell (shellからご挨拶)

case $(((`date +%H`+14)%24/10)) in 0) echo "こんにちは";; 1)echo "こんばんは" ;; 2) echo "おはようございます";; esac

プログラム全般チュートリアル

全般的に網羅してるみたい。http://www.geocities.jp/ky_webid/

kismet on ubuntu 10.04 (acer aspire one) メモ

忘れるまえにメモっとく root@acer-aspire:~# dpkg -l | grep kismet ii kismet 2008-05-R1-4.1 Wireless 802.11b monitoring tool root@acer-aspire:~# dpkg -L kismet /. /etc /etc/kismet /etc/kismet/ap_manuf /etc/kismet/client_manuf /etc/kismet/kis…