Add files via upload

This commit is contained in:
Bluzume 2021-02-12 21:11:30 +13:00 committed by GitHub
parent 7456c23be9
commit 19aa929e98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -211,13 +211,15 @@ namespace DontTouchMyFlash
{
byte[] projBytes = File.ReadAllBytes(path);
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);
if (getUrlLocation == -1)
return;
FileStream fs = File.OpenWrite(path);
fs.Seek(getUrlLocation+1, SeekOrigin.Begin);
for (int i = 0; i < 5; i++)
fs.WriteByte((byte)0x90); // NOP
fs.Write(nops, 0x00, nops.Length);
fs.Close();
}