Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Delphi 

[Delphi]Make A Crack/Patch With Delphi

Here is the source with quotes:

Code
unit code;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ExtCtrls;

type
  TForm1 = class(TForm)
    fichier: TOpenDialog;
    Button1: TButton;
    Info: TButton;
    Quit: TButton;
    Image1: TImage;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    procedure Button1Click(Sender: TObject);
    procedure InfoClick(Sender: TObject);
    procedure QuitClick(Sender: TObject);
  private
    { Déclarations privées}
  public
    { Déclarations publiques}
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);   //Inception

Const                            // we declare constants
    FileN         : String  = 'MySoftware.exe';    // File Name to pacth
    BytesToChange : Integer = 2;            // number of bytes to amend
    FileS         : LongInt = 564132;            // File size
    A             : Array[1..2] of Record        // By changing 2 bytes
      A : Longint;                    // length limit 2147483647
      B : Byte;                        // limit of 255 bytes
      End =                        // end statements

(
(A:$303E6;B:$90),  //Hexadecimal to change addresses and their octects
(A:$303E6;B:$90)   //    Attention! on the last row => no comma!);
);

Var            // declaration of variables     
  F     : File;        // F for the file
  Ch    : Char;        // Ch octet for a patch
  I     : LongInt;    // and I for the length

Begin                    // Begins
fichier.filename := '*.exe';        // Seeking an exe file
fichier.filter := FileN;        // file Mysoftware.exe
if fichier.execute then            // if the file is found, then ...
begin                    // opens a command
  AssignFile(F, fichier.filename);    // target file
  Reset(F,1);                // open the existing file
  If FileSize(F)<>FileS then        //  if the file is a size <or> that indicated, then ...
     begin                // Opens a command
     ShowMessage('File is incorrect size');    // displays the text as what it is not the right size
     halt(1);                // and was stopped while
     end                // end of the function which measures the size
     else                // if everything went well, then ...
     begin                // Opens a command
  end;                    // n the end to move to what am
  For I := 1 to BytesToChange do    // for I, I loop as many times there to make modification
     begin                // will indicate how
     Seek(F,A[I].A);            //>
     Ch:=Char(A[I].B);            //>
     Blockwrite(F,Ch,1);        // registered bytes
  end;                    // end of the procedure
  ShowMessage ('File successfully cracked!');    // Displays a message of success
end;                    //>
end;                    // Closing

Of course you can proceed with other method ;)

Traduction French to Eng by Dimension4

I hope it will help :)
This is A ok Source Code i guess this Can Come in Handy One day!!!!
Thanks
-Kink
nice:D we need more delphi tutorials and examples:D
So with this i can patch any program?
no you cannot patch any program using his script you could patch some programs IF you modify the code and add/remove parts of it.
Very complicated, i don't understand the uses and the type statements, guess i'll find that out later :)
(Dec 31, 2010 11:35 AM)Sia Wrote:  Very complicated, i don't understand the uses and the type statements, guess i'll find that out later :)

Uses is just stating what the program uses, if you make a Unit2 and wanted to manipulate Unit2's form you would add Unit2 to your uses.

(Dec 31, 2010 11:38 AM)Symbiotic Wrote:  Uses is just stating what the program uses, if you make a Unit2 and wanted to manipulate Unit2's form you would add Unit2 to your uses.
oh ok, thanks :P
i could have google'd it but yea...
Wow this is cool. Do you think i can use this for software like vmware workstation. I want to make patch but dont know where to start. I know all delphi but i need to know how this works. What buttons do i put on the form
Seems really nice actually nice work!
[Image: F2G97kn.png]


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Delphi] by VxV3n0mxVJan 4, 2018 07:37 PM 10 3,632 Jan 4, 2018 07:37 PM
Last Post: tcsh
[Delphi] by SymbioticJul 28, 2017 08:19 PM 10 1,664 Jul 28, 2017 08:19 PM
Last Post: Xogg
[Delphi] by djfshadyJul 18, 2017 05:44 PM 9 913 Jul 18, 2017 05:44 PM
Last Post: Xogg