Hi
My objective is to check if the module loaded in the memory is actually that of its image available in user mode. For this I thought to compare the 'n' bytes from the entry point of the module by obtaining it from
- the image from hard disk (UM)
- the module that is loaded in the memory (KM)
I tried for first 5 bytes of ntoskrnl.exe and they were all different.
To get the Entry Point:
In User mode
I used, CreateFile -> CreateFileMapping -> MapViewOfFile.
Using the pointer from MapViewOfFile as base address I got OptionalHeader and read the Address of EntryPoint from that.
Converted this entrypoint address to offset and added to the base address.
In Kernel mode
I used ZwQuerySystemInformation(SystemModuleInformation, ...) to read all the modules and got the base address of ntoskrnl.exe. (Rest is same as in UM)
It is my understanding that these bytes should be same. Is it correct?
If yes, then where am I going wrong?
Can I see the Entry Point of a loaded module using Windbg?
My objective is to check if the module loaded in the memory is actually that of its image available in user mode. For this I thought to compare the 'n' bytes from the entry point of the module by obtaining it from
- the image from hard disk (UM)
- the module that is loaded in the memory (KM)
I tried for first 5 bytes of ntoskrnl.exe and they were all different.
To get the Entry Point:
In User mode
I used, CreateFile -> CreateFileMapping -> MapViewOfFile.
Using the pointer from MapViewOfFile as base address I got OptionalHeader and read the Address of EntryPoint from that.
Converted this entrypoint address to offset and added to the base address.
In Kernel mode
I used ZwQuerySystemInformation(SystemModuleInformation, ...) to read all the modules and got the base address of ntoskrnl.exe. (Rest is same as in UM)
It is my understanding that these bytes should be same. Is it correct?
If yes, then where am I going wrong?
Can I see the Entry Point of a loaded module using Windbg?