Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- { Started writing on 2010.05.15 by Kulverstukas || last update: none }
- unit Stripper;
- {$mode objfpc}{$H+}
- interface
- uses
- Classes,SysUtils,FileUtil,LResources,Forms,Controls,Graphics,Dialogs,StdCtrls,ShellApi;
- type
- { TForm1 }
- TForm1 = class(TForm)
- Button1:TButton;
- Button2:TButton;
- CheckBox1:TCheckBox;
- CheckBox2:TCheckBox;
- CheckBox3:TCheckBox;
- Edit1:TEdit;
- Label1:TLabel;
- procedure Button1Click(Sender:TObject);
- procedure Button2Click(Sender:TObject);
- procedure CheckBox1Click(Sender:TObject);
- procedure CheckBox2Click(Sender:TObject);
- procedure CheckBox3Click(Sender:TObject);
- private
- { private declarations }
- public
- { public declarations }
- end;
- var
- Form1: TForm1;
- openDialog : TOpenDialog;
- implementation
- { TForm1 }
- //====================================================
- procedure TForm1.Button1Click(Sender:TObject);
- begin
- //========
- openDialog := TOpenDialog.Create(self); // assign the dialog to the variable
- openDialog.InitialDir := GetCurrentDir; // open directory where exe was launched from
- openDialog.Options := [ofFileMustExist]; // only allow existing files
- openDialog.Filter := '*.exe files|*.exe';
- openDialog.Title := 'Select a dump';
- //========
- if openDialog.Execute then
- begin
- Form1.Edit1.Text := openDialog.FileName;
- end;
- //========
- end;
- //====================================================
- procedure TForm1.Button2Click(Sender:TObject);
- begin
- if FileExists(Form1.Edit1.Text) then
- begin
- if CheckBox1.Checked then
- begin
- Form1.Caption := 'ExeStripper - Stripping...';
- ShellExecute(Handle,'open',PChar('strip.exe'),PChar('--strip-all '+'"'+Edit1.Text+'"'),nil,0);
- Form1.Caption := 'ExeStripper';
- end;
- if CheckBox2.Checked then
- begin
- Form1.Caption := 'ExeStripper - Stripping...';
- ShellExecute(Handle,'open',PChar('strip.exe'),PChar('--strip-debug '+'"'+Edit1.Text+'"'),nil,0);
- Form1.Caption := 'ExeStripper';
- end;
- if CheckBox3.Checked then
- begin
- Form1.Caption := 'ExeStripper - Stripping...';
- ShellExecute(Handle,'open',PChar('strip.exe'),PChar('--strip-unneeded '+'"'+Edit1.Text+'"'),nil,0);
- Form1.Caption := 'ExeStripper';
- end;
- end
- else ShowMessage('File doesn''t exist!');
- end;
- //====================================================
- procedure TForm1.CheckBox1Click(Sender:TObject);
- begin
- if CheckBox1.Checked then
- begin
- CheckBox2.Checked := False;
- CheckBox3.Checked := False;
- end;
- end;
- //========================
- procedure TForm1.CheckBox2Click(Sender:TObject);
- begin
- if CheckBox2.Checked then
- begin
- CheckBox1.Checked := False;
- CheckBox3.Checked := False;
- end;
- end;
- //========================
- procedure TForm1.CheckBox3Click(Sender:TObject);
- begin
- if CheckBox3.Checked then
- begin
- CheckBox1.Checked := False;
- CheckBox2.Checked := False;
- end;
- end;
- //====================================================
- initialization
- {$I stripper.lrs}
- end.
Add Comment
Please, Sign In to add comment