|
发表于 2014-4-12 05:58:45
|
显示全部楼层
unit Unit_function;
{$WARNINGS OFF}
{$HINTS OFF}
interface
uses
Windows, Messages;
procedure GameMain(GameHwd: HWND);
type
TMemoryCtrl = class
procedure WriteIntegerMemory(Address: string; Value: Integer); overload;
procedure WriteIntegerMemory(Address, Value: Integer); overload;
function ReadIntegerMemory(Address: string): Integer; overload;
function ReadIntegerMemory(Address: Integer): Integer; overload;
end;
var
SDZT, JSZT: Boolean;
MemoryCtrl: TMemoryCtrl;
PeopleBaseAddress, BaseAddressItems, InvincibleBaseAddress, lastValue:
Integer;
implementation
procedure TMemoryCtrl.WriteIntegerMemory(Address: string; Value: Integer);
begin
PInteger(HexToInt(Address))^ := Value;
end;
procedure TMemoryCtrl.WriteIntegerMemory(Address, Value: Integer);
begin
PInteger(Address)^ := Value;
end;
function TMemoryCtrl.ReadIntegerMemory(Address: string): Integer;
begin
Result := PInteger(HexToInt(Address))^;
end;
function TMemoryCtrl.ReadIntegerMemory(Address: integer): Integer;
begin
Result := PInteger(Address)^;
end;
procedure SD();
begin
while SDZT = True do
begin
MemoryCtrl.WriteIntegerMemory(PeopleBaseAddress + 14732, 1);
Sleep(200);
end;
end;
procedure JSD();
begin
while JSZT = True do
begin
MemoryCtrl.WriteIntegerMemory(PeopleBaseAddress + 8596, 4); //1E4C+348
MemoryCtrl.WriteIntegerMemory(PeopleBaseAddress + 7840, 4); //1E50+50
Sleep(200);
end;
end;
procedure GameMain(GameHwd: HWND);
var
msg: TMsg;
TH: Cardinal;
LastSpeed: Integer;
WDZT, BTZT: Boolean;
begin
WDZT := False;
BTZT := False;
SDZT := False;
RegisterHotKey(0, VK_F1, 0, VK_F1);
RegisterHotKey(0, VK_F2, 0, VK_F2);
RegisterHotKey(0, VK_F3, 0, VK_F3);
RegisterHotKey(0, VK_F4, 0, VK_F4);
RegisterHotKey(0, VK_F5, 0, VK_F5);
RegisterHotKey(0, VK_F6, 0, VK_F6);
RegisterHotKey(0, VK_F7, 0, VK_F7);
RegisterHotKey(0, VK_F8, 0, VK_F8);
RegisterHotKey(0, VK_F9, 0, VK_F9);
RegisterHotKey(0, VK_F10, 0, VK_F10);
RegisterHotKey(0, VK_F11, 0, VK_F11);
RegisterHotKey(0, VK_F12, 0, VK_F12);
MessageBox(0, 'JB,开启好了!', '消息', MB_OK + MB_ICONINFORMATION);
while GetMessage(msg, 0, 0, 0) do
begin
if msg.message = wm_hotkey then
begin
PeopleBaseAddress := MemoryCtrl.ReadIntegerMemory('10CF69C');
BaseAddressItems := MemoryCtrl.ReadIntegerMemory('01080FD4');
if msg.wParam = VK_F1 then //无敌
begin
if WDZT = False then //开启无敌
begin
InvincibleBaseAddress := MemoryCtrl.ReadIntegerMemory(PeopleBaseAddress
+ 1192);
lastValue := MemoryCtrl.ReadIntegerMemory(PeopleBaseAddress + 8580);
MemoryCtrl.WriteIntegerMemory(PeopleBaseAddress + 8580,
InvincibleBaseAddress);
WDZT := True;
end
else //关闭无敌
begin
MemoryCtrl.WriteIntegerMemory(PeopleBaseAddress + 8580, lastValue);
WDZT := False;
end;
end
else if msg.wParam = VK_F2 then //霸体
begin
if BTZT = False then
begin
MemoryCtrl.WriteIntegerMemory(PeopleBaseAddress + 1264, 1);
BTZT := True;
end
else
begin
MemoryCtrl.WriteIntegerMemory(PeopleBaseAddress + 1264, 0);
BTZT := False;
end;
end
else if msg.wParam = VK_F3 then //双刀
begin
if SDZT = False then
begin
SDZT := True;
// BeginThread(nil, 0, @SD, nil, 0, TH);
end
else
begin
SDZT := False;
end;
end
else if msg.wParam = VK_F4 then //破防御
begin
MemoryCtrl.WriteIntegerMemory(PeopleBaseAddress + 8904, 1); //1E38+490
end
else if msg.wParam = VK_F5 then //物理追加
begin
// MemoryCtrl.WriteIntegerMemory(PeopleBaseAddress + 8776, 0); //1E38+410
// MemoryCtrl.WriteIntegerMemory(PeopleBaseAddress + 8784,
// MemoryCtrl.ReadIntegerMemory(BaseAddressItems + 896)); //1E38+418
//
// MemoryCtrl.WriteIntegerMemory(PeopleBaseAddress + 8792,
// MemoryCtrl.ReadIntegerMemory(PeopleBaseAddress + 7816)); //1E38+50
MessageBox(0, '暂无!', '消息', MB_OK + MB_ICONINFORMATION);
end
else if msg.wParam = VK_F6 then //石化
begin
MemoryCtrl.WriteIntegerMemory(PeopleBaseAddress + 6948,
MemoryCtrl.ReadIntegerMemory(PeopleBaseAddress + 8072)); //1B24
MemoryCtrl.WriteIntegerMemory(PeopleBaseAddress + 8648,7); //1E38+390=7
MemoryCtrl.WriteIntegerMemory(PeopleBaseAddress + 6508,
MemoryCtrl.ReadIntegerMemory(PeopleBaseAddress + 8664)); //1E38+3A0
end
else if msg.wParam = VK_F7 then //加攻击
begin
MessageBox(0, '暂无!', '消息', MB_OK + MB_ICONINFORMATION);
end
else if msg.wParam = VK_F8 then //减少伤害
begin
MemoryCtrl.WriteIntegerMemory(PeopleBaseAddress + 8776, 2); //1E38+410=2
MemoryCtrl.WriteIntegerMemory(PeopleBaseAddress + 8784, 4); //1E38+418
MemoryCtrl.WriteIntegerMemory(PeopleBaseAddress + 896, 4); //380
end
else if msg.wParam = VK_F9 then //地图加速
begin
LastSpeed := MemoryCtrl.ReadIntegerMemory(PeopleBaseAddress + 1754);
if JSZT = False then
begin
JSZT:=True;
BeginThread(nil, 0, @JSD, nil, 0, TH);
end else
begin
MemoryCtrl.WriteIntegerMemory(PeopleBaseAddress + 1964, LastSpeed);
JSZT:=False;
end;
end
else if msg.wParam = VK_F10 then //锁定装备免维修
begin
MemoryCtrl.WriteIntegerMemory(PeopleBaseAddress + 221581541, 4);
//OC517CF9+OE393EC
MemoryCtrl.WriteIntegerMemory(PeopleBaseAddress + 2544293, 4); //26D2A5
end
else if msg.wParam = VK_F11 then
begin
//出售
MemoryCtrl.WriteIntegerMemory(BaseAddressItems + 7336, 5);
end
else if msg.wParam = VK_F12 then
begin
MemoryCtrl.WriteIntegerMemory(BaseAddressItems + 7336, 6);
end;
end;
end;
end;
end. |
|