Results 1 to 1 of 1
  1. #1
    FoxLife
    FoxLife is offline
    New member FoxLife's Avatar
    Join Date
    2013 Apr
    Posts
    20
    Thanks
    4
    Thanked 16 Times in 9 Posts
    Rep Power
    0

    Creating DLL's in Delphi.

    BEFORE YOU READ ALL WHAT 'S NEXT :
    So before reading the topic I'll be telling you that :
    1 - The topic will be teaching only to create a DLL and not to create a hack for games. Even trying to inject a DLL into a game it will not affect anything.

    2 - If you already have knowledge of the contents of this Creation DLL is not necessary to read , post comments and much less useless , besides it is considered flood .





    Some questions constumam be questions of several people :

    Well I created a DLL to do more like it in a transfomar Hack ?
    A: Well, first you need to know about how the game works , and modify the conteúdo.Por example ( this is not written in any game is just a demonstrational ) say it is written:
    Damage = 25
    So the DLL you will make it tranforme that number into something bigger, this will cause the " Damage" is great .
    Summarizing the DLL well most of the time only changes existing values ​​, in some cases added.
    Note : I suggest to start with The Duel though shortly to be working with him I believe to be a very simple system .

    This topic will post some hack oo content in DLL ?
    A: Not as I had written it will only show how to create the DLL .

    You can put the topic also creating hack's for certain games ?
    A: Look, I'll even post it for you to study the Hack would have direct, more like I know a lot of people here is not confiáviel still not be posting things like this .

    More teaches you how to make DLL and does not teach how to hack than this point?
    A: First, that the DLL is not used only in hack's is used in various programs , and if I postasse the hack straight you would have no study, no it would not do anything you would only make a copy and post elsewhere giving your name as the creator.






    The creation


    1 Rules for writing a DLL in Delphi : The functions and / or procedures DLL must follow these rules :
    - They must be listed in the DLL exports clause . This allows the time to call the functions and / or procedures , to be accepted by the main program .
    - The exported functions must be declared as stdcall ;
    - The types of parameters a DLL should be standard types of Windows, at least if you want to use the DLL in other development environments , such as C + + .
    - A DLL can use global data will not be shared by the base programs . When an application loads a DLL , it stores the global data of the DLL in its own address space


    2nd In this step we will take the question to a question very often , " How to create a DLL ? " .
    Initiating the development of DLLs in Delphi I will show you a very simple library . The main objective of this example is to show the syntax used to define a DLL in Delphi .
    To begin , select the command File / New , choose the DLL in the main New Object Repository . This creates a very simple Source - Code .
    Here is the source code of our first DLL :


    Code:
    Library MINHADLL.DLL;
    uses SysUtils,
    Classes;
    {$R *.res}
    function Triple(N: Integer): Integer; stdcall;
    begin
    Result := N * 3;
    end;
    function Double (N: Integer): Integer; stdcall;
    begin Result := N * 2;
    end;
    exports Triple, Double;
    end. 

    3rd And now finally we include the dll in a Win32 project .
    To make a form using our DLL we open the Delphi and create a new application .
    Edits put two and two Buttons on onclick event of the button will do the calls of functions . To call a function from a DLL you need only declare functions equally as declared in the dll , ie , name , parameters and types .
    Here is an example :




    Code:
    unit Unit1 ;
    interface uses Windows , Messages , SysUtils , Variants , Classes , Graphics , Controls, Forms , Dialogs , StdCtrls ;
    type TForm1 = class ( TForm )
    Button1 : TButton ;
    Button2 : TButton ;
    Edit1 : TEdit ;
    Edit2 : TEdit ;
    Button1Click procedure (Sender : TObject ) ;
    button2Click procedure (Sender : TObject ) ;
    private { Private declarations }
    public { Public declarations }
    end ;
    var Form1 : TForm1 ;
    implemetation
    { $ R * . Dfm }

    Delphi DLL functions { }
    Code:
    Double function ( N : Integer ) : Integer; stdcall ; external ' MINHADLL.DLL ' ;
    Triple function ( N : Integer ) : Integer; stdcall ; external ' MINHADLL.DLL ' ;
    procedure TForm1.Button1Click (Sender : TObject ) ;
    var x, y : integer;
    begin
    x : = StrToInt ( Edit1.Text );
    y: = Double ( x);
    Edit1.Text : = IntToStr (Y) ;
    end ;
    
    
    TForm1.Button2Click procedure (Sender : TObject ) ;
    var x, y : integer;
    begin
    x : = StrToInt ( Edit2.Text );
    y: = triple ( x);
    Edit2.Text : = IntToStr (Y) ;
    end ;
    end .


    EM Portugues

    Spoiler


Similar Threads

  1. Replies: 0
    Last Post: 2012-11-12, 12:42 AM
  2. [Delphi] Creating a Simple Game Trainer
    By Dwar in forum Delphi
    Replies: 21
    Last Post: 2012-07-24, 02:38 PM
  3. [Delphi] Delphi elementclient inject
    By marcelo380 in forum Perfect World
    Replies: 0
    Last Post: 2012-06-08, 09:13 PM
  4. [Delphi] Creating DLLs
    By Dwar in forum Delphi
    Replies: 0
    Last Post: 2010-11-04, 09:58 AM
  5. Replies: 0
    Last Post: 2010-10-27, 12:56 PM
Visitors found this page by searching for:
Nobody landed on this page from a search engine, yet!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •