易截截图软件、单文件、免安装、纯绿色、仅160KB

Delphi 嵌入汇编 进Ring0 360tray.exe

unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, TlHelp32;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
procedure exit360;
procedure Ring0ToRun; stdcall;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure exit360;
var
id:Cardinal;
sn:THandle;
boo:Boolean;
lpp:TProcessEntry32;
phand:HWND;
begin
sn:=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
lpp.dwSize:=SizeOf(lpp);
try
boo:=Process32First(sn,lpp);
while boo do
begin
if lpp.szExeFile = '360tray.exe' then
begin
//Result:=lpp.szExeFile;
id:=lpp.th32ProcessID;
phand:=OpenProcess(PROCESS_ALL_ACCESS,False,id);
GetWindowThreadProcessId(phand,id);
TerminateProcess(phand,ExitCode);
Break;
end;
boo:=Process32Next(sn,lpp);
end;
except
end;
end;
procedure Ring0ToRun; stdcall;
const
ExceptionUsed = $03; // 中断号,也可以用其他的中断号,如$05等
var
IDT:array [0..5] of byte; //保存中断描述符表,6字节
lpOldGate : DWORD; // 保存旧的中断向量,8个字节
begin
asm
sidt IDT //读入中断描述符表至IDt中
mov ebx, dword ptr [IDT+2] //IDT共6字节,第2~5字节是中断描述符表的基地址,基地址存入ebx中
add ebx, 8*ExceptionUsed //加上8x3个字节,因为每个中断向量占用8字节,
cli //关中断,下面的代码是关键代码,不允许打断
mov dx, word ptr [ebx+6] //取中断向量的6,7字节
shl edx, 16d //左移16位,中断向量的6,7字节存入edx的高32位
mov dx, word ptr [ebx] //取中断向量的0,1字节,存入edx低32位
mov [lpOldGate], edx //保存中断向量至lpoldgate中
mov eax, offset @@Ring0Code //修改向量,指向Ring0级代码段
mov word ptr [ebx], ax
shr eax, 16d
mov word ptr [ebx+6], ax
int ExceptionUsed // 发生中断,自动以ring0执行@@Ring0Co


相关文档:

Delphi与XML文档

同步程序案例
procedure TGetOrderThread.PostDB(webnr:WideString);
var
  Err: String;
  SetWebnr:WideString;
  xmlDoc: IXMLDocument;
  root: IXMLNode;
  rowc: IXMLNode;//记录数
  rows: IXMLNodeList;//主记录列表
  row: IXMLNode;
  drows: IXMLNodeList;// ......

Delphi 日期函数

Day 开头的函数

Unit
DateUtils
function DateOf(const Avalue: TDateTime): TDateTime;
描述
使用 DateOf 函数用来把一个 TDateTime 类型的变量转变成一个
只带有日期的 TDateTime 类型变量。
例如:
showmessage(DateTimetostr(dateof(now())));
你得到的是 2003/03/19
而 showmessage(DateTime ......

Delphi函数简介

                  名称   类型    说明
                    --------------------------------------------------------- ......

Delphi拾遗(8) 类事件

类的事件
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TMyEvent = procedure of object; //不带参数的过程
TMyEventExt = procedure(AName: string) of object; //带参数的过程

TForm1 = class(TForm)
......

Delphi 使用自定义消息

1、先用Const 定义一个常量,例如 const WM_MyMessage=WM_USER+$200;
2、在要实现的unit中定义一个私有方法
   procedure doMyMessage(var msg:TMessage);message WM_MyMessage;
3、实现这个私有方法
    procedure TForm1.doMyMessage(var msg:TMessage);
begin
  //
  if msg. ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号