{"width":"100%","type":"rich","categories":["\u30d0\u30a4\u30ca\u30ea"],"version":"1.0","height":"190","url":"https://mmxsrup.hatenablog.com/entry/2019/04/23/225540","description":"\u81ea\u5df1\u66f8\u304d\u63db\u3048\u30b3\u30fc\u30c9\u3068\u306f, \u5b9f\u884c\u6642\u306b\u81ea\u5206\u81ea\u8eab\u306e\u547d\u4ee4\u3092\u66f8\u304d\u63db\u3048\u308b\u30b3\u30fc\u30c9\u306e\u3053\u3068\u3067\u3042\u308b. \u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3067\u306f, foo() \u95a2\u6570\u306e i++ \u306e\u547d\u4ee4\u3092 i += 2\u306b\u81ea\u5df1\u66f8\u304d\u63db\u3048\u3057\u3066\u3044\u308b. \u9806\u306b\u8aac\u660e\u3057\u3066\u3044\u304f\u3068, \u307e\u305a mprotect() \u95a2\u6570\u3067foo\u95a2\u6570\u306e\u547d\u4ee4\u304c\u66f8\u304b\u308c\u3066\u3044\u308b\u30da\u30fc\u30b8\u306b\u8aad\u307f, \u66f8\u304d, \u5b9f\u884c\u306e\u6a29\u9650\u3092\u4e0e\u3048\u308b. foo() \u95a2\u6570\u3092\u66f8\u304d\u63db\u3048\u308b\u306e\u3067, \u66f8\u304d\u63db\u3048\u6a29\u9650\u3092\u4e0e\u3048\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044. \u901a\u5e38\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30fc\u306e\u89b3\u70b9\u304b\u3089\u95a2\u6570\u306a\u3069\u306e\u30b3\u30fc\u30c9\u304c\u66f8\u304b\u308c\u3066\u3044\u308b\u9818\u57df\u306f\u66f8\u304d\u8fbc\u307f\u6a29\u9650\u304c\u306a\u3044. \u6b21\u306b, \u666e\u901a\u306b foo() \u3092\u547c\u3073\u51fa\u3057\u305f\u5f8c, foo() \u95a2\u6570\u306e\u5148\u982d\u304b\u3089 18 byte\u9032\u3093\u3060\u4f4d\u7f6e\u306ebyte\u306b 0x2 \u3092\u66f8\u304d\u8fbc\u3093\u2026","author_url":"https://blog.hatena.ne.jp/mmxsrup/","provider_name":"Hatena Blog","blog_url":"https://mmxsrup.hatenablog.com/","image_url":null,"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmmxsrup.hatenablog.com%2Fentry%2F2019%2F04%2F23%2F225540\" title=\"\u81ea\u5df1\u66f8\u304d\u63db\u3048\u30b3\u30fc\u30c9(self-modifying code) - srup\u306e\u30e1\u30e2\u5e33\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","author_name":"mmxsrup","published":"2019-04-23 22:55:40","title":"\u81ea\u5df1\u66f8\u304d\u63db\u3048\u30b3\u30fc\u30c9(self-modifying code)","blog_title":"srup\u306e\u30e1\u30e2\u5e33","provider_url":"https://hatena.blog"}