Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure HookThread(dwAddress : dword; Func : Pointer);
- var
- OldProtect, hID : dword;
- begin
- VirtualProtect(Ptr(dwAddress), 5, PAGE_EXECUTE_READWRITE, OldProtect);
- Pbyte(dwAddress)^ := $E9;
- Pdword(dwAddress+1)^ := dword(func) - dwAddress - 5;
- CreateThread(nil, 0, Ptr(dwAddress), nil, 0, hID);
- VirtualProtect(Ptr(dwAddress), 5, OldProtect, OldProtect);
- end;
- Procedure lalau1;
- begin
- form1 := Tform1.Create(nil);
- form1.ShowModal;
- End;
- Begin
- HookThread(LoadLibrary('DINPUT8.dll')+5, @lalau1);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement