<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>mirichi</author_name>
  <author_url>https://blog.hatena.ne.jp/mirichi/</author_url>
  <blog_title>mirichiの日記</blog_title>
  <blog_url>https://mirichi.hatenadiary.org/</blog_url>
  <categories>
    <anon>Ruby</anon>
  </categories>
  <description>Ruby1.9のDLで。 require 'DL' str = &quot;\xb8\xff\x7f\x00\x00\xc3&quot; # mov eax, 0x7fff : ret i = [str].pack(&quot;P&quot;).unpack(&quot;l!&quot;)[0] cfunc = DL::CFunc.new(i, DL::TYPE_INT) p cfunc.call([]) #=&gt; 32767 文字列としてバイナリを直接生成して、そのポインタをDLに渡して呼び出せば、マシン語のコードを呼ぶことができる。 WindowsにはDEPというデータ領域実行保護機能があるが、とりあえずXPのSP2以降はシステムしか保護されていない…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmirichi.hatenadiary.org%2Fentry%2F20120719%2Fp1&quot; title=&quot;Rubyからマシン語を直接呼ぶ - mirichiの日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2012-07-19 00:00:00</published>
  <title>Rubyからマシン語を直接呼ぶ</title>
  <type>rich</type>
  <url>https://mirichi.hatenadiary.org/entry/20120719/p1</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
