SkillAgentSearch skills...

Lockmem

This utility allows you to lock every available memory regions of an arbitrary process into its working set.

Install / Use

/learn @0vercl0k/Lockmem
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

lockmem

Builds

This utility allows you to lock every available memory regions of an arbitrary process into its working set. It uses ntdll!NtLockVirtualMemory (syscall used internally by VirtualLock) to lock memory ranges as well as GetProcessWorkingSetSizeEx and SetProcessWorkingSetSizeEx to increase the size of the process' working set.

The Windows kernel guarantees that those pages will stay resident in memory, not written to the pagefile and not incur a page fault on access.

lockmem

Build

(base) c:\lockmem\src>nmake

Microsoft (R) Program Maintenance Utility Version 14.26.28806.0
Copyright (C) Microsoft Corporation.  All rights reserved.

        if not exist ..\bin mkdir ..\bin
        cl /O1 /nologo /ZI /W3 /D_AMD64_ /DWIN_X64 /sdl /Fe..\bin\lockmem.exe lockmem.cc /link /nologo /debug:full ntdll.lib
lockmem.cc
        del *.obj *.pdb *.idb
        if exist .\bin del bin\*.exp bin\*.ilk bin\*.lib

(base) c:\lockmem\src>..\bin\lockmem.exe
./lockme <process name | pid>
View on GitHub
GitHub Stars73
CategoryDevelopment
Updated1d ago
Forks15

Languages

C++

Security Score

100/100

Audited on Apr 1, 2026

No findings