Jest to adres z olydbg. Niestety nie ogarniam debuggera na tyle, by ogarnąć co jest nie tak :D
Nie wiem no. Na moje oko wygląda to dobrze.
Proszę. Oto exe:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Edit1: TEdit;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
PH: THandle;
PID, ThID: DWORD;
H: THandle;
implementation
procedure FSpeech(AType: Byte; AText:PChar); cdecl; external 'oskar.dll';
{$R *.dfm}
procedure Hook;
begin
H := FindWindow('', nil);
if (H <> 0) then
begin
ThID := GetWindowThreadProcessId(H, @PID);
PH := OpenProcess(PROCESS_ALL_ACCESS, FALSE, PID);
FlashWindow(H, true)
end
else
begin
ShowMessage('Open your ...!');
Application.Terminate;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
hook;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
fspeech(1,'lol');
end;
end.
A to .dll:
library oskar;
uses
SysUtils,
Classes,
Messages,
Windows;
{$R *.res}
procedure FSpeech(AType: Byte; AText:PChar); cdecl; export;
const
Adr = $004073F0;
var
FSpeech: procedure(AType: Byte; AText:PChar);
begin
@FSpeech := Ptr(Adr);
end;
exports
FSpeech;
end.
Jakby ktoś wpadł na to co jest nie tak to niech pomoże. Ja nadal będę kombinować. Jak mi coś wyjdzie to dam znać xd