Postado Maio 27, 2012 12 anos Olá pessoal, apartir do update 9.1, a Cipsoft botou um novo sistema, que agora os programadores precisam pegar a base do endereço para o seu bot funcionar perfeitamente em computadores com sistemas operacionais Windows 7 e Windows Vista. Bom, foi um sistema falho... Declare nas uses: PsAPI Declare a função necessaria para pegar a base do endereço: function GetTibiaBaseAddress(ProcessID: Cardinal): Pointer; var Modules: Array of HMODULE; cbNeeded, i: Cardinal; ModuleInfo: TModuleInfo; ModuleName: Array [0 .. MAX_PATH] of Char; PHandle: THandle; begin Result := nil; SetLength(Modules, 1024); PHandle := OpenProcess(PROCESS_QUERY_INFORMATION + PROCESS_VM_READ, FALSE, ProcessID); if (PHandle <> 0) then begin EnumProcessModules(PHandle, @Modules[0], 1024 * SizeOf(HMODULE), cbNeeded); SetLength(Modules, cbNeeded div SizeOf(HMODULE)); for i := 0 to Length(Modules) - 1 do begin GetModuleBaseName(PHandle, Modules[i], ModuleName, SizeOf(ModuleName) ); if AnsiCompareText('Tibia.exe', ModuleName) = 0 then begin GetModuleInformation(PHandle, Modules[i], @ModuleInfo, SizeOf (ModuleInfo)); Result := ModuleInfo.lpBaseOfDll; CloseHandle(PHandle); Exit; end; end; end; end; Declare as variaveis: PH: THandle; PID, Thid: Dword; Offset: Integer; TibiaH: THandle Declare a função para ler os endereços de memoria: function ReadInteger(Address: Integer): Integer; var value: Integer; ler: Dword; begin Thid := GetWindowThreadProcessId(TibiaH, @PID); PH := OpenProcess(PROCESS_ALL_ACCESS, FALSE, PID); ReadProcessMemory(PH, Ptr(Address), @value, 4, ler); Result := value; end; Declare a função para pegar o ProcessID: function ProcessID: Integer; begin TibiaH := FindWindow('TibiaClient', nil); Thid := GetWindowThreadProcessId(TibiaH, @PID); PH := OpenProcess(PROCESS_ALL_ACCESS, FALSE, PID); Result := PID; end; Pronto, agora já podemos burlar o sistema da Cipsoft. Agora um simples exemplo de como você deve usar: Declare as consts: const adrXOR = $7ADFD0; adrMyHP = $943000; adrMyMana = $7AE024; Agora, declare a função para retornar o Health do seu character: function PlayerHealth: Integer; var HP: Integer; uXor: Integer; begin Offset := Integer(GetTibiaBaseAddress(ProcessID)); HP := ReadInteger((adrMyHP + Offset) - $400000); uXor := ReadInteger((adrXOR + Offset) - $400000); Result := HP xor uXor; end; Função para pegar a Mana do seu character: function PlayerMana: Integer; var Mana: Integer; uXor: Integer; begin Offset := Integer(GetTibiaBaseAddress(ProcessID)); Mana := ReadInteger((adrMyMana + Offset) - $400000); uXor := ReadInteger((adrXOR + Offset) - $400000); Result := Mana xor uXor; end; Vou deixar como o meu .pas ficou: Qualquer duvida, só postar. { --------------------------- Feito por Kimoszin www.TibiaKing.com ---------------------------- } unit uMain; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, PsAPI, StdCtrls; type TForm1 = class(TForm) lbHealth: TLabel; Button1: TButton; lbMana: TLabel; procedure Button1Click(Sender: TObject); private public end; var Form1: TForm1; { Variaveis } PH: THandle; PID, Thid: Dword; Offset: Integer; TibiaH: THandle; implementation {$R *.dfm} { Endereços de Memoria Tibia 9.53 } const adrXOR = $7ADFD0; adrMyHP = $943000; adrMyMana = $7AE024; { Função para ler números (Int)eiros } function ReadInteger(Address: Integer): Integer; var value: Integer; ler: Dword; begin Thid := GetWindowThreadProcessId(TibiaH, @PID); PH := OpenProcess(PROCESS_ALL_ACCESS, FALSE, PID); ReadProcessMemory(PH, Ptr(Address), @value, 4, ler); Result := value; end; { Função para pegar o número do processo do Tibia } function ProcessID: Integer; begin TibiaH := FindWindow('TibiaClient', nil); Thid := GetWindowThreadProcessId(TibiaH, @PID); PH := OpenProcess(PROCESS_ALL_ACCESS, FALSE, PID); Result := PID; end; { Função para pegar o endereço base do Tibia } function GetTibiaBaseAddress(ProcessID: Cardinal): Pointer; var Modules: Array of HMODULE; cbNeeded, i: Cardinal; ModuleInfo: TModuleInfo; ModuleName: Array [0 .. MAX_PATH] of Char; PHandle: THandle; begin Result := nil; SetLength(Modules, 1024); PHandle := OpenProcess(PROCESS_QUERY_INFORMATION + PROCESS_VM_READ, FALSE, ProcessID); if (PHandle <> 0) then begin EnumProcessModules(PHandle, @Modules[0], 1024 * SizeOf(HMODULE), cbNeeded); SetLength(Modules, cbNeeded div SizeOf(HMODULE)); for i := 0 to Length(Modules) - 1 do begin GetModuleBaseName(PHandle, Modules[i], ModuleName, SizeOf(ModuleName) ); if AnsiCompareText('Tibia.exe', ModuleName) = 0 then begin GetModuleInformation(PHandle, Modules[i], @ModuleInfo, SizeOf (ModuleInfo)); Result := ModuleInfo.lpBaseOfDll; CloseHandle(PHandle); Exit; end; end; end; end; { Função que retornar o Health(Vida) do personagem } function PlayerHealth: Integer; var HP: Integer; uXor: Integer; begin Offset := Integer(GetTibiaBaseAddress(ProcessID)); HP := ReadInteger((adrMyHP + Offset) - $400000); uXor := ReadInteger((adrXOR + Offset) - $400000); Result := HP xor uXor; end; { Função que retornar a Mana do personagem } function PlayerMana: Integer; var Mana: Integer; uXor: Integer; begin Offset := Integer(GetTibiaBaseAddress(ProcessID)); Mana := ReadInteger((adrMyMana + Offset) - $400000); uXor := ReadInteger((adrXOR + Offset) - $400000); Result := Mana xor uXor; end; procedure TForm1.Button1Click(Sender: TObject); begin { Modo de usar } lbHealth.Caption := 'Health: ' + IntToStr(PlayerHealth); lbMana.Caption := 'Mana: ' + IntToStr(PlayerMana); end; end. Editado Junho 11, 2012 12 anos por Kimoszin (veja o histórico de edições)
Postado Maio 27, 2012 12 anos Muito bom kimos, ótimo tutorial, eu mesmo não entendo nada disso rs. Reputado!
Postado Junho 28, 2012 12 anos . Editado Fevereiro 16, 2013 12 anos por yurinho190 (veja o histórico de edições)
Postado Agosto 10, 2012 12 anos Boa noite, eu testei aqui mas não funcionou não, o resultado vem 0, o que pode ter acontecido? testado no rad. Editado Agosto 10, 2012 12 anos por ediat12 (veja o histórico de edições)
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.