how to ignore "FF FF FF FF" with python
<p>i have a file around 60 kb, i am trying to extract the data only. the file has alot of "FF FF FF FF" in it and i am trying to extract everything but the "FF FF FF FF" here is an example:</p>

<pre><code>46 0D 89 2E 16 FC 1E E6 10 C1 6D 4E 1B 74 5F 1F 
81 07 E2 E7 17 14 77 D4 EA AC BC 20 EA 98 27 FF 
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
</code></pre>

<p>and here is the code i use to get it:</p>

<pre><code>infile = open("file.bin", "rb") 
    new_pos = int("0xFC0000", 16)
    infile.seek(new_pos, 0)
    chunk = int("0x40000", 16)
    data = infile.read(chunk)
    with open("processed_file.bin", "wb") as outfile:
        outfile.write(data)
</code></pre>

<p>it will read the file and save it as "processed file.bin" but it has all these "FF FF's" in it. there are instances of FF, and i need for it to find "FF FF FF FF" and remove it from the file before it saves it as processed file.bin</p>

<p>any input would be appreciated.</p>

<p>EDIT: to further explain what i mean, this hex has FF at the end of it,</p>

<pre><code>81 07 E2 E7 17 14 77 D4 EA AC BC 20 EA 98 27 FF
</code></pre>

<p>i need to keep that FF at the end, but remove any instances of FF FF or FF FF FF FF.</p>
