{"id":41963,"date":"2003-11-04T03:38:00","date_gmt":"2003-11-04T03:38:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2003\/11\/04\/just-follow-the-rules-and-nobody-gets-hurt\/"},"modified":"2003-11-04T03:38:00","modified_gmt":"2003-11-04T03:38:00","slug":"just-follow-the-rules-and-nobody-gets-hurt","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20031104-00\/?p=41963","title":{"rendered":"Just follow the rules and nobody gets hurt"},"content":{"rendered":"\n<p>         You may have been lazy and not bothered calling VirtualProtect(PAGE_EXECUTE) when         you generated some code on the fly. You got away with it because the i386 processor         page protections do not have a &#8220;read but don&#8217;t execute&#8221; mode, so anything you could         read you could also execute.      <\/p>\n<p>         <a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/dnwxp\/html\/securityinxpsp2.asp\">Until         now<\/a>.      <\/p>\n<p>         Starting with Windows XP Service Pack 2, on processors which support it (according         to the web page, currently AMD K8, Itanium, and AMD64), the stack and heap will not         be executable. If you try to execute the stack or the heap, an exception will be raised         and the code will not execute. In other words, execute page protection will soon be         enforced, now that processors exist that support it. (Actually, I believe Windows         XP for Itanium already used this new protection level, so those of you who have been         playing around with your Itanium may have seen this already.)      <\/p>\n<p>         If you were a good developer and followed the rules on page protections, then this         has no effect on you. But if you cheated the rules and took advantage of specific         hardware implementation details, you may find yourself in trouble. Consider yourselves         warned.      <\/p>\n","protected":false},"excerpt":{"rendered":"<p>You may have been lazy and not bothered calling VirtualProtect(PAGE_EXECUTE) when you generated some code on the fly. You got away with it because the i386 processor page protections do not have a &#8220;read but don&#8217;t execute&#8221; mode, so anything you could read you could also execute. Until now. Starting with Windows XP Service Pack [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[25],"class_list":["post-41963","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>You may have been lazy and not bothered calling VirtualProtect(PAGE_EXECUTE) when you generated some code on the fly. You got away with it because the i386 processor page protections do not have a &#8220;read but don&#8217;t execute&#8221; mode, so anything you could read you could also execute. Until now. Starting with Windows XP Service Pack [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/41963","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=41963"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/41963\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=41963"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=41963"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=41963"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}