add projector patches

This commit is contained in:
Bluzume 2021-02-12 21:03:25 +13:00 committed by GitHub
parent 6b6d159232
commit 7456c23be9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 44 additions and 0 deletions

View File

@ -37,6 +37,7 @@
this.flashExes = new System.Windows.Forms.ListBox();
this.deleteFile = new System.Windows.Forms.Button();
this.progressBar = new System.Windows.Forms.ProgressBar();
this.projectorPatch = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label1
@ -122,11 +123,23 @@
this.progressBar.Size = new System.Drawing.Size(459, 23);
this.progressBar.TabIndex = 9;
//
// projectorPatch
//
this.projectorPatch.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.projectorPatch.Location = new System.Drawing.Point(422, 532);
this.projectorPatch.Name = "projectorPatch";
this.projectorPatch.Size = new System.Drawing.Size(63, 19);
this.projectorPatch.TabIndex = 10;
this.projectorPatch.Text = "Projector+";
this.projectorPatch.UseVisualStyleBackColor = true;
this.projectorPatch.Click += new System.EventHandler(this.projectorPatch_Click);
//
// FlashPwner
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(486, 552);
this.Controls.Add(this.projectorPatch);
this.Controls.Add(this.progressBar);
this.Controls.Add(this.deleteFile);
this.Controls.Add(this.flashExes);
@ -156,6 +169,7 @@
private System.Windows.Forms.ListBox flashExes;
private System.Windows.Forms.Button deleteFile;
private System.Windows.Forms.ProgressBar progressBar;
private System.Windows.Forms.Button projectorPatch;
}
}

View File

@ -207,10 +207,40 @@ namespace DontTouchMyFlash
}
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);
}
}
}
}