Strange Notepad++ HEX-editor plugin
<p>The goal is to write byte array to file. 
I have byte array fits[] with some bytes and then:</p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace _32_to_16
{
    class Program
    {
        static void Main(string[] args)
        {
            byte[] fits = File.ReadAllBytes("1.myf");
            byte[] img = new byte[fits.Length / 2];
            for (int i = 0; i &lt; fits.Length; i += 4) //Drops 2 high bytes
            {
                img[i/2] = fits[i + 2];
                img[i/2 + 1] = fits[i + 3];
            }
            File.WriteAllBytes("new.myf", img);
        }
    }
}
</code></pre>

<p>Before writing to the file img[] has same values:</p>

<ul>
<li>img[0]=0x31</li>
<li>img[1]=0x27</li>
<li>img[2]=0x31</li>
<li>img[3]=0xe2</li>
<li>and so on...</li>
</ul>

<p>After writing to file, in HEX editor i see </p>

<ul>
<li>00000000: 31 27 31 3f and other wrong values.</li>
</ul>

<p>Sometimes, with other fits[] values, img[] array write correctly to file. What I`m doing wrong?<br>
File for test 1.myf (which makes wrong results) <a href="https://www.dropbox.com/s/6xyf761oqm8j7y1/1.myf?dl=0" rel="nofollow">https://www.dropbox.com/s/6xyf761oqm8j7y1/1.myf?dl=0</a>
File for test 2.myf (correct writes to file) <a href="https://www.dropbox.com/s/zrglpx7kmpydurz/2.myf?dl=0" rel="nofollow">https://www.dropbox.com/s/zrglpx7kmpydurz/2.myf?dl=0</a></p>

<p>I simplified the code:</p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace _32_to_16
{
    class Program
    {
        static void Main(string[] args)
        {
            byte[] img_correct = new byte[8] { 0xbd, 0x19, 0xbd, 0x72, 0xbd, 0x93, 0xbd, 0xf7 };
            File.WriteAllBytes("img_correct.myf", img_correct);

            byte[] img_strange = new byte[8] { 0x33, 0x08, 0x33, 0xac, 0x33, 0xe3, 0x33, 0x94 };
            File.WriteAllBytes("img_strange.myf", img_strange);
        }
    }
}
</code></pre>

<p>in HEX-editor img_correct.myf looks like this:
bd 19 bd 72 bd 93 bd f7</p>

<p>in HEX-editor img_strange.myf looks like this:
33 08 33 3f 3f 3f </p>