bulhufas How do I cheat?
Reputation: 0
Joined: 06 Nov 2009 Posts: 9
|
Posted: Fri Nov 13, 2009 2:44 pm Post subject: [Delphi] Why doesn't is work? |
|
|
I'm trying to protect GetCursorPos against most common hooks, but I receive lots of errors.
In library:
| Code: |
...
...
var hUser32: THandle;
...
function BulhufasGetCursorPos(var lpPoint: TPoint): BOOL; stdcall;
var dwOriginalAPI: DWORD;
begin
dwOriginalAPI := DWORD(GetProcAddress( hUser32, 'GetCursorPos')) + 5;
asm
mov edi,edi
push ebp
mov ebp,esp
jmp [dwOriginalAPI]
//I already tried to put "jmp dword ptr ds:[dwOriginalAPI]", but it doesn't work.
end;
end;
...
...
exports BulhufasGetCursorPos;
...
...
begin
hUser32 := GetModuleHandle('user32.dll');
if hUser32 = INVALID_HANDLE_VALUE then
hUser32 := LoadLibrary('user32.dll');
end.
|
In application:
| Code: |
...
...
implementation
{$R *.dfm}
function BulhufasGetCursorPos(var lpPoint: TPoint): BOOL; stdcall; external 'Bulhufas.dll' name 'BulhufasGetCursorPos';
procedure TForm1.Timer1Timer(Sender: TObject);
var lpPoint: TPoint;
begin
if BulhufasGetCursorPos(lpPoint) = true then
Edit1.Text := 'True'
else
Edit1.Text := 'False';
Edit1.Text := Edit1.Text + ' ' + IntToStr(lpPoint.X) + ', ' + IntToStr(lpPoint.Y);
end;
|
Error: Access violation, normally in $70000000+ trying to write to $70000000+
|
|