Skip to content

Commit

Permalink
add projector patches
Browse files Browse the repository at this point in the history
  • Loading branch information
LiEnby authored Feb 12, 2021
1 parent 6b6d159 commit 7456c23
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
14 changes: 14 additions & 0 deletions DontTouchMyFlash/FlashPwner.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions DontTouchMyFlash/FlashPwner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,40 @@ private void addFile_Click(object sender, EventArgs e)

}

private void patchProjetor(string path)
{
byte[] projBytes = File.ReadAllBytes(path);
byte[] getUrlPattern = new byte[] { 0xF4, 0xE8, 0xBE, 0xFE, 0xFF, 0xFF };

Int64 getUrlLocation = GetPositionAfterMatch(projBytes, getUrlPattern);

FileStream fs = File.OpenWrite(path);
fs.Seek(getUrlLocation+1, SeekOrigin.Begin);
for (int i = 0; i < 5; i++)
fs.WriteByte((byte)0x90); // NOP
fs.Close();

}

private void deleteFile_Click(object sender, EventArgs e)
{
if(flashExes.SelectedIndex >= 0)
flashExes.Items.RemoveAt(flashExes.SelectedIndex);
}

private void projectorPatch_Click(object sender, EventArgs e)
{
MessageBox.Show("This is a patch for the standalone \"projector\" program from adobe, it stops it opening your browser whenever a game tries to call javascript with getURL()\n\nNote: the projector DOES NOT HAVE A KILLSWITCH/TIMEBOMB and this is not needed to use the Flash Projector.", "Projector", MessageBoxButtons.OK, MessageBoxIcon.Information);

OpenFileDialog ofd = new OpenFileDialog();
ofd.Title = "Flash Projector";
ofd.Filter = "PE Executables (*.exe)|*.exe;|ELF Executables (*.elf)|*.elf";
DialogResult res = ofd.ShowDialog();
if(res == DialogResult.OK)
{
patchProjetor(ofd.FileName);
MessageBox.Show("Patched! Projector should no longer open the browser!!!", "SUCCESS", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
}

0 comments on commit 7456c23

Please sign in to comment.