Witam,
Mam problem, może najpierw source,
Kod:
var
Form1: TForm1;
WindowName : integer;
ProcessId : integer;
ThreadId : integer;
buf : PChar;
whbuf1 : PChar;
whbuf2 : PChar;
HandleWindow : Integer;
write : cardinal;
MessageBuffer:TEventMsg;
Const
WindowTitle = 'jakiś program';
whadres1 = $jakiś adres;
whadres2 = $jakiś adres;
whon1 = [$e9,$0a,$02,$00,$00,$90];
whon2 = [$90,$90,$90,$90,$90,$90];
whoff1 = [$0f,$85,$09,$02,$00,$00];
whoff2 = [$0f,$85,$ce,$00,$00,$00];
iloscbyte2 = 6;
procedure TForm1.KeySpyXP2Key(Sender: TObject; key: String);
begin
If Key='{SCROLL LOCK ON}' then begin
WindowName := FindWindow(nil,WindowTitle);
ThreadId := GetWindowThreadProcessId(WindowName,@ProcessId);
HandleWindow := OpenProcess(PROCESS_ALL_ACCESS,False,ProcessId);
GetMem(whbuf1,1);
whbuf1^ := Chr(whon1);
WriteProcessMemory(HandleWindow,ptr(whadres1),whbuf1,iloscbyte2,write);
FreeMem(whbuf1);
GetMem(whbuf2,1);
whbuf2^ := Chr(whon2);
WriteProcessMemory(HandleWindow,ptr(whadres2),whbuf2,iloscbyte2,write);
FreeMem(whbuf2);
closehandle(HandleWindow);
if Key='{SCROLL LOCK OFF}' then begin
WindowName := FindWindow(nil,WindowTitle);
ThreadId := GetWindowThreadProcessId(WindowName,@ProcessId);
HandleWindow := OpenProcess(PROCESS_ALL_ACCESS,False,ProcessId);
GetMem(whbuf1,1);
whbuf1^ := Chr(whoff1);
WriteProcessMemory(HandleWindow,ptr(whadres1),whbuf1,iloscbyte2,write);
FreeMem(whbuf1);
GetMem(whbuf2,1);
whbuf2^ := Chr(whoff2);
WriteProcessMemory(HandleWindow,ptr(whadres2),whbuf2,iloscbyte2,write);
FreeMem(whbuf2);
closehandle(HandleWindow);
end;
end;
end;
Chodzi o to by pod dane adresy zedytować 6 bajtów lecz nie mogę tego skompilować teraz a jak stałe zapisałem jako np $eb+$00 ... to wpisywało ale zawsze max 2 bajty i przez to program się wysypywał, w Cheat Engine wszystko śmiga jeden adres muszę eb a drugi znopować,
Jak edytuję inny adres, i jeden byte to wszystko działa. Proszę o Szybką odpowiedź