Ir para conteúdo
Faça parte da equipe! (2024) ×

[Tutorial] Criando um speed hack em DLL (Delphi 7)


amcorporation
 Compartilhar

Posts Recomendados

Olá galera, vou encinar a vocês neste tópico a como criar um speed hack em uma dll (Funciona em todos os processos, dependendo de alguns jogos ele poderá ser detectado ou não funcionar caso exista game guard (anti hack)).

 

Vamos começar:

 

O que iremos precisar para fazer este speed hack:

- Delphi 7

- Saber o intermediário do delphi

 

Começaremos pela DLL:

 

Clique em: File>New>Other> DLL Wizard

 

Renomeie a dll para speedhack.

 

Apague as uses até o end. e coloque este código no lugar:

uses

SysUtils,

Classes,

speedhackunit in 'speedhackunit.pas',

ui in 'ui.pas' {Form1};

 

{$R *.res}

 

exports acceleration;

exports sleeptime;

 

 

begin

sui:=tui.create(false);

 

end.

 

Agora clique em:

 

File>New>Form

 

Adicone nas uses:

speedhackunit;

 

E em baixo da type coloque:

 

type

TUI = class(tthread)

public

procedure execute; override;

end;

 

Ficando assim:

 

wbyj6f.png

 

Adicione os componentes:

 

2 - Edits

2 - Labels

1 - Botão

 

Terá que ficar assim:

 

iohxsl.png

 

E adicone nas váriaveis (var):

 

sui: tui;

 

Agora coloque esté código embaixo do {$R *.dfm}

 

procedure TUI.execute;

begin

form1:=tform1.Create(nil);

form1.ShowModal;

end;

 

Depois disso clique duas vezes no botão1 (Cujo nome terá que ser "Ligar speed Hack") e apague o begin e o end; e coloque o seguinte código no lugar:

 

var a: single;

s: dword;

begin

s:=strtoint(edit2.text);

a:=strtofloat(edit1.Text);

 

sleeptime:=s;

acceleration:=a;

end;

 

Após isso renomeie a unit da form para ui.

 

Agora crie uma nova unit em:

 

File>New>Unit

 

E renomeie ela para speedhackunit.

 

Agora apague tudo e coloque este código no lugar:

 

unit speedhackunit;

 

interface

uses windows,classes;

 

type TAPIInfo = record

location: Pointer;

Original: Array [0..4] of byte;

Jump: Array [0..4] of byte;

end;

 

type TTick=class(TThread)

private

public

procedure Execute; override;

end;

 

procedure InitializeSpeedhack;

procedure StopSpeedhack;

 

procedure GetTime; stdcall;

//function GetTime:dword; stdcall;

function NewQueryPerformanceCounter(var output: int64):BOOl; stdcall;

var CETick: dword;

CETick64: int64;

Ticker: TTick;

 

PerformanceFrequency: int64;

PerformanceFrequencyMS: int64;

acceleration: single;

sleeptime: dword;

slow: boolean;

tickerstopped: boolean;

speedhackenabled: boolean;

 

 

timeGetTimeInfo:TAPiInfo;

getTickcountInfo: TAPIInfo;

QueryPerformanceCounterInfo: TAPIInfo;

winmmlib,kernel32lib: thandle;

 

implementation

 

procedure InitializeSpeedhack;

var op:dword;

begin

cetick:=gettickcount;

//change the gettickcount and timegettime functions so that they look at cetick

if ticker<>nil then

begin

ticker.Terminate;

stopspeedhack;

end;

ticker:=nil;

 

 

winmmlib:=LoadLibrary('winmm.dll');

if winmmlib<>0 then

begin

timeGetTimeInfo.location:=GetProcAddress(winmmlib,'timeGetTime');

if VirtualProtect(timeGetTimeInfo.location,5,PAGE_EXECUTE_READWRITE,op) then

begin

timeGetTimeInfo.jump[0]:=$e9;

pdword(@timeGetTimeInfo.jump[1])^:=dword(@GetTime)-dword(timeGetTimeInfo.location)-5;

 

try

asm

//store original

push edi

push esi

lea edi,timeGetTimeInfo.original[0]

mov esi,timeGetTimeInfo.location

movsd

movsb

 

//replace with jump

lea esi,timeGetTimeInfo.jump[0]

mov edi,timeGetTimeInfo.location

movsd

movsb

 

pop esi

pop edi

end;

except

 

end;

end;

end;

 

 

kernel32lib:=LoadLibrary('kernel32.dll');

if kernel32lib<>0 then

begin

//gettickcount

GetTickCountInfo.location:=GetProcAddress(kernel32lib,'GetTickCount');

if VirtualProtect(GetTickCountInfo.location,5,PAGE_EXECUTE_READWRITE,op) then

begin

GetTickCountInfo.jump[0]:=$e9;

pdword(@GetTickCountInfo.jump[1])^:=dword(@GetTime)-dword(GetTickCountInfo.location)-5;

 

try

asm

//store original

push edi

push esi

lea edi,GetTickCountInfo.original[0]

mov esi,GetTickCountInfo.location

movsd

movsb

 

//replace with jump

lea esi,GetTickCountInfo.jump[0]

mov edi,GetTickCountInfo.location

movsd

movsb

 

pop esi

pop edi

end;

except

 

end;

end;

 

 

//QueryPerformanceCounter

if QueryPerformanceFrequency(PerformanceFrequency) then

begin

QueryPerformanceCounter(CETick64);

PerformanceFrequencyMS:=PerformanceFrequency div 1000;

 

//there is a high performance counter

QueryPerformanceCounterInfo.location:=GetProcAddress(kernel32lib,'QueryPerformanceCounter');

if VirtualProtect(QueryPerformanceCounterInfo.location,5,PAGE_EXECUTE_READWRITE,op) then

begin

QueryPerformanceCounterInfo.jump[0]:=$e9;

pdword(@QueryPerformanceCounterInfo.jump[1])^:=dword(@NewQueryPerformanceCounter)-dword(QueryPerformanceCounterInfo.location)-5;

 

try

asm

//store original

push edi

push esi

lea edi,QueryPerformanceCounterInfo.original[0]

mov esi,QueryPerformanceCounterInfo.location

movsd

movsb

 

//replace with jump

lea esi,QueryPerformanceCounterInfo.jump[0]

mov edi,QueryPerformanceCounterInfo.location

movsd

movsb

 

pop esi

pop edi

end;

except

 

end;

end;

end;

end;

 

speedhackenabled:=true;

 

if ticker=nil then ticker:=TTick.Create(false);

end;

 

procedure StopSpeedhack;

begin

if not speedhackenabled then exit;

 

speedhackenableD:=false;

 

try

asm

lea esi,timeGetTimeInfo.original[0]

mov edi,timeGetTimeInfo.location

movsd

movsb

end;

except

 

end;

 

try

asm

lea esi,GetTickCountInfo.original[0]

mov edi,GetTickCountInfo.location

movsd

movsb

end;

except

 

end;

 

try

asm

lea esi,QueryPerformanceCounterInfo.original[0]

mov edi,QueryPerformanceCounterInfo.location

movsd

movsb

end;

except

 

end;

 

 

 

FreeLibrary(winmmlib);

FreeLibrary(kernel32lib);

winmmlib:=0;

kernel32lib:=0;

if ticker<>nil then ticker.terminate;

ticker:=nil;

end;

 

 

procedure GetTime; stdcall;

asm

mov eax,[CETick]

ret

end;

 

{function GetTime:dword; stdcall;

begin

result:=CETick;

end;}

 

function NewQueryPerformanceCounter(var output: int64):BOOl; stdcall;

begin

output:=cetick64;

result:=true;

end;

 

procedure TTick.Execute;

begin

tickerstopped:=false;

freeonterminate:=true;

priority:=tpTimeCritical; //if not a thread with higher priority will prevent the timer from running

while not terminated do

begin

inc(cetick64,trunc(acceleration*(PerformanceFrequency / (1000 / sleeptime))) );

inc(cetick,trunc(sleeptime*acceleration));

sleep(sleeptime);

end;

tickerstopped:=true;

end;

 

initialization

acceleration:=1.8;

sleeptime:=10;

InitializeSpeedhack;

 

end.

 

Após isso é so salvar e compilar (f9).

 

Source:

http://forum.cheatengine.org/files/speedhacksrc_152.zip

 

Speed Hack tirado do Cheat Engine, Projeto tirado do site do CE então acho que não é necessário scanner.

 

ATENÇÃO: Este speed hack é uma dll então você terá que ter um injetor de dll para usar ou para testar.

 

Créditos:

 

Projeto : Dark_Byte

Tutorial : amcorporation

 

Abrass... a todos.

Link para o comentário
Compartilhar em outros sites

Cara, eu tentei fazer, segui o tutorial tudo certinho;

Na hora de salvar eu salvei tudo na mesma pasta usando o save all;

daí na hora de compilar aparece esse erro:

imagemxa.png

 

Já levou meu Thanks.

Se possivel posta o link de um arquivo zipado com os seus arquivos do projeto speed em dll aki no fórum PLIS. (:

Ajuda aí cara, quero muito isso aê :preocupado:

Link para o comentário
Compartilhar em outros sites

Este tópico está impedido de receber novos posts.
 Compartilhar

  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...

Informação Importante

Nós fazemos uso de cookies no seu dispositivo para ajudar a tornar este site melhor. Você pode ajustar suas configurações de cookies , caso contrário, vamos supor que você está bem para continuar.