ãBinary Hacks Rebootedâä½ã¬ã¤ã¤ã®ä¸çãæ¢æ¤ãããã¯ããã¯89é¸ãã«è¾¼ããæã
ã¯ããã«
2024å¹´8æ28æ¥ã«ãBinary Hacks Rebootedâä½ã¬ã¤ã¤ã®ä¸çãæ¢æ¤ãããã¯ããã¯89é¸ãã¨ããæ¬ã®è²©å£²ãéå§ããã¾ããã èè ã®ä¸äººã¨ãã¦ããã®æ¬ã®ç´¹ä»ããã¾ãã ãæã¡ã§ãªãæ¹ã¯ãAmazon ãã楽天ããè¿ãã®æ¸åºãªã©ã§è³¼å ¥ãå¯è½ã§ãã è³¼å ¥ãã¦ããã ããã¨å¤§å¤å¬ããã§ãã ã©ãããããããããããã¾ãã
ã©ã®ãããªæ¬ã
ãBinary Hacks Rebootedãã¯2006å¹´ã«çºå£²ããããBinary Hacksãã®åæ§ç¯çã§ãã åæ§ç¯çã¨èãã¨ãBinary Hacksãã¨ã©ããããç°ãªãã®ãæ°ã«ãªãã¨æãã¾ãããã»ã¼ãã¹ã¦ãç°ãªãã¾ãã 詳細ãªç®æ¬¡ã¯ãã¡ã ã§ç¢ºèªã§ãã¾ããããBinary Hacksããããã®ã¾ã¾å¼ãç¶ãã Hack ã¯ä¸ã¤ããªããå ¨ã¦ãæ°ãã Hack ã§ãã
ãBinary Hacks Rebootedãã¯ä½ã¬ã¤ã¤ããã°ã©ãã³ã°ã®æè¡ãå¹ åºãããã¤æ·±ã解説ããæ¸ç±ã§ãã ãä½ã¬ã¤ã¤ããã°ã©ãã³ã°ãã¨ããåèªã¯åºãæå³ãæã¡ã¾ããããã®æ¸ç±ã§ã¯ELF ãã©ã¼ãããã®è§£æãããã¡ã¼ã ã¦ã§ã¢ã®ä½æãæµ®åå°æ°ç¹ä¾å¤ã¾ã§å¹ åºãå 容ãæ±ã£ã¦ãã¾ãã ããã¦ãåãããã¯ã«ã¤ãã¦æ¥æ¬èªã¯ãã¡ãããè±èªã§ãé¡ä¼¼ãã解説ãå°ãªãã¨æãããå 容ãç´¹ä»ãã¦ãã¾ãã ã«ã¼ãã«ï¼VMæ¢æ¤é ã«åå ãããã¨ãããæ¹ã¯ããèªãã«ã¼ãã«ï¼VMæ¢æ¤éãã®ãããªæè¦ã§èªãã§ããã ãããã¨æãã¾ãã
ãã®æ¬ã«è¾¼ããæã
ç§éã¯ãã®æ¬ã2ã¤ã®ãã¨ãç®æ¨ã«æ¸ãã¦ãã¾ããã
1ã¤ç®ã¯ãä½ã¬ã¤ã¤ããã°ã©ãã³ã°ãé¢ç½ãã¨æãã¦ãããããã¨ã§ãã ç´°ãããã¨ã¯ããããªãã¦ãæ§ãã¾ããã ããã¼ãããªãã¨ã§ãããã ããããããã¨æã£ã¦ããããã°å¤§å¤å¬ããã§ãã ããªãã好ããªããã«ãæ¢æ¤ããã¦ã¿ã¦ãã ããã
ä½ã¬ã¤ã¤ããã°ã©ãã³ã°ã¯ä¸è¦ã¨ã£ã¤ãã«ããåéã§ãããä¸åº¦ã©ã®ããã«åãã¦ããã®ããç解ããã¨ãæ§ã ãªé¢ç½ããã¨ãã§ããããã«ãªãã¾ãã ä¾ãã°ãèªåã ãã®ãã¡ã¼ã ã¦ã§ã¢ãä½ã£ã¦Chromebook ãåãããã¨ãã§ãã¾ãããDWARF ã使ã£ã¦ååæ¼ç®ãè¡ããã¨ãã§ãã¾ãã ãã¤ãã©ããã§ç§ã¨ä¼ã£ãæã«ãHack ã®å 容ã§çãä¸ããããã¨ã楽ãã¿ã«ãã¦ãã¾ãã
2ã¤ç®ã¯ãä½ã¬ã¤ã¤ããã°ã©ãã³ã°ã§å°ã£ã¦ããæ¹ã®å©ãã«ãªãããã¨ã§ãã ä½ã¬ã¤ã¤ããã°ã©ãã³ã°ãå®éã«è¡ã£ã¦ã¿ãã¨ãä¸å¯è§£ãªãã°ã«å¤æ°ç´é¢ãã¾ãã ãã®ãã¡ã®å¤ãã¯ææ¡ãã¦ããªãä»æ§ãæåã«ãããã®ãå¤ãããã®ãããªãã°ã解決ããããã«ã¯å¹ åºãåéã®ç¥èãå¿ è¦ã§ãã ELF ããã¯ã®å¤ãã¯ç§ãéå»ã«å®éã«ç¥ãããã£ãç¥èãã¾ã¨ãããã®ãå¤ããåæ§ã®ãã°ã§å°ã£ã¦ããæ¹ã®å©ãã«ãªãã°ã¨æã£ã¦ãã¾ãã
Thread Local Storage (TLS) ã®è§£èª¬ã¯ãã®ä¸ä¾ã§ãã TLS ã¯é常ã«å¤ãã®ããã°ã©ã ã§äººç¥ãã使ããã¦ããæ©è½ã§ãããä½ã¬ã¤ã¤ããã°ã©ãã³ã°ãå®éã«è¡ã£ã¦ããã¨ãã®ä»çµã¿ãç解ããããã«è¿«ããããã¨ãããã¾ãã ã¨ããããTLS ã«ã¤ãã¦ã®è©³ç´°ãªè§£èª¬ã¯æ¥æ¬èªã§ãè±èªã§ããã¾ãè¦ããã¾ããã ã#10 TLSã®ããã¿ãç解ãã ãã¯èª°ããã3å¹´åã®éå»ã®èªåã«å½ã¦ã¦æ¸ãã Hack ã§ãã ãã®å 容ã3å¹´åã«ç¥ã£ã¦ãããä½ã¶æããããã°ã«æéãè²»ãããã¨ã¯ãªãã£ãã§ãããã
ç§ã¨åæ§ã«æå³ä¸æãªæåã«æ©ã¾ããã¦ããæ¹ããä¸ã®ä¸ã«ã¯ãã£ã¨ããããããã¯ãã§ãã
segmentation fault (core dumped)
ãè¦é£½ããã¨ãã«ããã®æ¬ãéãã¦ã¿ã¦ãã ããã
ã©ããªãµãã«èªãã§ã»ããã
ãã®æ¬ã¯æåã®ãã¼ã¸ããé çªã«èªãã§ããå¿ è¦ã¯ããã¾ããã ããã¤ãã®ç¶ããã®ã® Hack ãé¤ãã¦å Hack ã¯ç¬ç«ãã¦èªããããã«ãªã£ã¦ãã¾ããã ç®æ¬¡ãè¦ã¦é¢ç½ãããªã¨ãããèªãã§ã¿ããããµã¤ã³ããæ¯ã£ã¦åºãç®ã® Hack ãèªãã§ã¿ãããã¦ãã ããã ã©ããªæ¹ã§ããã©ãã©ã¨ããã£ã¦ãããã¡ã«æå¤ãªæ°ã¥ããããã¯ãã§ãã
ãµã³ãã«ã³ã¼ããå®éã«åããã¦è¦ã¦ããææ¸ããã£ããèªãã§ã¿ãã®ãè¯ãããããã¾ããã ãµã³ãã«ã³ã¼ãã¯https://github.com/oreilly-japan/binary-hacks-rebooted/ã«ããã¾ãã
ãããã«
ãã®æ¬ãæ¸ãããã«è¨å¤§ãªæéãè²»ãããå種ã®ä»æ§æ¸ãLinux ã glibc ã®ã½ã¼ã¹ã³ã¼ããä½åº¦ãèªã¿è¿ãã¾ããã èªä¿¡ãæã£ã¦é¢ç½ãæ¬ã ã¨è¨ãã¾ãã ãã®æ¬ãèªãã§ãä¸äººã§ããä½ã¬ã¤ã¤ããã°ã©ãã³ã°ãé¢ç½ããã¨æãã¦ããããæ¹ãããã°å¹¸ãã§ãã
æå¾ã«ããããããªãã2042å¹´ããã«ãã®ææ¸ãèªãã§ããããBinary Hacksãã®ååæ§ç¯çãåºãããã¨æã£ã¦ãããªãããã²ç§ã«é£çµ¡ãã¦ãã ããã åãã§ååãããã§ãã
2024å¹´8æ28æ¥
æ²³ç° æº