<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Flash on bramp.net</title>
    <link>https://blog.bramp.net/</link>
    <description>Recent content in Flash on bramp.net</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-GB</language>
    <lastBuildDate>Sun, 19 Jun 2011 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://blog.bramp.net/tags/flash/" rel="self" type="application/rss+xml" />
    
    <item>
      <title>Linux 64bit Flash glibc memcpy bug</title>
      <link>https://blog.bramp.net/post/2011/06/19/linux-64bit-flash-glibc-memcpy-bug/</link>
      <pubDate>Sun, 19 Jun 2011 00:00:00 +0000</pubDate>
      
      <guid>https://blog.bramp.net/post/2011/06/19/linux-64bit-flash-glibc-memcpy-bug/</guid>
      <description><p>Does your Linux 64bit version of Flash now make anonying beeping/distortion noises while playing videos? Well it turns out a recent “<a href="http://lwn.net/Articles/414467/">improvement</a>” to glibc has caused some programs to now crash or do weird things. This is to do with an improvement of <a href="http://linux.die.net/man/3/memcpy">memcpy</a>, which makes its use more strict, causing those applications that incorrectly used it to now crash.</p>
<p>On Debian, there is a simple a fix that allows you to use the original memcpy. You can load the application using an additional .so file:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="nv">LD_PRELOAD</span><span class="o">=</span>/usr/lib/libc/memcpy-preload.so /path/to/your/program
</span></span></code></pre></div><p>As I use Google Chrome when using Flash I had to do the following:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="nv">LD_PRELOAD</span><span class="o">=</span>/usr/lib/libc/memcpy-preload.so /usr/bin/google-chrome
</span></span></code></pre></div><p>but if you want to fix chrome on a system level, you can edit the Chrome Wrapper used to launch it.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">sudo nano /opt/google/chrome/google-chrome
</span></span></code></pre></div><p>add the following line</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="nb">export</span> <span class="nv">LD_PRELOAD</span><span class="o">=</span><span class="s2">&#34;/usr/lib/libc/memcpy-preload.so&#34;</span>
</span></span></code></pre></div><p>for example</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="nb">export</span> LD_LIBRARY_PATH
</span></span><span class="line"><span class="cl"><span class="nb">export</span> <span class="nv">LD_PRELOAD</span><span class="o">=</span><span class="s2">&#34;/usr/lib/libc/memcpy-preload.so&#34;</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nb">export</span> <span class="nv">CHROME_VERSION_EXTRA</span><span class="o">=</span><span class="s2">&#34;beta&#34;</span>
</span></span></code></pre></div></description>
    </item>
    
    <item>
      <title>Fullscreen Hack for Flash 10.1</title>
      <link>https://blog.bramp.net/post/2010/05/24/fullscreen-hack-for-flash-10.1/</link>
      <pubDate>Mon, 24 May 2010 00:00:00 +0000</pubDate>
      
      <guid>https://blog.bramp.net/post/2010/05/24/fullscreen-hack-for-flash-10.1/</guid>
      <description><p>After watching a few hours of <a href="http://www.channel4.com/programmes/4od">4oD</a> today I got annoyed that i couldn’t do something on one monitor while my other monitor plays full screen flash. The reason, flash will instantly lose full screen if another application gains focus (e.g the web browser on my other monitor.)</p>
<p>After a bit of googling I found these links [<a href="http://www.channel4.com/programmes/4od">1</a>]<a href="http://my.opera.com/d.i.z./blog/2009/04/22/watch-fullscreen-flash-while-working-on-another-screen">2</a> [<a href="http://my.opera.com/d.i.z./blog/2009/04/22/watch-fullscreen-flash-while-working-on-another-screen">2</a>]<a href="http://jmaxxz.com/index.php?option=com_content&amp;view=article&amp;id=89:flashhacker&amp;catid=16:downloads&amp;Itemid=32">3</a>. However, both of these sites only support flash 9 and flash 10.0, whereas I’m currently on 10.1.53.38. Additionally the second link mentioned no one has been able to hack this into 10.1, so I instantly recongised a challenge.</p>
<p>About 4 hours later I figure it out:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">On win32 open
</span></span><span class="line"><span class="cl">C:\Windows\System32\Macromed\Flash\NPSWF32.dll
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">On win64 open
</span></span><span class="line"><span class="cl">C:\Windows\SysWOW64\Macromed\Flash\NPSWF32.dll
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">or if using Google Chrome (as Chrome now comes with the Flash plugin) open
</span></span><span class="line"><span class="cl">C:\Users\Andrew\AppData\Local\Google\Chrome\Application\6.0.408.1\gcswf32.dll
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">or if using Google Chrome on Windows XP:
</span></span><span class="line"><span class="cl">C:\Documents and Settings\Andrew\Local Settings\Application Data\Google\Chrome\Application\6.0.408.1
</span></span></code></pre></div><p>On version 10.1.53.38<br>
Jump to offset <strong>0×180227</strong> and change bytes <strong>74 2A</strong> to <strong>90 90</strong>, and voila.</p>
<p>On version 10.1.53.55<br>
Jump to offset <strong>0×180410</strong> and change bytes <strong>74 39</strong> to <strong>90 90</strong>, and voila.</p>
<p>On version 10.1.53.64 (Chrome version – gcswf32.dll)<br>
Jump to offset <strong>0×180753</strong> and change bytes <strong>74 39</strong> to <strong>90 90</strong>, and voila.</p>
<p>On version 10.1.53.64 (Normal version – NPSWF32.dll – thanks Medlir)<br>
Jump to offset <strong>0x180A15</strong> and change bytes <strong>74 39</strong> to <strong>90 90</strong>, and voila.</p>
<p>Thanks to all the commenter who worked this out before me :)<br>
On version 10.1.82.76 (Chrome version – gcswf32.dll)<br>
Jump to offset <strong>0x180FAF</strong> and change bytes <strong>74 39</strong> to <strong>90 90</strong>, and voila.</p>
<p>On version 10.1.82.76 (Normal version – NPSWF32.dll)<br>
Jump to offset <strong>0x180AAF</strong> and change bytes <strong>74 39</strong> to <strong>90 90</strong>, and voila.</p>
<p><strong>Note this method is unsupported, and will most likely break when Flash gets updated again. It is always a good idea to backup any file first, and make sure you are on the same version as me.</strong></p>
<p>For the curious this changes some code that looks like this:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-c" data-lang="c"><span class="line"><span class="cl"><span class="k">if</span> <span class="p">(</span><span class="n">msg</span> <span class="o">==</span> <span class="n">WM_KILLFOCUS</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">  <span class="n">jump</span> <span class="n">to</span> <span class="n">kill_focus</span>
</span></span><span class="line"><span class="cl"><span class="k">if</span> <span class="p">(</span><span class="n">msg</span> <span class="o">==</span> <span class="n">WM_PAINT</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">  <span class="n">jump</span> <span class="n">to</span> <span class="n">paint</span>
</span></span></code></pre></div><p>to</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-c" data-lang="c"><span class="line"><span class="cl"><span class="k">if</span> <span class="p">(</span><span class="n">msg</span> <span class="o">==</span> <span class="n">WM_KILLFOCUS</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">  <span class="n">nop</span> <span class="n">nop</span>
</span></span><span class="line"><span class="cl"><span class="k">if</span> <span class="p">(</span><span class="n">msg</span> <span class="o">==</span> <span class="n">WM_PAINT</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">  <span class="n">jump</span> <span class="n">to</span> <span class="n">paint</span>
</span></span></code></pre></div><p>and for some context the version 10.1.53.64 surrounding code looked like this:</p>
<pre><b>74</b> 39 83 E8 07 <b>74</b> 11 83 E8 05 <b>75</b> 13 8B
</pre>
<p>The 74s and 75 should be the same between versions, but all the other bytes might change.</p>
</description>
    </item>
    
  </channel>
</rss>
