Hack Forums
[Delphi] [Delphi]Make A Crack/Patch With Delphi - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Coders Lounge (https://hackforums.net/forumdisplay.php?fid=5)
+---- Thread: [Delphi] [Delphi]Make A Crack/Patch With Delphi (/showthread.php?tid=45277)



[Delphi]Make A Crack/Patch With Delphi - Emirej - Jan 16, 2009

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 :)


- Kink - Jun 5, 2009

This is A ok Source Code i guess this Can Come in Handy One day!!!!
Thanks
-Kink


- king32 - Jun 6, 2009

nice:D we need more delphi tutorials and examples:D


* - aymi68 - Sep 4, 2010

So with this i can patch any program?


* - djfshady - Sep 4, 2010

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.


* - Sia - Dec 31, 2010

Very complicated, i don't understand the uses and the type statements, guess i'll find that out later :)


* - Symbiotic - Dec 31, 2010

(Dec 31, 2010 11:35 AM)VirtualDUDE 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.




* - Sia - Dec 31, 2010

(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...


* - raghavsood999 - Jul 23, 2017

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


* - Xogg - Jul 23, 2017

Seems really nice actually nice work!