 |
SorcCode[Dotahack] - Баги, читы и статьи по Dota 2 - Уязвимости, баги, читы и статьи по Dota 2 в этом разделе. Темы с вопросами/просьбами запрещены! |
30.08.2014, 13:33
|
#1
|
|
|
|
|
|
Рыцарь-защитник
|
 Регистрация: 03.01.2012
 Сообщений: 618
 Популярность: 38757
 Сказал(а) спасибо: 365
Поблагодарили 511 раз(а) в 307 сообщениях
|
SorcCode[Dotahack]
Небольшой алгоритм:
1) Патчит память, изменяет консольные комманды, достигает эффекта трёх функций: Camera_hack, Entbox, Wireframe.
2) Получает здоровье\ману всех игроков.
Вот набросок, но 1 пункт в этом алгоритме он уже умеет исправлять. (тащем-то, как и второй, если дописать).
Код:
library Project2;
uses
SysUtils, Classes, Windows,
EDH_Offsets,
EDH_Drawing,
EDH_Hooking;
{$R *.res}
function EDH_GetModuleInfo: Boolean;
begin
Window := FindWindow('valve001', nil);
if not (Window <> 0) then Result := False;
try
Thread := GetWindowThreadProcessId(Window, @Process);
Handle := OpenProcess(PROCESS_ALL_ACCESS, False, Process);
except
Result := False;
end;
Engine := GetModuleHandle('engine.dll');
Server := GetModuleHandle('server.dll');
OpenGL := GetModuleHandle('opengl32.dll');
if (Engine <> 0) and (Server <> 0) and (OpenGL <> 0)
then Result := True
else Result := False;
end;
procedure ESH_Render;
var
TempValue: Cardinal;
begin
TempValue := Hook_GetValue(Engine, oECamera_hack, 8);
Hook_SetValue(TempValue,$2,8);
end;
procedure ESH_PlayerInfo;
begin
end;
begin
if not EDH_GetModuleInfo then ErrorMsg(mEModule) else
begin
while True do
begin
ESH_Render;
ESH_PlayerInfo;
end;
end;
end.
Код:
unit EDH_Offsets;
interface
uses SysUtils;
const
// INTERFACE:
g_maxplayer = 21;
g_minplayer = 1;
// ENGINE:
oECamera_hack = $51041C; // r_aspectratio
oEEntbox = $51C168; // r_drawlightcache
oEWireframe = $1116D30; // r_drawothermodels
// SERVER:
oEntIndent = $C0;
oEntOffset = $F49E34;
oEntHealth = $E0;
oEntHealth_Ident = $4;
// APPLICATION
mEModule = 'Search failed: required modules not found.';
mEMemory = 'Action failed: error writing in memory.';
type
player_type = record
Name: Integer;
Health: Integer;
Mana: Integer;
end;
var
Engine: Cardinal = 0;
Server: Cardinal = 0;
OpenGL: Cardinal = 0;
Thread, Handle, Window, Process: Integer;
Player: array [g_minplayer..g_maxplayer] of player_type;
implementation
end.
Код:
unit EDH_Hooking;
interface
uses SysUtils, Windows, EDH_Offsets, EDH_Drawing;
function Hook_GetValue(Addr, Prt, Size: Cardinal): Cardinal;
function Hook_SetValue(Addr, Value, Size: Cardinal): Boolean;
procedure ErrorMsg(msg: PChar);
implementation
function Hook_GetValue(Addr, Prt, Size: Cardinal): Cardinal;
var
TempAddr, TempResult, TempValue, TempType, TempRead: Cardinal;
begin
ReadProcessMemory(Handle, Ptr(Addr), @TempAddr, Size, TempRead);
TempValue := TempAddr + Prt;
ReadProcessMemory(Handle, Ptr(TempValue), @TempResult, Size, TempRead);
Result := TempResult;
end;
function Hook_SetValue(Addr, Value, Size: Cardinal): Boolean;
var
TempWrite: Cardinal;
Buffer: PChar;
begin
GetMem(Buffer,1);
Buffer := PChar(IntToStr(Value));
if WriteProcessMemory(Handle, Ptr(Addr), Buffer, Size, TempWrite) then
Result := True;
end;
procedure ErrorMsg(msg: PChar);
begin
msg := PChar(msg + #10+#10+ 'Application will be closed.'+#10+'Sorry :C');
MessageBox(0, msg, 'EDH Error:', MB_ICONERROR);
Halt;
end;
end.
В модуле EDH_Drawing будет реализованы отображения визуалов через OpenGL.
Не очень правильно со стороны трейнера, ибо мы почти не юзаем функции движка, однако, это намного быстрее. (а на самом деле, у меня виснет CE какого-то [[[).
Добавлено через 5 часов 58 минут
Теперь выполняем оба действия, патчим память и получаем информацию о здоровье игроков.
Код:
procedure ESH_Render;
begin
if // Patching:
not Hook_SetValue(Hook_GetValue(Engine, oECamera_hack, 8),$2,8) or
not Hook_SetValue(Hook_GetValue(Engine, oEEntbox, 8),$1,8) or
not Hook_SetValue(Hook_GetValue(Engine, oEWireframe, 8),$1,8)
then ErrorMsg(mWMemory);
end;
procedure ESH_PlayerInfo;
var
PlayerCount: Byte; gPlayer, oPlayer: Cardinal;
begin
gPlayer := oEntOffset;
for PlayerCount := g_minplayer to g_maxplayer do
begin
gPlayer := gPlayer + oEntIndent;
oPlayer := Hook_GetValue(Server, gPlayer, 4);
Player[PlayerCount].MaxHealth := Hook_GetValue(oPlayer, oEntHealthM, 4);
Player[PlayerCount].CurHealth := Hook_GetValue(oPlayer, oEntHealthC, 4);
if not
IsValidValue(Player[PlayerCount].MaxHealth, Player[PlayerCount].CurHealth)
then Continue;
end;
end;
Код:
oEntIndent = $C0;
oEntOffset = $F49D74;
oEntHealthM = $E0;
oEntHealthC = $E4;
Код:
mSModule = 'Search failed: required modules not found.';
mWMemory = 'Action failed: error writing in memory.';
mRMemory = 'Action failed: error reading in memory.';
mCConfig = 'Action failed: error reading settings file.';
Код:
type
select_type = record
Enabled: Boolean;
Value: Cardinal;
end;
type
patching_type = record
Camera, EntBox, WireFrame: select_type;
end;
type
player_type = record
Name: Integer;
MaxHealth: Integer;
CurHealth: Integer;
Mana: Integer;
end;
const
g_maxplayer = 21;
g_minplayer = 1;
var
Patching: patching_type;
Player: array [g_minplayer..g_maxplayer] of player_type;
Код:
function IsValidValue(Max, Cur: Cardinal): Boolean;
begin
if (Cur > Max) and (Max < 1) and (Max > 25000)
then Result := False
else Result := True;
end;
Cvar
Код:
oHLOffset = $F49D74; // здоровье
oMNOffset = $F49E34; // мана
oHLIndent = $C0; // отступ
oMNIndent = $98; // тут не правильно, потом исправлю
oEntHealthM = $E4; // смещение до максимального здоровья
oEntHealthC = $E0; // смещение до текущего здоровья
oEntManaM = $978; // .. максимальной маны
oEntManaC = $974; // .. текущей маны
Последний раз редактировалось jaja123; 30.08.2014 в 19:33.
Причина: Добавлено сообщение
|
|
|
|
Ваши права в разделе
|
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения
HTML код Выкл.
|
|
|
Заявление об ответственности / Список мошенников
Часовой пояс GMT +4, время: 19:30.
|
 |