Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7173647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:52:06+00:00 2026-05-28T15:52:06+00:00

i wrote a C tool to mess around with the windows kernel a bit.

  • 0

i wrote a C tool to mess around with the windows kernel a bit. Now as we can see there are several functions inside the “PAGE” section, meaning this functions of the kernel can be paged out. I know their address because I can read the PE header of the windows kernel in memory. (non-pageable as well as primary .text section).

So here is my question: What do i have to do in order to call a pagable function of the windows kernel (from my driver). More precisely what do i have to do to ensure the function is currently paged-in and resident as executable memory? I get BSOD occasionally when these functions are paged out. Is there a convinient way to accomplish that?
(instead of “MmProbeAndLockPages” for kernel text section called “PAGE”).

Hint: i am not using windows tools. i need to accomplish that in plain old C (MinGW toolchain)

regards,
Michael


./bin/asmdiff.exe info -s /cygdrive/c/Windows/winsxs/amd64_microsoft-windows-os-kernel_31bf3856ad364e35_6.1.7601.17514_none_ca56670fcac29ca9/ntoskrnl.exe 

Trying to get Information for file: /cygdrive/c/Windows/winsxs/amd64_microsoft-windows-    os-kernel_31bf3856ad364e35_6.1.7601.17514_none_ca56670fcac29ca9/ntoskrnl.exe...

BinaryFormat: PE_64

######### Dumping PE64-File sections: #########

Section 0: <.text> base:0x0000000140001000 len:1712881
Section 1: <INITKDBG▒9> base:0x00000001401A4000 len:14768
Section 2: <POOLMI> base:0x00000001401A8000 len:7197
Section 3: <POOLCODE base:0x00000001401AA000 len:11803
Section 4: <RWEXEC> base:0x00000001401AD000 len:4096
Section 5: <.rdata> base:0x00000001401AE000 len:252272
Section 6: <.data> base:0x00000001401EC000 len:603464
Section 7: <.pdata> base:0x0000000140280000 len:196824
Section 8: <ALMOSTRO▒> base:0x00000001402B1000 len:7664
Section 9: <SPINLOCK@> base:0x00000001402B3000 len:6464
Section 10: <PAGELK> base:0x00000001402B5000 len:85739
Section 11: <PAGE> base:0x00000001402CA000 len:2317806
Section 12: <PAGEKD> base:0x0000000140500000 len:19442
Section 13: <PAGEVRFY▒> base:0x0000000140505000 len:136619
Section 14: <PAGEHDLS▒'> base:0x0000000140527000 len:10199
Section 15: <PAGEBGFXLf> base:0x000000014052A000 len:26188
Section 16: <PAGEVRFB> base:0x0000000140531000 len:13312
Section 17: <.edata> base:0x0000000140535000 len:67960
Section 18: <PAGEDATA> base:0x0000000140546000 len:56576
Section 19: <PAGEVRFC)> base:0x0000000140554000 len:10526
Section 20: <PAGEVRFDP> base:0x0000000140557000 len:4688
Section 21: <INIT> base:0x0000000140559000 len:357788
Section 22: <.rsrc> base:0x00000001405B1000 len:221024
Section 23: <.reloc> base:0x00000001405E7000 len:8304
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T15:52:07+00:00Added an answer on May 28, 2026 at 3:52 pm

    Generally, you shouldn’t have to do anything to get the code paged in – the memory manager will take care of that for you.

    However, if code is marked as being pageable what that means is that the function can only be called when the system is at an IRQL less than DISPATCH_LEVEL. So any code that you want to be able to run at a higher IRQL shouldn’t be marked pageable.

    You can dynamically lock pageable code using MmLockPagableCodeSection() (see http://msdn.microsoft.com/en-us/library/windows/hardware/ff554307.aspx), but I think that level of control is probably needed only rarely.

    You can use Driver Verifier with “Force IRQL Checking” to help more deterministically detect when you have pageable code that’s being called at a high IRQL.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote a tool for polar functions. It lists values from an input range
I wrote a tool that looks in several places for an INI config file:
I wrote a simple tool to generate a DBUnit XML dataset using queries that
I recently wrote a small tool to generate a class for each tier I
I wrote simple load testing tool for testing performance of Java modules. One problem
I have to run a tool on around 300 directories. Each run take around
I wrote a .net assembly using c# to perform functions that will be used
I know that there are several very similarly-related questions on this website, however after
I wrote a plug-in for the jetbrains tool teamcity. It is pretty much just
Following up this question here . I finally wrote up a code generation tool

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.