यूनिट FastCodePatch.pas Win32 प्लेटफार्म में काम करता है। डेल्फी एक्सई 2 Win64 प्लेटफ़ॉर्म का समर्थन करता है, किसी भी विचार को Win64 प्लेटफॉर्म में FastCodePatch कैसे काम करता है?डेल्फी XE2 Win64 मंच में FastCodePatch कैसे काम करें?
unit FastcodePatch;
interface
function FastcodeGetAddress(AStub: Pointer): Pointer;
procedure FastcodeAddressPatch(const ASource, ADestination: Pointer);
implementation
uses
Windows;
type
PJump = ^TJump;
TJump = packed record
OpCode: Byte;
Distance: Pointer;
end;
function FastcodeGetAddress(AStub: Pointer): Pointer;
begin
if PBYTE(AStub)^ = $E8 then
begin
Inc(Integer(AStub));
Result := Pointer(Integer(AStub) + SizeOf(Pointer) + PInteger(AStub)^);
end
else
Result := nil;
end;
procedure FastcodeAddressPatch(const ASource, ADestination: Pointer);
const
Size = SizeOf(TJump);
var
NewJump: PJump;
OldProtect: Cardinal;
begin
if VirtualProtect(ASource, Size, PAGE_EXECUTE_READWRITE, OldProtect) then
begin
NewJump := PJump(ASource);
NewJump.OpCode := $E9;
NewJump.Distance := Pointer(Integer(ADestination) - Integer(ASource) - 5);
FlushInstructionCache(GetCurrentProcess, ASource, SizeOf(TJump));
VirtualProtect(ASource, Size, OldProtect, @OldProtect);
end;
end;
end.
विल Krumlinde द्वारा प्रदान समाधान 64 बिट्स पैकेज पर काम नहीं करता। यह केवल स्टैंडअलोन .exe एप्लिकेशन पर काम करता है।
यह वास्तव में है एक अलग प्रश्न का उत्तर। विले ने आपके मूल प्रश्न का उत्तर दिया। पैकेज में पैचिंग फ़ंक्शंस एक अलग गेम है। आपके द्वारा प्रस्तुत कोड 32 बिट लक्ष्यों पर भी आवश्यक है। –
ग्रेट कोड ! मैं पुष्टि करता हूं कि यह 'डेल्फी 10.1' (बर्लिन) के साथ 32/64-बिट' विंडोज 7' के तहत पूरी तरह से काम करता है, यहां तक कि 'डीईपी' सक्षम भी है। –