Add files via upload
This commit is contained in:
parent
7456c23be9
commit
19aa929e98
|
@ -211,13 +211,15 @@ namespace DontTouchMyFlash
|
||||||
{
|
{
|
||||||
byte[] projBytes = File.ReadAllBytes(path);
|
byte[] projBytes = File.ReadAllBytes(path);
|
||||||
byte[] getUrlPattern = new byte[] { 0xF4, 0xE8, 0xBE, 0xFE, 0xFF, 0xFF };
|
byte[] getUrlPattern = new byte[] { 0xF4, 0xE8, 0xBE, 0xFE, 0xFF, 0xFF };
|
||||||
|
byte[] nops = new byte[] { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 };
|
||||||
Int64 getUrlLocation = GetPositionAfterMatch(projBytes, getUrlPattern);
|
Int64 getUrlLocation = GetPositionAfterMatch(projBytes, getUrlPattern);
|
||||||
|
|
||||||
|
if (getUrlLocation == -1)
|
||||||
|
return;
|
||||||
|
|
||||||
FileStream fs = File.OpenWrite(path);
|
FileStream fs = File.OpenWrite(path);
|
||||||
fs.Seek(getUrlLocation+1, SeekOrigin.Begin);
|
fs.Seek(getUrlLocation+1, SeekOrigin.Begin);
|
||||||
for (int i = 0; i < 5; i++)
|
fs.Write(nops, 0x00, nops.Length);
|
||||||
fs.WriteByte((byte)0x90); // NOP
|
|
||||||
fs.Close();
|
fs.Close();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue