首页
社区
课程
招聘
[求助]delphi ddk修改INLINE问题
发表于: 2007-11-18 03:44 6409

[求助]delphi ddk修改INLINE问题

2007-11-18 03:44
6409
菜鸟架到。。。大家别BS。。。
没有蓝屏信息,蓝屏代码8E。。DEBUG信息全一个地址。。如0xE15F84EC
大家帮个忙吧。。新手上路,难免撞车
unit driver;

interface

uses DDDK;

type
POBJECT_ATTRIBUTES = ^OBJECT_ATTRIBUTES;
PCLIENT_ID =^ulong;
ACCESS_MASK = cardinal;
phandle = ^thandle;

function _DriverEntry(DriverObject: PDriverObject; RegistryPath:PUnicodeString): NTSTATUS; stdcall;

var
  POldOpenProcess : pLong; 
  OldOpenProcessAdd : pLong; 
  JmpAddress : uLong;  
  
implementation

function MyNtOpenProcess(ProcessHandle:phandle;DesiredAccess: ACCESS_MASK;ObjectAttributes: POBJECT_ATTRIBUTES;ClientId:PCLIENT_ID):NTSTATUS;CDECL;
begin
 asm
      push     0C4h
      push     804daa88h  
      jmp      [JmpAddress]  
end; //xp..vm..
 dbgprint('MyNtOpenProcess=0x%X',[]);
end;

procedure DriverUnload(DriverObject: PDriverObject); stdcall;
begin
  asm   
          cli
          mov eax,cr0
          and eax,not $10000
          mov cr0,eax
  end;
  POldOpenProcess^ := ULong(OldOpenProcessAdd); 
  asm 
          mov  eax,cr0
          or   eax,$10000
          mov  cr0,eax
          sti
  end;
end;

function _DriverEntry(DriverObject: PDriverObject; RegistryPath:PUnicodeString): NTSTATUS; stdcall;
begin
  DriverObject^.DriverUnload := @DriverUnload;
  POldOpenProcess := Pointer(ULONG(KeServiceDescriptorTable.ServiceTableBase) + $7a * 4); //0x7a xpsp2 ntopenprocess
  dbgprint('POldOpenProcess=0x%X',[]);
  OldOpenProcessAdd := pointer($805c0b78); //Pointer(POldOpenProcess^)
  dbgprint('OldOpenProcessAdd=0x%X',[]);
  JmpAddress := ulong(OldOpenProcessAdd)+10;
  dbgprint('JmpAddress=0x%X',[]);
  asm  
         cli
         mov eax,cr0
         and eax,not $10000
         mov cr0,eax
  end;
  POldOpenProcess^ := ULong(@MyNtOpenProcess);//加了这行就蓝
  dbgprint('POldOpenProcess=0x%X',[]);
  asm  
         mov  eax,cr0
         or   eax,$10000
         mov  cr0,eax
         sti
  end;
  Result := STATUS_SUCCESS;
end;

end.

[课程]FART 脱壳王!加量不加价!FART作者讲授!

收藏
免费 0
支持
分享
最新回复 (5)
雪    币: 66
活跃值: (16)
能力值: ( LV8,RANK:130 )
在线值:
发帖
回帖
粉丝
2
然然  哈哈
2007-11-18 11:25
0
雪    币: 200
活跃值: (14)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
小然然,哇哈哈
2007-11-22 20:01
0
雪    币: 325
活跃值: (97)
能力值: ( LV13,RANK:530 )
在线值:
发帖
回帖
粉丝
4
可怜的Object Pascal
2007-11-22 21:52
0
雪    币: 205
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
delphi可以写驱动?
2007-11-22 22:00
0
雪    币: 200
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
6
Delphi号称无所不能...不过老实说驱动这玩意还是VC+DS好....
2007-12-17 18:51
0
游客
登录 | 注册 方可回帖
返回
//