Objective
Find out which DLLs your own running programs use, where they live, who signed them, and how many your PC has. You only look. Nothing in this lab changes any setting or file.
Time: 25–30 minutes
You need: A Windows PC. No extra software is required. (One free optional tool, Process Explorer, is named in Part 5.)
What to Open
| Tool | How to open it |
|---|---|
| Notepad | Press Win, type Notepad, press Enter. Leave it open for the lab |
| PowerShell | Press Win, type PowerShell, press Enter (normal, not admin) |
| Command Prompt | Press Win, type cmd, press Enter |
| Task Manager | Press Ctrl + Shift + Esc |
| File Explorer | Press Win + E |
Part 1: What Does Notepad Load? (Command Prompt)
With Notepad open, run:
tasklist /m /fi "imagename eq notepad.exe"
The /m option lists the modules (EXE and DLLs) loaded in each matching process. Note: a newer Notepad from the Microsoft Store may run under a different name or show several lines; if nothing shows, try tasklist /m /fi "imagename eq mspaint.exe" after opening Paint.
- Is
ntdll.dllin the list? ________________ - Is
kernel32.dllin the list? ________________ - Find one DLL with
gdioruserin its name: ________________ - How many modules are listed (roughly)? ________________
Part 2: The Same Thing in PowerShell (With Paths)
Get-Process -Name notepad | Select-Object -ExpandProperty Modules |
Select-Object ModuleName, FileName | Format-Table -AutoSize- In which folder do most DLL files live? ________________
- Is any DLL from a folder other than
C:\Windows\...? Which? ________________ - Is any module from
C:\Windows\WinSxS(Section 7)? ________________
Count them:
(Get-Process -Name notepad | Select-Object -ExpandProperty Modules).Count- Module count: ________________
If PowerShell says access is denied for some process, that is normal. Windows protects some processes (Section 8.3). Notepad should work.
Part 3: Shared Code in Action (Task Manager)
-
Open Task Manager → Details tab.
-
Right-click the column header, choose Select columns, and tick Memory (private working set) and Memory (shared working set) if offered (hedge: the exact columns differ by Windows version).
-
Compare a few processes.
-
Which is bigger for Notepad: private or shared? ________________
Parts of a process's memory are code from DLLs that other processes share (Section 1.2). That is why the sum of all working sets can look larger than your real RAM.
Part 4: Which Program Is Which? (Services and Properties)
4A. Services inside processes:
tasklist /svc
- Find
svchost.exe. How many lines are there for it? ________________ - Pick one
svchost.exeline and write down a service name: ________________
(Services are often provided by DLLs that svchost.exe loads. A single host program runs different service DLLs.)
4B. File Explorer's Details tab:
-
Open
C:\Windows\System32. -
Right-click
kernel32.dll→ Properties → Details tab. -
File version: ________________
-
Copyright (company): ________________
-
File size: ________________
-
Open the Digital Signatures tab (if shown). Who signed it? ________________
4C. Where is it? (where and Get-Command):
where kernel32.dll
Get-Command kernel32.dll | Select-Object Name, Source- Which path was reported? ________________
4D. How many DLLs in System32?
Get-ChildItem C:\Windows\System32\*.dll | Measure-Object- Count: ________________ (typically thousands)
4E. The KnownDLLs list (Section 4):
Get-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\KnownDLLs"- Is
kernel32.dllon the list? ________________ (Look for a value pointing tokernel32.dll.)
Part 5 (Optional): Process Explorer from Sysinternals
Process Explorer is a free tool from Microsoft (Sysinternals). Download it only from Microsoft's official site. It is not part of Windows and needs no installation.
-
Start Process Explorer and click
notepad.exein the process list. -
Press
Ctrl + Dto open the DLL view at the bottom. -
Right-click the column header → Select Columns → DLL and add Verified Signer and Path.
-
Press
Ctrl + Dagain to hide the view when finished. -
How many DLLs are shown, and are they all "(Verified) Microsoft Windows"? ________________
Another optional free tool is sigcheck (also Sysinternals): sigcheck C:\Windows\System32\kernel32.dll shows the version and signature.
Part 6 (Optional): Visual Studio Tools Only
Skip this if you do not have the Visual Studio tools. In a Developer Command Prompt:
dumpbin /dependents C:\Windows\System32\notepad.exe
dumpbin /exports C:\Windows\System32\kernel32.dll | more
- Name one function that
kernel32.dllexports: ________________
What Should Happen
- Part 1 and 2 show the same module list.
ntdll.dllandkernel32.dllappear in nearly every process. - Part 3 shows that much memory used by a process is shared.
- Part 4 shows System32 holds thousands of DLLs, that they are signed by Microsoft, and that core DLLs are in KnownDLLs.
- Part 5 and 6 show the same thing from another angle.
Interpretation Guide
| What you see | What it means |
|---|---|
ntdll.dll and kernel32.dll in every process | The loader and the Windows API base are everywhere |
Most modules under C:\Windows\System32 | Normal. Shared system DLLs |
Modules under C:\Windows\WinSxS | Side-by-side assemblies (Section 7) |
Modules under C:\Program Files\... | The program's own DLLs, from its application directory |
| A DLL under a Temp or Downloads folder | Worth a second look (Section 4.6 and 8.3) |
api-ms-win-* names in dumpbin output | Virtual API-set names (Section 6.1) |
Many svchost.exe lines | One host program, many service DLLs |
| "Access denied" for a process | Windows protection is working (Section 8.3) |
| A signature from "Microsoft Windows" | The file is official and unchanged |
Follow-Up Questions
- Why do you think
ntdll.dllandkernel32.dllare loaded into almost every process? - If two programs both load
user32.dll, how many copies of its code are in RAM? - Why are modules in a
Tempfolder more suspicious than those inSystem32? - Why does
tasklist /svcshow manysvchost.exelines rather than one? - Name three facts from this lab that you could not have learned just by looking at the Notepad window.