I want hooking a API(NtCreateSection)
I run bottom the code (By Pass)
-- Execute code
Code: Select all
typedef NTSTATUS(WINAPI NtCreateSection)(
OUT PHANDLE SectionHandle,
IN ACCESS_MASK DesiredAccess,
IN POBJECT_ATTRIBUTES ObjectAttributes,
IN PLARGE_INTEGER MaximumSize,
IN ULONG SectionPageProtection,
IN ULONG AllocationAttributes,
IN HANDLE FileHandle
);
NtCreateSection* fpNtCreateSection;
NTSTATUS NtCreateSectionCallback(
OUT PHANDLE SectionHandle,
IN ACCESS_MASK DesiredAccess,
IN POBJECT_ATTRIBUTES ObjectAttributes,
IN PLARGE_INTEGER MaximumSize,
IN ULONG SectionPageProtection,
IN ULONG AllocationAttributes,
IN HANDLE FileHandle
)
{
return fpNtCreateSection(SectionHandle, DesiredAccess, ObjectAttributes, MaximumSize, SectionPageProtection, AllocationAttributes, FileHandle);
}
main()
{
hMapF = CreateFileMapping(
hF,
NULL,
PAGE_READWRITE,
0,
0,
NULL);
if (hMapF == NULL)
{
printf("CreateFileMapping() fail");
CloseHandle(hF);
return 1;
}
}
Stack cookie instrumentation code detected a stack-based buffer overrun.
What's happening?
How do I Fixed Problem?
How should I take action?
additional
OS Enviroment(Win10 64bit ver1703) complie a MSVC 2015 on /GS option.
Waiting for your answer.
Thank you.