Page 1 of 4 123 ... LastLast
Results 1 to 10 of 33

Thread: Making my EXE 'save' (from Cheats and hacks...)

  1. #1

    Making my EXE 'save' (from Cheats and hacks...)

    Hi!

    My game is nearly finished.

    When my last game came out, some days later there was a Cheat tool, that ran in the background and changed energy etc or could even change into my scene where the player could watch a hidden map etc.

    Sometime later I also found a hack which turned the shareware version into a full version.

    This is not nice! :evil:

    How can I make my Exe 'save' (as far as possible) from Trainers etc?

    Are there tools that can crypt the EXE (I think I have seen something like this somewhere) or can I do something in the Exe itself to prevent Trainers and Hacks?

    Thanks,
    firle

  2. #2

    Making my EXE 'save' (from Cheats and hacks...)

    Every time changing address of variable
    [pascal]type
    TPlayer = ...
    health : ^Integer;
    ...
    end;
    ...
    var
    hp : ^Integer;
    begin
    New(hp);
    hp^ := Player.health;
    Dispose(Player.health);
    Player.health := hp;
    ...
    end;
    [/pascal]
    or use static array of variables and change current REAL index of variable

  3. #3

    Making my EXE 'save' (from Cheats and hacks...)

    Then you might try packing your exe with UPX. It not only make exe smaller but i'd guess it is harder to decompile.

    If possible, try leaving some graphics/sound material out of shareware too, maybe resulting in difficult_to_fix_even_delphi_way access violation or other nasty trick to prevent hacking it :twisted:

  4. #4

    Making my EXE 'save' (from Cheats and hacks...)

    Sounds both very good. Have to find out what UPX is. Thanks!

    Is there a sense in having other variables set when energy is set also and having energy a coded value?

    Or is it all senseless when it comes to trainers?

    Firle

  5. #5

    Making my EXE 'save' (from Cheats and hacks...)

    I did some research a couple months ago when you last mentioned this 'hacking' (cracking is actually the correct term) on the omega forums.

    With tools such as GameCheater it is possible to modify values of processes currently running in Windows.

    For example, you have a game xxxx which currently holds a score value of 100. After submitting the game process to GameCheater together with the value 100 it will seek all adresses within the process with the value of 100.
    After the first test you'll need to continue playing until the score changes, and then rerun the test. GameCheater will then perform the same test but only with the addresses of the previous tests. After a couple tests 1 will come out eventually and you'll be able to modify it.

    The whole approach stands on the continued changing of fixed addresses. If you are someone able to change the address that holds your score GameCheater will never be able find it.

  6. #6

    Making my EXE 'save' (from Cheats and hacks...)

    Thanks a lot for the info! But how do I do that?

    I am not sure if I make a pointer for the score or the energy,
    it also is in the memory on a certain adress, or am I wrong?

    Can I disturb it somehow, coding these values, changing other 'dummy' values when changing them?

    Firle

  7. #7
    PGD Community Manager AthenaOfDelphi's Avatar
    Join Date
    Dec 2004
    Location
    South Wales, UK
    Posts
    1,245
    Blog Entries
    2

    Making my EXE 'save' (from Cheats and hacks...)

    I've never done it, or been involved with this kind of discussion before, but I'd say you need to move anything that can be tweaked to give the player an advantage.

    You could probably do it quite quickly with something like this...

    [pascal]
    const
    _movingDataItems = 2;

    type
    PInt = ^Integer;

    TMyMovingData = class(TObject)
    protected
    fMovingData : array[1.._movingDataItems] of PInt;
    function getData(index:integer):integer;
    procedure setData(index:integer;value:integer);
    public
    constructor create;
    destructor destroy; override;

    property armour:integer index 1 read getData write setData;
    property gold:integer index 2 read getData write setData;
    end;

    ....

    constructor TMyMovingData.create;
    var
    loop : integer;
    temp : PInt;
    begin
    inherited;

    for loop:=1 to _movingDataItems do
    begin
    new(temp);
    temp^:=0;
    fMovingData[loop]:=temp;
    end;
    end;

    destructor TMyMovingData.destroy;
    var
    loop : integer;
    temp : PInt;
    begin
    for loop:=1 to _movingDataItems do
    begin
    temp:=fMovingData[loop];
    dispose(temp);
    end;

    inherited;
    end;

    function TMyMovingData.getData(index:integer):integer;
    var
    temp : PInt;
    newTemp : PInt;
    begin
    if (index in [1.._movingDataItems]) then
    begin
    temp:=fMovingData[index];
    result:=temp^;
    new(newTemp);
    dispose(temp);
    newTemp^:=resuilt;
    fMovingData[index]:=newTemp;
    end
    else
    raise exception.create('Index out of bounds in TMyMovingData.getData ('+intToStr(index)+')');
    end;

    procedure TMyMovingData.setData(index:integer;value:integer) ;
    begin
    if (index in [1.._movingDataItems]) then
    begin
    fMovingData[index]^:=value;
    end
    else
    raise exception.create('Index out of bounds in TMyMovingData.setData ('+intToStr(index)+')');
    end;

    [/pascal]

    Using this object you could store a lot of integer data that will change location in memory every time you read it, I think thats the essence of whats been suggested.

    I haven't tested this code, I've just written it to give you a method you could use.

    Hope it helps
    :: AthenaOfDelphi :: My Blog :: My Software ::

  8. #8

    Making my EXE 'save' (from Cheats and hacks...)

    Hello Athena,

    thanks a lot for the suggestion.

    Do you think it would that be much slower or no problem at all? I have all Data stored in a TPlayer Record, then should I do that to every single value in the record or can I make a ^ on the record itself, would that also help?

    The record of TPlayer contains long lasting data, can be saved etc.
    The other records both contain data for space and planet missions are new created each level.

    TPlayer=record
    nscore,nface: integer;
    sname: string[20];
    sstatement: string[32];
    srank: string[20];
    nExp,nXRunlong,nXRunfast,
    nXWalkfast,nXShootfast,
    nXEnergy: integer;
    nrank,
    ncredit: integer;
    yco: single;
    control: tcontrol;
    nshieldtime: integer;
    colshipr,colshipg,colshipb: byte;
    colmanr, colmang, colmanb : byte;
    nchosenprimary,nchosensecondary: byte;
    npainkiller,nmanweapon,nmanarmor,
    nshiparmor: byte;
    priweapon1f,priweapon1s,
    priweapon1r,priweapon1fd,priweapon1rd,
    spapriweapon2, spapriweapon3,
    surpriweapon2, surpriweapon3,
    surpriweapon1: byte; //Waffe StAŹ§rke
    prienergy1, prienergy2, prienergy3: byte; //Waffe Energie
    prienergy1r,prienergy2r,prienergy3r:byte; //Waffe Energie Reload
    nsatelite1,nsatelite2: byte;
    ndrone1,ndrone2,ntracers,ntracertime: byte;
    // secweapon1, secweapon2, secweapon3: byte;
    spapriammo1, spapriammo2,
    spapriammo3: integer; //Ammo Anzahl
    surpriammo1, surpriammo2,
    surpriammo3: integer; //Ammo Anzahl
    sursecammo1: single;
    sursecammo2, sursecammo3: integer;
    spasecammo1,spasecammo2,
    spasecammo3: integer;
    nengine, nreload,nbot,ndef: byte;
    charE,charX,charT,charR,charA: boolean;
    proR,proB,proY: boolean;
    end;
    TPlayerMan = class(TSprite)
    Xco,Yco,nshootnr,
    LastXco,LastYco: single;
    SaveXco,SaveYco: single;
    SaveSaveXco,
    SaveSaveYco: single;
    SchattenX,SchattenY,
    LastX,LastY: single;
    nlastscrolly: single;
    nWavelapsed: single;
    Status: Tstatus;
    nEnergy: Integer;
    nBullet,nRocket: Byte;
    nEnergya,nBulleta,
    nRocketa: Byte;
    RichtLauf, RichtFeuer, Lastr: TRicht;
    nAnimation,
    nAniWait,
    nAniSpeech,
    naniHit: byte;
    nHurt: single;
    nshootindex,
    nimageindex: single;
    naniNohit,
    naniKill,
    nAniBonus,
    naniFreeze: integer;
    nspeedindex,
    nspeedcount: byte;
    nplayerdran: byte;
    boolfeuert,
    boolsprint: boolean;
    boolisdead: boolean;
    constructor Create(const AParent: TOmegaSprite; nPlayernr: byte); overload;
    procedure draw; override;
    procedure move(const movecount: single); override;
    procedure oncollision(const sprite: tsprite; const colx,coly: integer); override;
    end;
    TPlayerShip = class(TSprite)
    nanim: single;
    nWavelapsed: single;
    xhit,yhit: single;
    nEnergy,nLasertime: single;
    nshootnr,nruettel,nrauch: single;
    nEnergya,nShootwaita: Byte;
    nplayerdran: byte;
    // neigleft,neigup: byte;
    constructor Create(const AParent: TOmegaSprite; nPlayernr: byte); overload;
    procedure draw; override;
    procedure move(const movecount: single); override;
    procedure oncollision(const sprite: tsprite; const colx,coly: integer); override;
    end;
    I would need to make it hard to 'hack' into all TPlayer values, and some of the Playership/Playerman values like Energy. A main problem could be the shop scene, where you click a button then loose money and get a new weapon or something.

    Thanks a lot,
    Firle

  9. #9

    Making my EXE 'save' (from Cheats and hacks...)

    How about compressing your executable? For example upack, aspack or asprotect?

    Upack is free and will prevent amateur hackers from changing your code.

    You can make hacking harder but you will not prevent someone with skill from hacking your program. Many game companies spend millions on copy protection and yet often hacked versions of their game hit the streets before the legit version goes on sale.
    The views expressed on this programme are bloody good ones. - Fred Dagg

  10. #10

    Making my EXE 'save' (from Cheats and hacks...)

    Hi Czar,

    thanks for the info. I understand I cannot make it impossible to hack or crack, but I can make it harder.

    But this won't help againt trainers, right?

    Firle

Page 1 of 4 123 ... LastLast

Bookmarks

Posting Permissions

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