Olha galera , irei ensinar a cria injetor nas .dll
1° ~> Crie um novo projeto em DELPHI
2° ~> Adicione os Componente a seguir:
2º Label's
2º Edit's
1º Botão
Arrume mais ou menos desta maneira:
label1 = Processo
label2 = DLL
Button1 = Injetar
Muito bem, se você chegou até aqui sem problemas irá conseguir o resto..
-- CÓDIGOS --
3° ~> Na parte USES Adicione -- Tlhelp32 --
( sem os -- )
4° ~> Abaixo de
Codigos:
--
implementation
{$R *.dfm}
--
Adicione as Funções:
1° Função:
Codigos:
--
function ValorAsc(Letra: String): Byte;
begin
if Length(letra) > 0 then ValorAsc := Ord(Letra[1]) else ValorAsc := 0;
end;
function crypt(Texto: String): String;
var
Cont, Cod: Integer;
Retorna: String;
begin
for Cont := 1 to Length(Texto) do begin
Cod := ValorAsc(Copy(Texto, Cont, 1));
Retorna := Retorna + Chr(Cod + 57(*valor a ser adicionado - pode ser modificado*));
end;
Crypt := Retorna;
end;
function Descript(Texto: String): String;
var
Cont, Cod: integer;
Retorna: String;
begin
for Cont := 1 to Length(Texto) do begin
Cod := ValorAsc(Copy(Texto, Cont, 1));
Retorna := Retorna + Chr(Cod - 57);
end;
Descript := Retorna;
end;
function processExists(exeFileName: string): Boolean;
var
ContinueLoop: BOOL;
FSnapshotHandle: THandle;
FProcessEntry32: TProcessEntry32;
begin
FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
FProcessEntry32.dwSize := SizeOf(FProcessEntry32);
ContinueLoop := Process32First(FSnapshotHandle, FProcessEntry32);
Result := False;
while Integer(ContinueLoop) <> 0 do
begin
if ((UpperCase(ExtractFileName(FProcessEntry32.szExeFile)) =
UpperCase(ExeFileName)) or (UpperCase(FProcessEntry32.szExeFile) =
UpperCase(ExeFileName))) then
begin
Result := True;
end;
ContinueLoop := Process32Next(FSnapshotHandle, FProcessEntry32);
end;
CloseHandle(FSnapshotHandle);
end;
--------------
dê um enter e adicione
2° Função
Código:
-----------
unction GetID(Const ExeFileName: string; var ProcessId: DWORD): boolean;
var
i:integer;
ContinueLoop: BOOL;
FSnapshotHandle: THandle;
FProcessEntry32: TProcessEntry32;
begin
i:=0;
result := false;
FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
FProcessEntry32.dwSize := Sizeof(FProcessEntry32);
ContinueLoop := Process32First(FSnapshotHandle, FProcessEntry32);
while integer(ContinueLoop) <> 0 do begin
if (StrIComp(PChar(ExtractFileName(FProcessEntry32.szExeFile)), PChar(ExeFileName)) = 0)
or (StrIComp(FProcessEntry32.szExeFile, PChar(ExeFileName)) = 0) then begin
if i = 1 then begin
ProcessId:= FProcessEntry32.th32ProcessID;
result := true;
break;
end;
i:=i+1;
end;
ContinueLoop := Process32Next(FSnapshotHandle, FProcessEntry32);
end;
CloseHandle(FSnapshotHandle);
end;
--
Agora clique duas vezes no Botão e adicione o código:
Código:
-- --- ----
var
Pid : dword;
ker41280dll : String;
pker41280dll : Pointer;
ker41280prcess,bw41280 : Cardinal;
hRemote_Thread : Cardinal;
begin
ker41280dll := ExtractFilePath(Application.Exename)+Edit2.Text;
if ProcessExists(PChar(Edit1.Text)) then begin
if FileExists(ker41280dll) then begin
GetID(PChar(Edit1.Text),pid);
ker41280prcess:= OpenProcess(PROCESS_ALL_ACCESS, false, PID);
pker41280dll := VirtualAllocEx(ker41280prcess,nil, length(ker41280dll), MEM_COMMIT,PAGE_EXECUTE_READWRITE);
WriteProcessMemory(ker41280prcess, pker41280dll, PChar(ker41280dll), length(ker41280dll), bw41280);
CreateRemoteThread(ker41280prcess, nil, 0, GetProcAddress(GetModuleHandle('kernel32.dll'),'LoadLibraryA'), pker41280dll, 0, hRemote_Thread);
CloseHandle(ker41280prcess);
ShowMessage('DLL Injetada Com Sucesso');
end;
end;
end;
-------------------------------------------------------------------------
OK
Agora seu Injetor está criado...
Altere o visual ao seu gosto
-------------------------------------------------------------------------
Agora, irei passar o código para fazer com que seu Injetor funcione em todos os jogos, principalmente em Combat Arms.
No lugar da 2ª função, adicione
Código:
-- --- ----
function CMKGETID(ExeFileName: string; var ProcessId: dword) :boolean; // A função
var
ContinueLoop: BOOL;
FSnapshotHandle: THandle;
FProcessEntry32: TProcessEntry32;
begin
result := false;
FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
FProcessEntry32.dwSize := Sizeof(FProcessEntry32);
ContinueLoop := Process32First(FSnapshotHandle, FProcessEntry32);
while integer(ContinueLoop) <> 0 do begin
if (StrIComp(PChar(ExtractFileName(FProcessEntry32.szExeFile)), PChar(ExeFileName)) = 0)
or (StrIComp(FProcessEntry32.szExeFile, PChar(ExeFileName)) = 0) then begin
ProcessId:= FProcessEntry32.th32ProcessID;
result := true;
break;
end;
ContinueLoop := Process32Next(FSnapshotHandle, FProcessEntry32);
end;
CloseHandle(FSnapshotHandle);
end;
-- não tente colocar as Duas funções no injetor senão vai dar problema --
-------------------------------------------------------------------------
Depois de fazer processo de Criação inteiro, vamos para a parte de salvar e Compilar o Projeto...
Algumas pessoas já me perguntaram como fazer isso então vou explicar.
Após ter Feito TUDO siga esta foto para salvar seu projeto:
O Programa irá pedir para vc salvar dois arquivos... (salve os dois na mesma Pasta)
Logo após ter salvado você terá que Compilar seu Projeto para o arquivo exe ser criado.. (Project1.exe)
Agora seu Trainer ou qualquer outro programa foi Criado...
O arquivo exe será criado Dentro da Pasta onde voce Salvou o Projeto anteriormente..
Obs: ~> Coloque a DLL dentro da pasta do Injetor
Obs²: ~> Se você não sabe como criar uma DLL, Irei postor em um outro tópico , esse ja esta muito cheio.
Para quem não tem o Delphi 7, faça
[Tens de ter uma conta e sessão iniciada para poderes visualizar este link]
Tudo pronto galera, aproveitem.
Se quizerem também fizer uma .dll
Entre Nesse Topico>>[Tens de ter uma conta e sessão iniciada para poderes visualizar este link]
1° ~> Crie um novo projeto em DELPHI
2° ~> Adicione os Componente a seguir:
2º Label's
2º Edit's
1º Botão
Arrume mais ou menos desta maneira:
label1 = Processo
label2 = DLL
Button1 = Injetar
Muito bem, se você chegou até aqui sem problemas irá conseguir o resto..
-- CÓDIGOS --
3° ~> Na parte USES Adicione -- Tlhelp32 --
( sem os -- )
4° ~> Abaixo de
Codigos:
--
implementation
{$R *.dfm}
--
Adicione as Funções:
1° Função:
Codigos:
--
function ValorAsc(Letra: String): Byte;
begin
if Length(letra) > 0 then ValorAsc := Ord(Letra[1]) else ValorAsc := 0;
end;
function crypt(Texto: String): String;
var
Cont, Cod: Integer;
Retorna: String;
begin
for Cont := 1 to Length(Texto) do begin
Cod := ValorAsc(Copy(Texto, Cont, 1));
Retorna := Retorna + Chr(Cod + 57(*valor a ser adicionado - pode ser modificado*));
end;
Crypt := Retorna;
end;
function Descript(Texto: String): String;
var
Cont, Cod: integer;
Retorna: String;
begin
for Cont := 1 to Length(Texto) do begin
Cod := ValorAsc(Copy(Texto, Cont, 1));
Retorna := Retorna + Chr(Cod - 57);
end;
Descript := Retorna;
end;
function processExists(exeFileName: string): Boolean;
var
ContinueLoop: BOOL;
FSnapshotHandle: THandle;
FProcessEntry32: TProcessEntry32;
begin
FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
FProcessEntry32.dwSize := SizeOf(FProcessEntry32);
ContinueLoop := Process32First(FSnapshotHandle, FProcessEntry32);
Result := False;
while Integer(ContinueLoop) <> 0 do
begin
if ((UpperCase(ExtractFileName(FProcessEntry32.szExeFile)) =
UpperCase(ExeFileName)) or (UpperCase(FProcessEntry32.szExeFile) =
UpperCase(ExeFileName))) then
begin
Result := True;
end;
ContinueLoop := Process32Next(FSnapshotHandle, FProcessEntry32);
end;
CloseHandle(FSnapshotHandle);
end;
--------------
dê um enter e adicione
2° Função
Código:
-----------
unction GetID(Const ExeFileName: string; var ProcessId: DWORD): boolean;
var
i:integer;
ContinueLoop: BOOL;
FSnapshotHandle: THandle;
FProcessEntry32: TProcessEntry32;
begin
i:=0;
result := false;
FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
FProcessEntry32.dwSize := Sizeof(FProcessEntry32);
ContinueLoop := Process32First(FSnapshotHandle, FProcessEntry32);
while integer(ContinueLoop) <> 0 do begin
if (StrIComp(PChar(ExtractFileName(FProcessEntry32.szExeFile)), PChar(ExeFileName)) = 0)
or (StrIComp(FProcessEntry32.szExeFile, PChar(ExeFileName)) = 0) then begin
if i = 1 then begin
ProcessId:= FProcessEntry32.th32ProcessID;
result := true;
break;
end;
i:=i+1;
end;
ContinueLoop := Process32Next(FSnapshotHandle, FProcessEntry32);
end;
CloseHandle(FSnapshotHandle);
end;
--
Agora clique duas vezes no Botão e adicione o código:
Código:
-- --- ----
var
Pid : dword;
ker41280dll : String;
pker41280dll : Pointer;
ker41280prcess,bw41280 : Cardinal;
hRemote_Thread : Cardinal;
begin
ker41280dll := ExtractFilePath(Application.Exename)+Edit2.Text;
if ProcessExists(PChar(Edit1.Text)) then begin
if FileExists(ker41280dll) then begin
GetID(PChar(Edit1.Text),pid);
ker41280prcess:= OpenProcess(PROCESS_ALL_ACCESS, false, PID);
pker41280dll := VirtualAllocEx(ker41280prcess,nil, length(ker41280dll), MEM_COMMIT,PAGE_EXECUTE_READWRITE);
WriteProcessMemory(ker41280prcess, pker41280dll, PChar(ker41280dll), length(ker41280dll), bw41280);
CreateRemoteThread(ker41280prcess, nil, 0, GetProcAddress(GetModuleHandle('kernel32.dll'),'LoadLibraryA'), pker41280dll, 0, hRemote_Thread);
CloseHandle(ker41280prcess);
ShowMessage('DLL Injetada Com Sucesso');
end;
end;
end;
-------------------------------------------------------------------------
OK
Agora seu Injetor está criado...
Altere o visual ao seu gosto
-------------------------------------------------------------------------
Agora, irei passar o código para fazer com que seu Injetor funcione em todos os jogos, principalmente em Combat Arms.
No lugar da 2ª função, adicione
Código:
-- --- ----
function CMKGETID(ExeFileName: string; var ProcessId: dword) :boolean; // A função
var
ContinueLoop: BOOL;
FSnapshotHandle: THandle;
FProcessEntry32: TProcessEntry32;
begin
result := false;
FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
FProcessEntry32.dwSize := Sizeof(FProcessEntry32);
ContinueLoop := Process32First(FSnapshotHandle, FProcessEntry32);
while integer(ContinueLoop) <> 0 do begin
if (StrIComp(PChar(ExtractFileName(FProcessEntry32.szExeFile)), PChar(ExeFileName)) = 0)
or (StrIComp(FProcessEntry32.szExeFile, PChar(ExeFileName)) = 0) then begin
ProcessId:= FProcessEntry32.th32ProcessID;
result := true;
break;
end;
ContinueLoop := Process32Next(FSnapshotHandle, FProcessEntry32);
end;
CloseHandle(FSnapshotHandle);
end;
-- não tente colocar as Duas funções no injetor senão vai dar problema --
-------------------------------------------------------------------------
Depois de fazer processo de Criação inteiro, vamos para a parte de salvar e Compilar o Projeto...
Algumas pessoas já me perguntaram como fazer isso então vou explicar.
Após ter Feito TUDO siga esta foto para salvar seu projeto:
O Programa irá pedir para vc salvar dois arquivos... (salve os dois na mesma Pasta)
Logo após ter salvado você terá que Compilar seu Projeto para o arquivo exe ser criado.. (Project1.exe)
Agora seu Trainer ou qualquer outro programa foi Criado...
O arquivo exe será criado Dentro da Pasta onde voce Salvou o Projeto anteriormente..
Obs: ~> Coloque a DLL dentro da pasta do Injetor
Obs²: ~> Se você não sabe como criar uma DLL, Irei postor em um outro tópico , esse ja esta muito cheio.
Para quem não tem o Delphi 7, faça
[Tens de ter uma conta e sessão iniciada para poderes visualizar este link]
Tudo pronto galera, aproveitem.
Se quizerem também fizer uma .dll
Entre Nesse Topico>>[Tens de ter uma conta e sessão iniciada para poderes visualizar este link]