Introduction
- Who Should Read This Book
- What You Should Know to Use This Book
- Sample Code
Chapter 13: Working With Memory
- Memory APIs
- The
VirtualAlloc*Functions - A
VirtualAllocBug - Decommitting / Releasing Memory
- Reserving and Committing Memory
- Committed Memory and RAM
- The Micro Excel Application
- Working Sets
- The Working Sets Application
- Heaps
- Private Heaps
- Heap Types
- Heap Debugging Features
- The C/C++ Runtime
- The Local/Global APIs
- Other Heap Functions
- Other
VirtualFunctions - Memory Protection
- Locking Memory
- Memory Block Information
- Memory Hint Functions
- Writing and Reading to/from Other Processes
- Large Pages
- Huge Pages
- Address Windowing Extensions
- NUMA
- The
VirtualAlloc2Function - Summary
Chapter 14: Memory Mapped Files
- Introduction
- Mapping Files
- The filehist Application
- Sharing Memory
- Sharing Memory with File Backing
- The Micro Excel 2 Application
- Other Memory Mapping Functions
- Data Coherence
- Summary
Chapter 15: Dynamic Link Libraries
- Introduction
- Building a DLL
- Implicit and Explicit Linking
- Implicit Linking
- Explicit Linking
- Calling Conventions
- DLL Search and Redirection
- The
DllMainFunction - DLL Injection
- Injection with Remote Thread
- Windows Hooks
- DLL Injecting and Hooking with
SetWindowsHookEx - API Hooking
- IAT Hooking
- “Detours” Style Hooking
- DLL Base Address
- Delay-Load DLLs
- The
LoadLibraryExFunction - Miscellaneous Functions
- Summary
Chapter 16: Security
- Introduction
- WinLogon
- LogonUI
- LSASS
- LsaIso
- Security Reference Monitor
- Event Logger
- SIDs
- Groups and Aliases
- Tokens
- The Secondary Logon Service
- Impersonation
- Impersonation in Client/Server
- Privileges
- Super Privileges
- Access Masks
- Security Descriptors
- The Default Security Descriptor
- Building Security Descriptors
- User Access Control
- Elevation
- Running As Admin Required
- UAC Virtualization
- Integrity Levels
- UIPI
- Specialized Security Mechanisms
- Control Flow Guard
- Process Mitigations
- Summary
Chapter 17: The Registry
- The Hives
- HKEY_LOCAL_MACHINE
- HKEY_USERS
- HKEY_CURRENT_USER (HKCU)
- HKEY_CLASSES_ROOT (HKCR)
- HKEY_CURRENT_CONFIG (HKCC)
- HKEY_PERFORMANCE_DATA
- 32-bit Specific Hives
- Working with Keys and Values
- Reading Values
- Writing Values
- Deleting Keys and Values
- Creating Registry Links
- Enumerating Keys and Values
- Registry Notifications
- Transactional Registry
- Registry and Impersonation
- Remote Registry
- Miscellaneous Registry Functions
- Summary
Chapter 18: Pipes and Mailslots
- Mailslots
- Mailslot Clients
- Multi-Mailslot Communication
- Anonymous Pipes
- The Command Redirect Application
- Named Pipes
- Pipe Client
- The Pipe Calculator Application
- Other Pipe Functions
- Summary
Chapter 19: Services
- Services Overview
- Service Process Architecture
- A Simple Service
- Installing the Service
- A Service Client
- Controlling Services
- Installing a Service
- Starting a Service
- Stopping a Service
- Uninstalling the Service
- Service Status and Enumeration
- The enumsvc Application
- Service Configuration
- Service Description
- Failure Actions
- Pre-Shutdown Information
- Delayed Auto-Start
- Trigger Information
- Preferred NUMA Node
- Launch as PPL
- Debugging Services
- Interactive Services
- Service Security
- Service SID
- Service Security Descriptor
- Per-User Services
- Miscellaenous Functions
- Summary
Chapter 20: Debugging and Diagnostics
- Debugger Output
- The DebugPrint Application
- Performance Counters
- Working with Counters
- The QSlice Application
- Process Snapshots
- Querying a Snapshot
- The snapproc Application
- Exercises
- Event Tracing for Windows
- Creating ETW Sessions
- Processing Traces
- Real-Time Event Processing
- The Kernel Provider
- More ETW
- Trace Logging
- Publishing Events with Trace Logging
- Debuggers
- A Simple Debugger
- More Debugging APIs
- Writing a Real Debugger
- Summary
Chapter 21: The Component Object Model
- What is COM?
- Interfaces and Implementations
- The
IUnknownInterface - HRESULTs
- COM Rules (pun intended)
- COM Clients
- Step 1: Initialize COM
- Step 2: Create the BITS Manager
- Step 3: Create a BITS Job
- Step 4: Add a Download
- Step 5: Initiate the Transfer
- Step 6: Wait for Transfer to Complete
- Step 7: Display Results
- Step 8: Clean Up
- COM Smart Pointers
- Querying for Interfaces
CoCreateInstanceUnder the HoodCoGetClassObject- Implementing COM Interfaces
- COM Servers
- Implementing the COM Class
- Implementing the Class Object (Factory)
- Implementing
DllGetClassObject - Implementing Self Registration
- Registering the Server
- Debugging Registration
- Testing the Server
- Testing with non C/C++ Client
- Proxies and Stubs
- IDL and Type Libraries
- Threads and Apartments
- The Free Threaded Marshalar (FTM)
- Odds and Ends
- Summary
Chapter 22: The Windows Runtime
- Introduction
- Working with WinRT
- The
IInspectableinterface - Language Projections
- C++/WinRT
- Asynchronous Operations
- Other Projections
- Summary
Chapter 23: Structured Exception Handling
- Termination Handlers
- Replacing Termination Handlers with RAII
- Exception Handling
- Simple Exception Handling
- Using
EXCEPTION_CONTINUE_EXECUTION - Exception Information
- Unhandled Exceptions
- Just in Time Debugging
- Windows Error Reporting (WER)
- Vectored Exception Handling
- Software Exceptions
- High-Level Exceptions
- Visual Studio Exception Settings
- Summary
- Book Summary
