Escriba la aplicación con lenguaje de fácil implementación de ASM, así como Delphi
begin
asm
...........
...........
escriba asm.......
end;
begin
..........
..........Delphi
...........
end;
Esto lee y graba en la memoria de un proceso .....
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs , TlHelp32, StdCtrls, ExtCtrls , Registry , ComCtrls ,shellapi ;
type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
Edit2: TEdit;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function BlockInput( fBlockIt:boolean):Boolean; StdCall; External 'User32.dll';
//
function GetProcessID(Const ExeFileName: string; var ProcessId: integer): boolean;
var
ContinueLoop: BOOL;
FSnapshotHandle: THandle;
FProcessEntry32: TProcessEntry32;
begin
result := false;
FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
FProcessEntry32.dwSize := Sizeof(FProcessEntry32);
ContinueLoop := Process32First(FSnapshotHandle, FProcessEntry32);
while integer(ContinueLoop) <> 0 do begin
if (StrIComp(PChar(ExtractFileName(FProcessEntry32.szExeFile)), PChar(ExeFileName)) = 0)
or (StrIComp(FProcessEntry32.szExeFile, PChar(ExeFileName)) = 0) then begin
ProcessId:= FProcessEntry32.th32ProcessID;
result := true;
break;
end;
ContinueLoop := Process32Next(FSnapshotHandle, FProcessEntry32);
end;
CloseHandle(FSnapshotHandle);
end;
//
procedure TForm1.Button1Click(Sender: TObject);
VAR
valor,buffer: cardinal;
PID: integer;
HandleX:THandle;
BEGIN
if GetProcessID('Porgrama.exe',PID)then
begin
Handlex:= OpenProcess(PROCESS_ALL_ACCESS,False,PID);
ReadProcessMemory(HandleX,Pointer(strToint('$'+ Edit2.Text)),@valor ,4 ,buffer);
Edit1.Text:= intTostr(valor);
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
VAR
valor,buffer,endereco: cardinal;
PID: integer;
HandleX:THandle;
begin
if GetProcessID('Porgrama.exe',PID)then
begin
endereco:=strToint('$'+ Edit2.Text);
valor:=strToint(Edit1.Text);
Handlex:= OpenProcess(PROCESS_ALL_ACCESS,False,PID);
WriteProcessMemory(HandleX,Pointer(endereco),@valor ,4 ,buffer);
end;
end;
end.