首页
社区
课程
招聘
[求助]delphi 中ZwMapViewOfSection 编译成64位 错误 0xc00000F6
发表于: 2020-2-2 22:38 3288

[求助]delphi 中ZwMapViewOfSection 编译成64位 错误 0xc00000F6

2020-2-2 22:38
3288
在win10 中编译成32程序 没问题  编译成64位 错误  0xc00000F6
是哪里问题呢 ?
TZwMapViewOfSection = function(SectionHandle: THANDLE;
    ProcessHandle: THANDLE;
    BaseAddress: Pointer;
    ZeroBits: ULONG_PTR ;//LongWord;
    CommitSize: SIZE_T ;//LongWord;
    SectionOffset: PLARGE_INTEGER;
    ViewSize: Pointer;
    InheritDisposition: SECTION_INHERIT;
    AllocationType: ULONG;
    Win32Protect: ULONG): DWORD; stdcall;


procedure main(ProcessHandle: THANDLE; Address : UInt64; Size: UInt64);
var
  h, SectionHandle: THandle;
  ZwCreateSection: TZwCreateSection;
  ZwMapViewOfSection: TZwMapViewOfSection;
  MaximumSize: LARGE_INTEGER;
  obj: OBJECT_ATTRIBUTES;
  error  :DWORD;
  BaseAddress: Pointer;
  ViewSize : LongWord;
begin
  h := LoadLibraryA('ntdll.dll');
  ZwCreateSection := TZwCreateSection(GetProcAddress(h, 'NtCreateSection'));
  ZwMapViewOfSection := TZwMapViewOfSection(GetProcAddress(h, 'ZwMapViewOfSection'));
  FillChar(MaximumSize, SizeOf(LARGE_INTEGER), 0);
  MaximumSize.QuadPart := Size ; //$50000;
  error := ZwCreateSection(@SectionHandle, SECTION_ALL_ACCESS, nil, @MaximumSize, PAGE_EXECUTE_READ, SEC_COMMIT, 0);
  BaseAddress := nil;
  ViewSize := 0;                             //GetCurrentProcess()
  error := ZwMapViewOfSection(SectionHandle,ProcessHandle , @BaseAddress , 0,
            Size, nil, @ViewSize, ViewShare, 0, PAGE_EXECUTE_READ);

 

end;

[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!

最后于 2020-2-3 00:45 被lg好人编辑 ,原因:
收藏
免费 0
支持
分享
最新回复 (1)
雪    币: 2510
能力值: ( LV1,RANK:0 )
在线值:
发帖
回帖
粉丝
2
帮顶
2020-2-3 21:27
3
游客
登录 | 注册 方可回帖
返回
//