ToDo:
¥á¥â¥ê¤Î¤É¤Ã¤«¤Ë´Ø¿ô¥¢¥É¥ì¥¹ÃÖ¤¤¤Æ¡¢ ´ÖÀÜ call ¤Ç¤Ô¤ç¡¼¤ó¤ÈÈô¤Ù¤ë¤Ï¤º¡£ ¤Ç¤â¤½¤ì¤À¤È opcode ¼«Âνñ¤´¹¤¨¤Æ¤Æ¤¤¤«¤Ë¤â¥¢¥ì¤Ê¤Î¤Ç¡¢ call => jmp => ¤Ã¤Æ¥¹¥È¡¼¥ê¡¼¤¬ÌµÆñ¤«¤Ê¤¡¡£
(02:45)
¤É¤¦¤Ç¤â¤¤¤¤¤±¤É gcc -S ¤è¤ê objdump -Sr ¤ÎÊý¤¬¹¥¤¤Ê¤ó¤À¤è¤Ê¤¡¡£
0000000000000000 <main>: #include <stdio.h> int main() { 0: 55 push %rbp 1: 48 89 e5 mov %rsp,%rbp return (int)stdout; 4: 48 8b 05 00 00 00 00 mov 0(%rip),%rax # b <main+0xb> 7: R_X86_64_PC32 stdout+0xfffffffffffffffc } b: c9 leaveq c: c3 retq
¤³¤ì¤¬
0000000000400498 <main>: #include <stdio.h> int main() { 400498: 55 push %rbp 400499: 48 89 e5 mov %rsp,%rbp return (int)stdout; 40049c: 48 8b 05 ad 03 10 00 mov 1049517(%rip),%rax # 50085 0 <__bss_start> } 4004a3: c9 leaveq 4004a4: c3 retq
¤³¤¦¤Ê¤Ã¤Æ¤¿
(11:33)
¿§¡¹¶¦´¶¤È¤«Ç¼ÆÀ¤È¤«¤·¤ÆÌÌÇò¤¤¡£
http://otsubo.info/contents/ewords/eword.html
¥Þ¥¯¥É¥Ê¥ë¥É¤Ï¤½¤ì°ÊÁ°¤Ë ¥Þ¥Ã¥¯¥É¡¼¥Ê¥ë¤È¤«¤Ë¤Ê¤Ã¤Æ¤Æʹ¤¼è¤ì¤Ê¤«¤Ã¤¿¡£ For here or to go? ¤È¤«Ê¹¤«¤ì¤¿¤é ¤¿¤Ö¤ó¤½¤Î¤Þ¤Þ¥ª¥¦¥àÊÖ¤·¤Ë¤·¤Æ¡¢ Áê¼ê¤¬Ê̤θÀÍդǸÀ¤¤¤Ê¤ª¤¹¤Î¤òÂԤĤʡ¢¤¿¤Ö¤ó¡£
Sorry? ¤È¤« Pardon? ¤Ïʹ¤¼è¤ì¤Æ¤Ê¤¤»þ¤Ë»È¤Ã¤Æ¡¢ ¥ª¥¦¥àÊÖ¤·¤Ïʹ¤¼è¤ì¤¿¤±¤É°ÕÌ£¤¬¼è¤ì¤Æ¤Ê¤¤»þ¤Ë»È¤¦¥¯¥»¤¬¤Ä¤¤¤Æ¤ë¤±¤É¡¢ ¤Þ¤¡Îɤ¤½èÀ¤½Ñ¤Êµ¤¤¬¤¹¤ë¡£ ¥ª¥¦¥àÊÖ¤·¤Ë¤·¤Æ¤ª¤±¤Ð¡¢ ¡Öʹ¤¼è¤ê¤Ï¤Ç¤¤¿¤±¤É¡¢°ÕÌ£¤¬¼è¤ì¤Ê¤¤¡×¤Ã¤ÆÅÁ¤ï¤ë¤À¤í¤¦¤·¡£
(11:50)
#define _GNU_SOURCE #include <math.h> #include <dlfcn.h> int main() { double (*c)(double) = dlsym(RTLD_DEFAULT, "cos"); printf("%p\n", c); // return (int)cos; }
¤ÏºÇ¸å¤Î¥³¥á¥ó¥È¤¬¤¢¤ë¤«Ìµ¤¤¤«¤Ç¡¢ ½ÐÎϤµ¤ì¤ë¥¢¥É¥ì¥¹¤¬Á´Á³°ã¤¦¡£ Íפ¹¤ë¤Ë PLT ¤¬ºî¤é¤ì¤ë¤«ºî¤é¤ì¤Ê¤¤¤«¡¢¤È¤¤¤¦¤³¤È¤À¤±¤É¡£
º¤¤ë¤Î¤Ï amd64 ¤À¤È¡¢ PLT ¤¬Ìµ¤¤»þ¤Ë near call ¤Ç¤ÏÆϤ«¤Ê¤¤¥¢¥É¥ì¥¹¤Ë¤Ê¤Ã¤Á¤ã¤¦¡¢¤Ã¤Æ¤³¤È¡£
¤¢¤È¡¢´Ø¿ô¤¸¤ã¤Ê¤¯¤Æ¡¢ stdout ¤ß¤¿¤¤¤Ê¤â¤Î¤ò Ʊ¤¸¤è¤¦¤Ë¤ä¤Ã¤Æ¤ä¤ë¤È¡¢ .bss ¤Ë¤Ê¤ó¤«Ãͤ¬ÃÖ¤«¤ì¤ë¤ß¤¿¤¤¤Ê¤ó¤À¤±¤É¡¢ ¤¨¡¼¤È¤³¤ì¤É¤¦¤ä¤Ã¤Æ¤ä¤Ã¤Æ¤ë¤Î¤«¤è¤¯¤ï¤«¤é¤ó¤Ê¤¡¡Ä
(13:05)
(14:32)
extension Æþ¤ì¤¿¢ª firefox ¤µ¤¤¤¤É¤¦ ¢ª extension ¤ÏºÆµ¯Æ°¤·¤¿¤é͸ú¤Ë¤Ê¤ê¤Þ¤¹¡£
¤Ê¤ó¤Ç¤ä¤Í¤ó¡£
(14:44)
http://alohakun.blog7.fc2.com/blog-entry-412.html
int sum() { int *f = (int*)__builtin_frame_address(0) + 2; int s = 0; while (abs(*f) < 0x1000000) { s += *f; f++; } return s; } int main() { printf("1+...+1 = %d\n", sum(1)); printf("1+...+2 = %d\n", sum(1,2)); printf("1+...+3 = %d\n", sum(1,2,3)); printf("1+...+4 = %d\n", sum(1,2,3,4)); printf("1+...+5 = %d\n", sum(1,2,3,4,5)); printf("1+...+6 = %d\n", sum(1,2,3,4,5,6)); printf("1+...+7 = %d\n", sum(1,2,3,4,5,6,7)); printf("1+...+8 = %d\n", sum(1,2,3,4,5,6,7,8)); printf("1+...+9 = %d\n", sum(1,2,3,4,5,6,7,8,9)); }
¤Þ¤¡ÌµÍý¡£ºÇŬ²½¤Ã¤Æ¤Ê¤ó¤Ç¤¹¤«¡£
(15:51)
¤¯¤é¤¤¤ò²¾Äê¤Ç¤¤ë¤È¡Ä¤Ã¤ÆÏä«¡£
(15:57)
¤¦¡¼¤ó¤ê¤Ê¤¤¡£ ¤³¤ì¤Ç¤Ï w3m ¤Ë¤Þ¤À¾¡¤Æ¤Ê¤¤¡£
¤Ä¡¼¤ï¤±¤Ç¡£
(16:51)
¤Ê¤ó¤È¤Ê¤¯½ñ¤¯¡£ 3ǯ¤â¤·¤ÆÆɤá¤ÐÌÌÇò¤«¤í¤¦¡£
(21:33)
¤Ü¤¯¤Î¥×¥í¥ó¥×¥È¤Ë i@u ¤È¤«½ñ¤¤¤Æ¤¢¤ë¤Î¤Ï ¤½¤¦¤¤¤¦¤â¤Î¤ÈǼÆÀ¤·¤Æ²¼¤µ¤¤¤È¤¤¤¦¤«¡£
(21:34)
²áµî¤Î¥Þ¥·¥ó¤Ï u2 ¤«¤é½ç¤Ë¿ô»ú¤ò¼è¤Ã¤Æ¤¤¤¯¤é¤·¤¤¤±¤É ¤½¤Î¥ë¡¼¥ë¤ÏÁ´Á³¼ÂÁ©¤µ¤ì¤Æ¤¤¤Ê¤¤¤È¤¤¤¦¤«¤½¤Î¾ì¤Îµ¤Ê¬¡£
u2 ¤Ï̵°õ Pen 133MHz, 64MB, 6GB ¤È¤«¤Î¤¹¤Ð¤é¤·¤¤¥Þ¥·¥ó¡£ ¤³¤ì¤Ç sdmkun ¤È¤«ºî¤Ã¤¿¤È¤«¤Ê¤ó¤È¤«¡£ º£¤È¤Ê¤Ã¤Æ¤Ï¤¢¤ê¤¨¤ó¡£
¤¢¤È uw ¤È¤« u2 ¤È¤«Ì¾Á°ÊѤï¤Ã¤¿¤ê¤·¤Æ¤¿¤±¤É ºàÎÁ½¦¤Ã¤Æ¤¤¿¥Ç¥¹¥¯¥È¥Ã¥×¤¬¡£ Athlon 750MHz => Athlon 700MHz => PenII 600Mhz ¤Ê¤É¤È ¥Ð¡¼¥¸¥ç¥ó¥À¥¦¥ó¤·¤Æ¤¤¤Ã¤¿¤Î¤Ïµ²±¤Ë¿·¤·¤¤¤¬ ¤Ê¤ó¤È¤¤¤¦¤«Íýͳ¤Ï CPU ½³¤Ã¤¿¤È¤«¤Û¤³¤ê¤¬¤Ä¤â¤Ã¤¿¤È¤«¤Ç ¤Ä¤Þ¤ê´ù¤Î²¼¤Î°Ø»Ò¤Î²¼¤È¤¤¤¦¤« ¸µ¤ËÍç¤ÇÃÖ¤«¤ì¤Æ¤¤¤¿ÉÔ¶ø¤Î¥Þ¥·¥ó¤È¤¤¤¦¤«¡£
say¤µ¤ó¤Ë¤â¤Î¤â¤é¤Ã¤Æ uw ¤È¤« u2 ¤È¤«Ì¾Á°ÊѤï¤Ã¤Æ¤¿¥ä¥Ä¤Ï ¤¹¤Ð¤é¤·¤¤¿Ê²½¤ò¿ë¤²¤¿¤ê¤·¤Ä¤Ä¡¢ ¤Þ¤¡²¶¤Ï¥Ç¥¹¥¯¥È¥Ã¥×¤òÈó¾ï¤Ë»¨¤Ë°·¤¦¤È¤¤¤¦¤³¤È¤¬ ¤è¤¯¶µ¤¨¤Æ¤¯¤ì¤¿¥Þ¥·¥ó¤À¤Ã¤¿¡£
(22:06)
http://d.hatena.ne.jp/ytqwerty/20060817#p1
³ÈÂ礹¤ì¤Ð¤³¤ì¤ò¤Ê¤ó¤È¤Ê¤¯²òÆɤǤ¤ë¿Í´Ö¤ÎǾ¤Ï¤¹¤Ð¤é¤·¤¤µ¤¤¬
(22:22)
Á° | 2006ǯ 8·î |
¼¡ | ||||
Æü | ·î | ²Ð | ¿å | ÌÚ | ¶â | ÅÚ |
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Á´¤Æ¥ê¥ó¥¯¥Õ¥ê¡¼¤Ç¤¹¡£ ¥³¡¼¥ÉÊҤϼ«Í³¤Ë»ÈÍѤ·¤Æ¤¤¤¿¤À¤¤¤Æ¹½¤¤¤Þ¤»¤ó¡£ ¤½¤Î¾¤Î¤â¤Î¤ÏGPL°·¤¤¤Ç¤¢¤ì¤Ð¤¢¤é¤æ¤ë»ÈÍѤ˴ؤ·¤Æʸ¶ç¤Ï¸À¤¤¤Þ¤»¤ó¡£ ¤Ê¤Ë¤«¤¢¤ì¤Ð²¼µ¥á¡¼¥ë¥¢¥É¥ì¥¹¤Ø¡£