v2.0 2015-07-11html
更新了V2.0 版本 發佈在吾愛破解論壇 歡迎下載使用windows
http://www.52pojie.cn/thread-382769-1-1.htmlide
--------------------------------------------------------------------------函數
v1.0 2013-06-23oop
用delphi編寫 發佈在吾愛破解論壇 spa
http://www.52pojie.cn/thread-201353-1-1.htmlcode
unit super; interface uses windows, Messages, Tlhelp32; //----------------函數聲明 function GetProcessId(strProcessName: string): Integer; //取進程ID function dkjc_OpenProcess_Z(nProcessID: Integer): Integer; //打開進程 function dnczs_ReadProcessMemoryInt(nProcessId:Integer;nMemoryAddress: Pointer): Integer; //讀內存整數型 //----------------------------------------------------- implementation function GetProcessId(strProcessName: string): Integer; //函數名:Get Process ID //功能:得到指定進程的ID //參數:strProcessName*****進程名 //返回值:進程ID var ProcessName: string; ProcessID: integer; ListLoop: Boolean; tag: Boolean; FsnapShotHandle: Thandle; FProcessEntry32: TProcessEntry32; begin tag := True; Fsnapshothandle := CreateToolHelp32SnapShot(TH32CS_SNAPPROCESS, 0); FProcessEntry32.dwsize := SizeOF(FProcessEntry32); Listloop := Process32First(FSnapshotHandle, FProcessEntry32); while Listloop do begin ProcessName := FprocessEntry32.szExeFile; if (ProcessName = strProcessName) then begin CloseHandle(Fsnapshothandle); ProcessID := FProcessEntry32.th32ProcessID; result := ProcessID; tag := False; Break;//跳出while 循環 end; ListLoop := Process32Next(FSnapshotHandle, FprocessEntry32); end; if (tag) then begin CloseHandle(Fsnapshothandle); result := 0; end; end; function dkjc_OpenProcess_Z(nProcessID: Integer): Integer; //函數名:Open Process _Z //功能:打開指定ID的進程並返回操做句柄 //參數:nProcessID*****進程ID //返回值:操做句柄 begin result := OpenProcess(PROCESS_ALL_ACCESS, false, nProcessID); end; function dnczs_ReadProcessMemoryInt(nProcessId:Integer;nMemoryAddress: Pointer): Integer; //函數名:ReadProcessMemoryInt //功能:打讀取內存整數型 返回 若是讀取失敗就返回-1 //參數:nprocessId:進程ID , nMemoryAddress:讀取地址 //返回值:指定內存地址的內容 //調用例子:dnczs_ReadProcessMemoryInt(nA,Pointer($486150)); var nTem: Integer; nThreadHandle: Integer; a: Boolean; readByte: DWORD; begin nThreadHandle := dkjc_OpenProcess_Z(nProcessId); a:= ReadProcessMemory(nThreadHandle, nMemoryAddress, @nTem, 4, readByte); CloseHandle(nThreadHandle); if a then begin Result := nTem; end else begin Result := -1; end; end; end.
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,super,ShellAPI; type TForm1 = class(TForm) btn1: TButton; edt1: TEdit; lbl1: TLabel; lbl2: TLabel; procedure btn1Click(Sender: TObject); procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} function GetProcAddress(a: integer; b: string): Integer; stdcall; external 'kernel32.dll' var b: array[1..3] of byte = ($C2, $10, $0); procedure TForm1.btn1Click(Sender: TObject); var pid:Integer; openId:Integer; WriteByte: DWORD; c: Integer; begin pid := GetProcessId(edt1.Text); if (pid = 0) then begin ShowMessage('找不到您輸入的進程!'); Exit; end; openId := dkjc_OpenProcess_Z(pid); if (openId = 0) then begin ShowMessage('打開進程失敗!'); Exit; end; //ShowMessage(inttostr(pid)); //ShowMessage(inttostr(openId)); c := GetModuleHandle('user32.dll'); c := GetProcAddress(c, 'SetWindowsHookExA'); if (c = 0) then begin ShowMessage('獲取函數地址失敗!'); Exit; end; // ShowMessage(inttostr(c)); WriteProcessMemory(openId,Pointer(c), @b[1], 3, WriteByte); ShowMessage('OK,廣播開始後,右鍵點全屏幕顯示,退出全屏!'); end; procedure TForm1.FormCreate(Sender: TObject); begin ShellExecute(Handle,'open','http://user.qzone.qq.com/xxxxxx/blog/1371965742',nil,nil,SW_SHOWNORMAL) end; end.