Results 1 to 6 of 6
  1. #1
    Departure's Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    805
    Reputation
    125
    Thanks
    1,794
    My Mood
    Doh

    [Idea] Configure HotKey Hack

    I like to try new ideas and one I just came up with, Would be to make a package which included injector, hack and configuration GUI, The injector would be part of the Config GUI. The config gui would allow you to select what hacks you would want to use in the game and allow you to assign a hotkey to activate/deactivate that particular hack. Expanding on this would be a Dev version which would allow you config addresses and byte values, which means the actual hack would be for ever lasting as along as the hook doesn't get detected. Expanding on top of this idea again would be a dev gui which actually write a new section to the dll with all new addresses and values, Which means the hack.dll is semi compiled within the dev GUI, no programming experience needed to create a hack, Once again this is only limited by your hook getting detected. in other words the dll is just a stub and the config gui is the builder.

    Anyway its just an idea that I haven't seen but could code this to work.

    Any comments/Suggestions Welcomed
    Last edited by Departure; 02-27-2011 at 10:51 PM.

  2. #2
    Wilds's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Location
    here
    Posts
    522
    Reputation
    1
    Thanks
    170
    My Mood
    Relaxed
    well i like a challenge xD, i'll give it a try man and see what i can do with it.

    anyway really nice idea lol

  3. #3
    _Fk127_'s Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    720
    Reputation
    16
    Thanks
    208
    My Mood
    Bitchy
    This sounds like a great idea! Users of most programs like the ability to change config. to their liking. This would be a great feature to implement.



    Put this image in your signature if you support HTML5 development!

  4. #4
    Stephen's Avatar
    Join Date
    Jun 2009
    Gender
    male
    Location
    Engine.exe
    Posts
    4,689
    Reputation
    184
    Thanks
    1,149
    My Mood
    Aggressive
    SeanHax did this a while ago. (When he didn't have a DirectX hook.)

  5. #5
    +CodeDemon+'s Avatar
    Join Date
    Feb 2011
    Gender
    male
    Posts
    31
    Reputation
    10
    Thanks
    16
    Ive done this before. There is a function in the windows SDK that lets you read/write to an ini file which can be done to accomplish this.

  6. #6
    Departure's Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    805
    Reputation
    125
    Thanks
    1,794
    My Mood
    Doh
    lol yeah read write to an ini might be fine for the first stage of creating this type of thing, but in the dev version you will need to know how to add a new section to an existing module, then reAlign headers of the module ect..

    Heres an example I have written to do this in PE, Originally the idea was behind Jedi Code library which you this method for debugging purposes. After heavy modifications this is what I came up with and works perfectly..

    [highlight=delphi]
    (************************************
    Unit : uAddNewSectionPE
    Author : Departure
    Url : cheesydoodle.com
    ************************************)
    unit uAddNewSectionPE;

    interface

    Uses
    Windows, Classes, SysUtils;

    function AddNewSection(sFileName, sNewSectionName: String; dwNewSectionSize, dwNewSectionCharacteristics: DWORD): Boolean;


    implementation

    function PeMapImgSections(const NtHeaders: PImageNtHeaders): PImageSectionHeader;
    begin
    if NtHeaders = nil then
    Result := nil
    else
    Result := PImageSectionHeader(DWORD(@NtHeaders^.OptionalHead er) +
    NtHeaders^.FileHeader.SizeOfOptionalHeader);
    end;

    function PeMapImgFindSection(const NtHeaders: PImageNtHeaders;
    const SectionName: string): PImageSectionHeader;
    var
    Header: PImageSectionHeader;
    I: Integer;
    P: PChar;
    begin
    Result := nil;
    if NtHeaders <> nil then
    begin
    P := PChar(SectionName);
    Header := PeMapImgSections(NtHeaders);
    with NtHeaders^ do
    for I := 1 to FileHeader.NumberOfSections do
    if StrLComp(PChar(@header^.Name), P, IMAGE_SIZEOF_SHORT_NAME) = 0 then
    begin
    Result := Header;
    Break;
    end
    else
    Inc(Header);
    end;
    end;

    function PeMapImgNtHeaders(const BaseAddress: Pointer): PImageNtHeaders;
    begin
    Result := nil;
    if IsBadReadPtr(BaseAddress, SizeOf(TImageDosHeader)) then
    Exit;
    if (PImageDosHeader(BaseAddress)^.e_magic <> IMAGE_DOS_SIGNATURE) or
    (PImageDosHeader(BaseAddress)^._lfanew = 0) then
    Exit;
    Result := PImageNtHeaders(DWORD(BaseAddress) + DWORD(PImageDosHeader(BaseAddress)^._lfanew));
    if IsBadReadPtr(Result, SizeOf(TImageNtHeaders)) or
    (Result^.Signature <> IMAGE_NT_SIGNATURE) then
    Result := nil
    end;

    function AddNewSection(sFileName, sNewSectionName: String; dwNewSectionSize, dwNewSectionCharacteristics: DWORD): Boolean;
    var
    ImageStream : TMemoryStream;
    NtHeaders : PImageNtHeaders;
    Sections, LastSection, NewSection : PImageSectionHeader;
    VirtualAlignedSize : DWORD;
    I, X, NeedFill : Integer;

    procedure Alignment(var Value: DWORD; Alignment: DWORD);
    begin
    if (Value mod Alignment) <> 0 then
    Value := ((Value div Alignment) + 1) * Alignment;
    end;

    begin

    ImageStream := TMemoryStream.Create;
    try
    try
    ImageStream.LoadFromFile(sFileName);
    NtHeaders := PeMapImgNtHeaders(ImageStream.Memory);
    Assert(NtHeaders <> nil);
    Sections := PeMapImgSections(NtHeaders);
    Assert(Sections <> nil);
    // Check whether there is not a section with the name already. This
    // should never occur.
    Assert(PeMapImgFindSection(NtHeaders, sNewSectionName) = nil);
    LastSection := Sections;
    Inc(LastSection, NtHeaders^.FileHeader.NumberOfSections - 1);
    NewSection := LastSection;
    Inc(NewSection);

    // Increase the number of sections
    Inc(NtHeaders^.FileHeader.NumberOfSections);
    FillChar(NewSection^, SizeOf(TImageSectionHeader), #0);
    // Virtual Address
    NewSection^.VirtualAddress := LastSection^.VirtualAddress + LastSection^.Misc.VirtualSize;
    Alignment(NewSection^.VirtualAddress, NtHeaders^.OptionalHeader.SectionAlignment);
    // Physical Ofset
    NewSection^.PointerToRawData := LastSection^.PointerToRawData + LastSection^.SizeOfRawData;
    Alignment(NewSection^.PointerToRawData, NtHeaders^.OptionalHeader.FileAlignment);
    // Section name
    StrPLCopy(PChar(@newSection^.Name), sNewSectionName, IMAGE_SIZEOF_SHORT_NAME);
    // Characteristics flags
    NewSection^.Characteristics := dwNewSectionCharacteristics;

    // Size of virtual data area
    NewSection^.Misc.VirtualSize := dwNewSectionSize;
    VirtualAlignedSize := dwNewSectionSize;
    Alignment(VirtualAlignedSize, NtHeaders^.OptionalHeader.SectionAlignment);
    // Update Size of Image
    Inc(NtHeaders^.OptionalHeader.SizeOfImage, VirtualAlignedSize);
    // Raw data size
    NewSection^.SizeOfRawData := dwNewSectionSize;
    Alignment(NewSection^.SizeOfRawData, NtHeaders^.OptionalHeader.FileAlignment);
    // Update Initialized data size
    Inc(NtHeaders^.OptionalHeader.SizeOfInitializedDat a, NewSection^.SizeOfRawData);

    // Fill data to alignment
    NeedFill := Integer(NewSection^.SizeOfRawData) + dwNewSectionSize;

    // Note: Delphi linker seems to generate incorrect (unaligned) size of
    // the executable when adding data so the position could be
    // behind the size of the file then.
    ImageStream.Seek(NewSection^.PointerToRawData, soFromBeginning);

    X := 0;
    for I := 1 to NeedFill do
    ImageStream.WriteBuffer(X, 1);

    ImageStream.SaveToFile(sFileName);
    Result := True;
    except
    Result := False;
    end;
    finally
    ImageStream.Free;
    end;
    end;

    end.
    [/highlight]