Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NTSTATUS x64Func::x64NtMapViewOfSection (
- IN HANDLE SectionHandle,
- IN HANDLE ProcessHandle,
- IN OUT DWORD64* BaseAddress,
- IN ULONG ZeroBits,
- IN ULONG CommitSize,
- IN OUT LARGE_INTEGER* SectionOffset OPTIONAL,
- IN OUT DWORD64* ViewSize,
- IN SECTION_INHERIT InheritDisposition,
- IN ULONG AllocationType,
- IN ULONG Protect
- )
- {
- static DWORD64 _NtMapViewOfSection = 0;
- if(!_NtMapViewOfSection)
- {
- _NtMapViewOfSection = GetProcAddress64(getNTDLL64(),"NtMapViewOfSection");
- if(!_NtMapViewOfSection){
- return 0;
- }
- }
- return (NTSTATUS)x64Func::X64Call(_NtMapViewOfSection, 10,
- (DWORD64)SectionHandle, (DWORD64)ProcessHandle, (DWORD64)BaseAddress, (DWORD64)ZeroBits, (DWORD64)CommitSize,
- (DWORD64)SectionOffset, (DWORD64)ViewSize, (DWORD64)InheritDisposition, (DWORD64)AllocationType, (DWORD64)Protect);
- }
- //use
- {
- HANDLE hSec = NULL;
- LARGE_INTEGER a;
- DWORD64 s = NULL;
- DWORD64 BaseAddress = NULL;
- s = dwImageSize;
- a.HighPart = 0;
- a.LowPart = s;
- res = x64Func::x64NtMapViewOfSection(hSec, hProcess, &BaseAddress, NULL, NULL, NULL, &s, ViewUnmap, NULL, PAGE_EXECUTE_READWRITE);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement