Microsoft’s Early Beginnings
- 121Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
Why did the Altair 8800 catch Paul Allen's attention in 1975?
121 questions
- 1
Why did the Altair 8800 catch Paul Allen's attention in 1975?
Model answer
The Altair 8800 was a recently released MITS personal computer whose affordable price suggested a market opportunity.
Explanation
The Altair 8800 was a consumer-affordable personal computer released by MITS the previous year.
- 2
What did Bill Gates claim to MITS about their BASIC interpreter, and was the claim true?
Model answer
Gates told MITS they already had a working BASIC interpreter, though this was a bluff.
Explanation
Gates claimed they had a working interpreter, but Allen and Gates had not yet completed one.
- 3
How did Ed Roberts decide who would receive the BASIC contract, and how did Allen and Gates win it?
Model answer
Ed Roberts offered the contract to the first group to arrive in Albuquerque with a working Altair demo; Paul Allen presented the completed software two months later.
Explanation
Roberts challenged the claim by offering the contract to whoever arrived first with a working Altair demonstration.
- 4
When was Microsoft founded, and what revenue did it reach by 1980?
Model answer
Allen and Gates founded Microsoft about a month after Allen's successful demonstration, and by 1980 its revenue was $8 million.
Explanation
The successful demonstration preceded the formation of the company by about a month.
- 5
How did Microsoft meet IBM's operating-system need, and what was the relationship between DOS and the first Windows release?
Model answer
Microsoft bought and modified 86-DOS, then licensed it to IBM as MS-DOS; it released Windows in 1985 as a graphical interface running on DOS.
Explanation
Microsoft acquired an existing system to meet IBM's deadline, modified it, and licensed it as MS-DOS.
- 6
How many bits are in a byte, word, double word, and quadruple word?
Model answer
A byte is 8 bits, a word is 16 bits, a double word is 32 bits, and a quadruple word is 64 bits.
Explanation
The content defines a byte as eight bits and a word as 16 bits, with double and quadruple words two and four times a word.
- 7
What is a process, and what important resource does the system isolate between processes?
Model answer
A process is a program loaded into memory for execution; the operating system isolates each process's resources, especially its address space.
Explanation
A running program is treated as a process, and process isolation helps keep its resources separate from those of other applications.
- 8
Why do modern operating systems use virtual memory instead of letting processes freely access physical memory?
Model answer
Direct physical-memory access would be difficult to manage and unsafe because a program could read or overwrite arbitrary memory.
Explanation
Allowing programs to navigate physical memory directly would be difficult to manage and would permit unsafe access to other data.
- 9
How does a process's virtual address space relate to page tables and memory pages?
Model answer
Virtual memory gives each process its own address space; virtual addresses index page tables that describe the process's memory pages.
Explanation
Virtual addresses index tables that describe memory chunks, or pages, associated with a process.
- 10
Describe the levels and entries of the page-table structure in the content.
Model answer
There are usually four table levels with 512 entries per table; entries point to lower-level tables except at the final level, where they identify physical pages.
Explanation
The described scheme uses four levels of tables, with 512 entries in each table and the final-level entries identifying physical pages.
- 11
How are virtual-address bits divided between the table indexes and the offset for a typical page?
Model answer
The first three table indexes each use 9 bits, while the last 12 bits provide the offset within a 4,096-byte page.
Explanation
Each of the first three indexes uses nine address bits, and the final 12 bits select a byte within a 4,096-byte page.
- 12
Why does a typical 4,096-byte memory page use 12 offset bits?
Model answer
A typical page is 4,096 bytes, or 212 bytes, so its within-page offset requires 12 bits.
Explanation
A 4,096-byte page has a size of 212 bytes, so 12 bits can represent every offset within it.
- 13
What alternative page sizes are mentioned, and how do they compare with the usual page size?
Model answer
The system can also use huge pages of 2 megabytes and giant pages of 1 gigabyte.
Explanation
Huge pages are 2 megabytes and giant pages are 1 gigabyte; these are larger alternatives to the usual page size.
- 14
How do the size and number of page-table entries make a table the same size as a typical page?
Model answer
Each entry is 64 bits, so 512 entries occupy 4,096 bytes; this makes each table the size of a typical memory page.
Explanation
A 64-bit entry allows each table with 512 entries to occupy 4,096 bytes, matching the usual page size.
- 15
What purpose do the otherwise unused bits in page-table entries serve?
Model answer
Page-table entries do not use all 64 bits for addresses, leaving bits available for properties such as write and execute permissions.
Explanation
Unused entry bits can describe protections such as whether a page is executable or writable.
- 16
How do shared pages and copy-on-write work together when multiple processes use the same library?
Model answer
Processes can map the same physical pages, for example to share dynamic libraries. With copy-on-write, a write creates a private copy for the writing process.
Explanation
Shared physical pages can save memory, while copy-on-write prevents a process's changes from affecting other processes using the same page.
- 17
How can Windows map system code into each process without allowing ordinary user-mode code to access it?
Model answer
Windows maps much system code into the upper part of each application's address space, with kernel-marked pages restricted to privileged mode.
Explanation
Windows maps system code in the upper portion of application address spaces, but kernel-marked pages are inaccessible in user mode.
- 18
What do ring 3 and ring 0 represent, and what happens if user-mode code accesses a kernel-protected page?
Model answer
Ring 3 is user mode and ring 0 is kernel mode. Accessing a kernel-protected page from ring 3 causes an exception, generally crashing the program.
Explanation
Ring 3 is user mode and ring 0 is kernel mode; accessing kernel-protected pages from ring 3 causes an exception.
- 19
How does a user-mode program request a privileged operation through a system call?
Model answer
User code supplies a service number and arguments, then invokes
syscall; the CPU enters kernel mode and transfers control to the system call handler, which uses the SSDT to select the operation.Explanation
The service number selects an operation from the SSDT, and the syscall instruction transfers execution to the handler in kernel mode.
- 20
Which processor architecture does the content focus on when describing CPU features?
Model answer
The processor-related details described apply specifically to the x86_64 architecture.
Explanation
The description focuses on x86_64 processor features rather than claiming they apply identically to every architecture.
- 21
Compare the roles and relative speed and size of the L1, L2, and L3 caches described.
Model answer
The L3 cache is shared across cores, while each core has L1 and L2 caches. Lower-numbered caches are smaller but faster.
Explanation
The L3 cache is shared among cores, while each core also has L1 and L2 caches; lower-numbered caches are smaller and faster.
- 22
What do CPU caches store, and why might a processor have multiple L1 or L2 caches?
Model answer
Caches store frequently used data and instructions. A CPU may have multiple L1 or L2 caches, each serving a specific purpose.
Explanation
Caches keep frequently used data and instructions close to the CPU; processors may also have multiple L1 or L2 caches for different purposes.
- 23
What are the roles of the control unit and the arithmetic logical unit?
Model answer
The control unit fetches and routes instructions, while the ALU performs arithmetic and logical operations.
Explanation
The control unit fetches instructions and directs them to execution units; an ALU handles arithmetic and logical operations.
- 24
What are the functions of the MMU and CPU registers?
Model answer
The MMU handles memory management, including virtual memory; registers are small, fast storage units for data needed during the current execution context.
Explanation
The MMU handles memory operations, including virtual memory, while registers provide fast storage for the current execution context.
- 25
What register sizes are mentioned for 64-bit computers, and why are registers important?
Model answer
Registers in 64-bit computers range from 64 to 512 bits and provide the CPU's fastest way to handle data.
Explanation
The content states that registers in 64-bit computers range from 64 to 512 bits and are the fastest way the CPU handles memory.
- 26
What does RIP track, and how does the number of cores affect simultaneous instruction execution?
Model answer
RIP, the instruction pointer, identifies the current instruction for a core. With two cores, a processor can execute two instructions simultaneously.
Explanation
RIP tracks the instruction being executed by a core; separate cores can execute instructions simultaneously.
- 27
Do general-purpose registers have mandatory roles, and what common convention applies to RAX?
Model answer
Registers such as RAX and RCX have no mandatory use, but conventions commonly use RAX to hold a function's return value.
Explanation
Registers such as RAX and RCX have no mandatory special use, though conventions often use RAX for a function's return value.
- 28
How can code access only part of a larger register, and what is the given example?
Model answer
Machine code can access part of a register; for example, EAX refers to the first 32 bits of RAX.
Explanation
A smaller register name can refer to only part of a larger register, such as EAX referring to the first 32 bits of RAX.
- 29
What information does RFLAGS hold, and what user-mode limitation applies to it?
Model answer
RFLAGS stores condition and configuration bits. Its sixth bit is the zero flag, and only the EFLAGS portion is accessible in user mode.
Explanation
RFLAGS encodes conditions and configuration; its sixth bit is the zero flag, and only the EFLAGS portion is accessible in user mode.
- 30
What does the zero flag indicate after a register is tested?
Model answer
If the zero flag is set to 1 after a register test, the tested value is zero.
Explanation
When the zero flag is set after testing a register, the tested value is zero.
- 31
How did virtual memory change the use of segment registers?
Model answer
Virtual memory made the original segmentation mechanism obsolete, but operating systems still use segment registers for pointers and system-related structures.
Explanation
Segmentation became obsolete with virtual memory, although operating systems still use segment registers to store useful pointers and system structures.
- 32
What does CR3 store, and how is that information used?
Model answer
CR3 stores the location of the current program's first-level page tables, which are used to translate virtual addresses.
Explanation
CR3 stores the current program's first-level page-table address, and other registers can support system configuration.
- 33
What is a thread in terms of CPU execution, and how can multicore processors run threads?
Model answer
A thread is an execution context associated with CPU register values and instructions; a multicore processor can handle threads simultaneously.
Explanation
A thread represents a CPU execution state associated with register values, and multiple cores can handle threads simultaneously.
- 34
What is a thread stack used for, and why would a program use the heap for a large object?
Model answer
A thread's fixed-size stack stores function arguments and local variables. Large data, such as an image, is better stored on the heap.
Explanation
Each thread has a fixed-size, readable and writable stack for function arguments and local variables; large data is better placed on the heap.
- 35
How does the conventional stack data structure differ from how modern thread stacks may be accessed?
Model answer
A stack is conventionally last-in, first-out, but modern thread stacks need not always follow that access order. A function typically reserves a stack frame for its own use.
Explanation
A stack is conventionally last-in, first-out, but modern thread stacks need not always be accessed in that order; a function typically uses its own stack frame.
- 36
What are the respective roles of RSP and RBP?
Model answer
RSP is the stack pointer and points to the top of the stack; RBP is the base pointer and points to the base of the current stack frame.
Explanation
RSP points to the top of the stack, while RBP points to the base of the current function's stack frame.
- 37
What steps does the example use to set up a function's stack frame and local integer?
Model answer
The call saves the return address and old base pointer, establishes a new frame, reserves four bytes for the integer, and initializes it before storing 5.
Explanation
The example call saves the return address and prior base pointer, establishes a new frame, reserves four bytes, and initializes the local integer before assigning 5.
- 38
Why does the example initialize the stack value before assigning it?
Model answer
The value is zeroed first so leftover data from an earlier stack frame cannot be mistaken for the new variable's value.
Explanation
Initializing a stack value prevents stale data from earlier stack frames from being mistaken for its value.
- 39
How does the example restore the caller's frame and resume execution after a function returns?
Model answer
Calling conventions vary. In the example, returning restores the old base pointer, then loads the saved return address into the instruction pointer to resume after the call.
Explanation
Calling conventions vary by use case; when returning, the old base pointer and then the return address restore the previous frame and instruction location.
- 40
What does PE stand for, and what kinds of information can its sections contain?
Model answer
The Portable Executable format supports multiple architectures and organizes an executable's code, import information, and resources into sections.
Explanation
PE supports multiple architectures and stores executable code, imported-function information, and resources in sections.
- 41
What are the DOS header and DOS stub, and how are they arranged in a PE file?
Model answer
The DOS header begins the PE file and indicates where the NT headers are; the DOS stub is a small 16-bit program that commonly prints that the program cannot run in DOS mode.
Explanation
The DOS header is first and points to the NT headers; the DOS stub is a small 16-bit program often displaying a message about DOS compatibility.
- 42
Why do modern Windows executables commonly retain a DOS stub?
Model answer
The DOS stub is retained for backwards compatibility with DOS-era behavior.
Explanation
The DOS stub remains for backwards compatibility, reflecting an older DOS-era convention.
- 43
Compare the kinds of information held in the PE file header and optional header.
Model answer
The file header records information such as target architecture and creation time, while the optional header contains important information such as the code's location.
Explanation
The file header includes architecture and creation information; the optional header contains important data such as where code begins.
- 44
What information does a PE section-table entry provide?
Model answer
The section table describes each section by name, size, and attributes that specify read, write, and execute permissions.
Explanation
The section table lists sections with their names, sizes, and attributes, including whether their contents are readable, writable, or executable.
- 45
How do PE section protections improve security, and what may happen if code writes to a protected code section?
Model answer
Section protections prevent inappropriate access—for example, writing to a non-writable code section causes an access violation and can crash the program.
Explanation
Separate permissions reduce unsafe behavior; attempting to write to a non-writable code section triggers an access violation and crashes the program.
- 46
What purposes do the
.text,.data, and.rdatasections serve?Model answer
.textstores executable code,.datastores writable data, and.rdatastores read-only data.Explanation
The named sections distinguish executable code, writable data, and read-only data.
- 47
What does
explorer.exedo, and what visible effects would terminating it have?Model answer
explorer.exedisplays the desktop, taskbar, and file-explorer windows, and handles actions such as launching a double-clicked application.Explanation
Explorer displays the desktop, taskbar, and file windows, and it initiates application execution when a user opens a program.
- 48
What is the Windows API, and what role does
CreateProcessplay in the example?Model answer
The Windows API is a set of utilities that lets programs interact with the operating system;
CreateProcessis one such function.Explanation
The Windows API provides programmer-facing utilities for interacting with the operating system, including the
CreateProcessfunction. - 49
Compare static and dynamic linking, including the space-saving benefit of dynamic linking.
Model answer
Static linking places library contents directly into an executable. Dynamic linking uses DLLs that the system maps into processes, avoiding duplicated library contents across programs.
Explanation
Static linking copies library contents into an executable, while dynamic linking permits multiple programs to use libraries mapped into memory.
- 50
What is the relationship between
kernel32.dllandkernelbase.dll?Model answer
kernel32.dllis a legacy layer retained for compatibility; many of its functions forward tokernelbase.dll, its intended modern replacement.Explanation
Kernel32 remains for backwards compatibility, while its functions commonly forward to the modern kernelbase implementation.
- 51
What do subsystem DLLs provide, and what is one example of a subsystem's role?
Model answer
Subsystem DLLs expose subsets of the Windows API; their functions commonly call into NTDLL. For example,
user32provides functions for graphical interfaces and user input.Explanation
Subsystem DLLs expose portions of the Windows API, while functions in those layers commonly proceed to NTDLL routines.
- 52
What are the roles of the NT, Zw, and Rtl routine families in NTDLL?
Model answer
NT routines are system-call wrappers, Zw routines implement corresponding system calls for kernel use in certain cases, and Rtl routines are runtime helpers that may or may not make system calls.
Explanation
NT functions wrap system calls, Zw functions provide corresponding calls for kernel code in certain cases, and Rtl functions are runtime helpers that may or may not call the system.
- 53
Why do programs rarely invoke NTDLL routines directly?
Model answer
Programs usually use higher-level DLL wrappers because they may add argument parsing, validation, and error handling that direct NTDLL calls lack.
Explanation
Higher-level DLL wrappers often provide argument parsing, validation, and error handling, making direct NTDLL use less convenient.
- 54
Distinguish service processes from system processes, giving an example of each.
Model answer
Service processes generally do not run in a logged-in user's context, as with Windows Defender; system processes have specific system roles, such as managing logins and logouts.
Explanation
Service processes generally operate outside a logged-in user's context, while system processes have fixed system-related responsibilities.
- 55
How do the Windows executive and kernel differ in the architecture described?
Model answer
The executive is the higher-level kernel-mode layer containing components such as the memory manager and object manager; the kernel includes lower-level features such as the scheduler.
Explanation
The executive contains higher-level components such as memory and object managers; the kernel has lower-level features such as scheduling.
- 56
What are the roles of device drivers and the hardware abstraction layer?
Model answer
Device drivers support hardware such as graphics cards. The HAL provides the lowest, hardware-specific implementation of the system and varies across architectures.
Explanation
Drivers support devices, and the HAL is the lowest, hardware-specific layer whose implementation varies by architecture.
- 57
What does the Windows scheduler decide, and where does it belong in the architecture?
Model answer
The scheduler decides when and for how long threads run; it is part of the Windows kernel.
Explanation
The scheduler determines when and how long threads run and is part of the Windows kernel.
- 58
Trace the user-mode function sequence used to begin creating a process.
Model answer
CreateProcessinkernelbase.dllcallsCreateProcessInternalW, which prepares arguments and invokesNtCreateUserProcessin NTDLL.Explanation
The user-mode function gathers and formats arguments before calling the NTDLL system-call wrapper.
- 59
Where is the kernel-side process-creation implementation located, and what does
ntoskrnl.execontain?Model answer
NtCreateUserProcesstransfers control to the system; the kernel-side implementation is inntoskrnl.exe, which contains most of the Windows executive and kernel.Explanation
The system call transfers control to the kernel, where
ntoskrnl.execontains much of the executive and kernel code and the corresponding process-creation function. - 60
What is
KiSystemCall64, and why is the name described as a shadow name?Model answer
KiSystemCall64is the dispatcher that handles system calls; its name distinguishes it from the original version, and the described version mitigates Meltdown.Explanation
KiSystemCall64is the system-call dispatcher described, and its name distinguishes it from the original version that was mitigated against Meltdown. - 61
What does
swapgsdo during the system-call transition, and what does the kernel GS base MSR point to?Model answer
swapgsexchanges the current GS value withIA32_KERNEL_GS_BASE; that MSR points to the current processor's KPCR.Explanation
swapgsexchanges the GS value with the kernel GS base MSR, which points to the processor's KPCR. - 62
What are the KPCR and KPRCB, and which stack does the system-call handler use after entering the kernel?
Model answer
Each processor has a KPCR containing processor-specific information and a KPRCB. The handler saves the user stack pointer and switches to that processor's kernel stack.
Explanation
Each processor has a KPCR containing core-specific data and a KPRCB; the handler also switches from the user stack to the processor's kernel stack.
- 63
What does the system-call handler do with the base pointer when setting up kernel execution?
Model answer
The handler saves the original base pointer and updates it to point into the kernel stack.
Explanation
The handler saves the original base pointer and points it into the kernel stack before proceeding to system-call dispatch.
- 64
How does
KiSystemServiceStartuse the service descriptor table and SSDT to select a system call?Model answer
KiSystemServiceStartuses the service descriptor table to access the SSDT, which is indexed by the system-call number to find the requested function.Explanation
KiSystemServiceStartconsults the service descriptor table and uses the user-provided service number to select an SSDT entry. - 65
What does the SSDT contain, and what bookkeeping may occur after a system call?
Model answer
The SSDT contains offsets to system-call functions. Depending on flags, logging may occur, and the processor's system-call count is incremented when the operation completes.
Explanation
The SSDT entries are offsets to system-call functions; flags may cause logging, and the processor block records the completed call.
- 66
How does the system-call handler restore execution to the user-mode code?
Model answer
The handler restores saved register values, swaps GS back, and executes
sysretto return to user mode.Explanation
The handler restores saved registers, swaps GS back, and executes
sysretto return to user mode. - 67
Why is understanding the internals of
ntoskrnl.exedifficult?Model answer
Much of
ntoskrnl.exeis undocumented, so its behavior is difficult to interpret and the explanation relies partly on reverse engineering and community research.Explanation
Much of
ntoskrnl.exeis undocumented, so the described behavior is an overview informed by reverse engineering and community work. - 68
How was the
NtCreateUserProcessbehavior traced in the example?Model answer
The trace was configured to break on
NtCreateUserProcesswhen the thread belonged toexplorer.exe; launching Notepad triggered the event.Explanation
The trace filters for the
NtCreateUserProcessservice number and a thread owned by Explorer, then launches Notepad to observe the call. - 69
What two initial operations does
NtCreateUserProcessperform on the executable?Model answer
The call opens the executable with
IoCreateFileEx, then creates an image section withMmCreateSpecialImageSectionso the file can be mapped into memory.Explanation
The system first opens the executable and creates an image section to map it into memory.
- 70
What information does EPROCESS represent, and why is KPROCESS included within it?
Model answer
The EPROCESS is the executive process object and contains or points to process information such as the handle table and process ID. Its KPROCESS structure separates kernel-specific data.
Explanation
An EPROCESS represents the process and points to information such as its handle table and process ID; KPROCESS separates kernel-specific data.
- 71
How are the process object and its access token created or assigned?
Model answer
PspAllocateProcesscreates EPROCESS throughObCreateObjectEx. The process receives an access token containing permissions; LSASS assigns a token to a logon session, and later processes receive copies.Explanation
The object manager creates EPROCESS, while the access token carries permissions assigned to the logon and copied to subsequently created processes.
- 72
What is a process working set, and what limits does Windows set for it?
Model answer
A process working set is the set of its pages currently in physical memory, with a Windows-defined minimum and maximum.
Explanation
A working set comprises pages currently loaded in physical memory; Windows sets minimum and maximum working-set sizes for each process.
- 73
Which working sets exist in addition to those belonging to individual processes?
Model answer
In addition to per-process working sets, Windows has a system working set and a working set for each session.
Explanation
Windows also maintains a system working set and a separate session working set for each session.
- 74
What is a Windows session, what interface structures does it contain, and what is session zero for?
Model answer
A session is created for a logon, even at the lock screen. It contains window stations and desktops with interface state; session zero exists for system processes.
Explanation
Sessions correspond to logons, including the lock screen; they contain window stations, desktops, and interface state, while session zero is always present for system processes.
- 75
What do VADs describe, and what allocation details can an application specify with
VirtualAlloc?Model answer
VAD trees contain nodes describing allocated memory regions.
VirtualAlloccan request an address and size and set allocation type and protection.Explanation
VAD nodes describe allocated memory regions;
VirtualAlloccan specify an address, size, allocation type, and protection. - 76
What does
MEM_RESERVEdo, and what happens if a program writes to a reserved but uncommitted region?Model answer
MEM_RESERVEreserves a region without charging its memory to the system. Accessing it withoutMEM_COMMITcan cause a memory access violation.Explanation
MEM_RESERVEreserves an address region without charging it to the system; writing to it without committing causes an access violation. - 77
How do reserve and commit flags affect a region, and when are its page-table entries created?
Model answer
MEM_COMMITcharges the region, and it can be combined withMEM_RESERVE. The allocation is represented in a VAD, but page-table entries are created only when needed.Explanation
Commitment charges the region, and reserving and committing can be requested together; VAD nodes are created, but page-table entries wait until access.
- 78
What happens when an allocated virtual-memory region is accessed before its page-table entry exists?
Model answer
A page fault causes the system to consult the VAD; if the region is allocated and committed, the system creates the required page-table entry.
Explanation
Accessing a region without a page-table entry causes a page fault; the system checks the VAD and creates an entry if the region is committed.
- 79
What is mapped into the process during address-space setup, and what information does the PEB hold?
Model answer
The executable section is mapped into the process, and a PEB is created for user-mode routines. It holds information such as loaded DLLs, the image base address, and whether the process is being debugged.
Explanation
Process setup maps the executable section into the address space and creates the user-mode PEB, which records image and DLL information and debugging status.
- 80
What is the object manager's role, and how do object-header counts affect an object's lifetime?
Model answer
The object manager manages Windows-object lifetimes. Object headers contain reference and handle counts, and an object can be removed when the relevant counts reach zero unless it is permanent.
Explanation
The object manager controls object lifetimes, while object headers hold counts that determine when objects can be removed unless they are permanent.
- 81
What kinds of resources are represented by Windows objects, and how do object types differ?
Model answer
Windows objects represent resources the system tracks, such as processes, files, and threads; each type has information specific to that resource.
Explanation
Windows objects represent tracked resources such as processes, files, and threads, with object types carrying resource-specific information.
- 82
How does a user-mode process interact with a Windows object, and why must it close a handle?
Model answer
A process opens a permission-bearing handle to interact with an object. Handles are kept in its handle table and should be closed with
CloseHandlewhen no longer needed.Explanation
User-mode code uses permission-bearing handles stored in a process's handle table, and closing them informs the object manager that they are no longer needed.
- 83
How does kernel-mode code track an object's use without opening a handle?
Model answer
Kernel code can access objects directly; it uses
ObReferenceObjectto increase the reference count andObDereferenceObjectto decrease it.Explanation
Kernel-mode code can access objects directly and uses reference-count operations instead of handles to track whether an object is needed.
- 84
What information does a Windows security descriptor contain?
Model answer
A security descriptor contains security information such as the object's owner and points to its SACL and DACL.
Explanation
A security descriptor includes ownership information and points to SACL and DACL structures.
- 85
Compare the purposes of a SACL and a DACL.
Model answer
The SACL controls which actions and users are audited, while the DACL determines who is allowed or denied access to the object.
Explanation
A SACL specifies which operations and actors should produce audit logs; a DACL specifies who has permissions over the object.
- 86
What information does an ACE provide, and what are the roles of its type and mask?
Model answer
An ACL contains zero or more ACEs. An access-allowed or access-denied ACE grants or denies permissions specified by its mask for a particular user.
Explanation
ACLs contain zero or more ACEs, and access-allowed and access-denied ACEs grant or deny a user permissions specified by a mask.
- 87
How are the ACE mask's permission bits divided in the described format?
Model answer
The mask's first 16 bits represent object-specific rights, the next 8 standard rights, the following 4 are ignored in the described account, and the final 4 represent generic rights such as read, write, execute, or all.
Explanation
The ACE mask divides permissions into object-specific rights, standard rights, ignored bits in the described explanation, and generic rights.
- 88
What does an SID identify, and how does its displayed string form differ from its stored form?
Model answer
An SID uniquely identifies an entity the system can authenticate. Its string form includes an
Sand hyphens for readability, but SIDs are not stored as strings.Explanation
An SID uniquely identifies an entity the system can authenticate, and its displayed hyphens and leading S are readability conventions rather than stored characters.
- 89
What do the revision and authority fields in an SID indicate?
Model answer
The revision indicates the SID version and is 1 in the described account; the 48-bit authority identifies the component that issued it.
Explanation
The SID string begins with a revision number, which the content states is 1, followed by a 48-bit authority identifying the issuing component.
- 90
What does an SID authority of 5 signify, and how is the authority used?
Model answer
An authority value of 5 indicates issuance by the Windows security subsystem; the authority also helps code interpret the rest of the SID.
Explanation
Authority 5 identifies the Windows security subsystem, and the authority helps code determine how to parse the remaining SID.
- 91
What are the roles of the domain ID and RID in the SID example?
Model answer
A domain ID identifies the standalone computer or the Active Directory domain, while the relative identifier (RID), usually last, identifies the specific entity within that subauthority.
Explanation
A subauthority sequence can include a domain ID and an RID; the domain ID identifies a device or Active Directory domain, and the RID identifies an entity within it.
- 92
Compare file-backed and page-backed section objects.
Model answer
A file-backed section represents a file to map into memory; a page-backed section has no specific file and can be used to share memory between processes.
Explanation
A file-backed section maps a file, whereas a page-backed section has no particular backing file and can be used to share memory.
- 93
What inconsistent handle-failure values does the example check for in
CreateFileandCreateFileMappingA?Model answer
CreateFileis checked againstINVALID_HANDLE_VALUE(negative one), whileCreateFileMappingAis checked againstnullptr(zero); callers must account for API-specific conventions.Explanation
CreateFileusesINVALID_HANDLE_VALUEto indicate failure, whereasCreateFileMappingAis checked against null, illustrating an API inconsistency. - 94
What is the difference between the A and W variants of Windows API functions that accept strings?
Model answer
The W variants use wide strings, the Windows standard; A variants accept regular strings and generally convert inputs and outputs to or from wide strings.
Explanation
The A and W variants differ in character encoding: W uses wide strings, while A uses regular strings and converts to or from wide strings as needed.
- 95
How does the file-mapping example turn an existing file into memory the program can access?
Model answer
The example opens
example.txtwith read/write permissions, gets its size, creates a file-backed section, and maps a view into the process so its contents can be accessed directly.Explanation
The example opens an existing file with read and write access, gets its size, creates a file-backed section, maps it, and accesses the mapped contents.
- 96
What do
CreateFileMappingandMapViewOfFiledo in the file-backed section example?Model answer
CreateFileMappinginvokesNtCreateSectionunder the hood;MapViewOfFilemaps the file's memory pages into the process's address space.Explanation
CreateFileMappingcallsNtCreateSectionunderneath, andMapViewOfFilemaps the file's pages into the process address space. - 97
How does the file-mapping example persist its changes and clean up?
Model answer
After changing the mapped text, the program calls
FlushViewOfFileto write changes back, unmaps the view, and closes the opened handles.Explanation
The example modifies mapped contents, flushes them to the file, unmaps the view, and closes its handles.
- 98
How do two processes share data through a named page-backed section?
Model answer
One process creates and names a page-backed section, maps it, and writes “hello world.” Another process opens the section by name, maps it, and reads the shared string.
Explanation
The first page-backed example creates a named section without a file handle, maps it, and writes a string; another process opens it by name and reads it.
- 99
How is an object's name represented when the object header has no name field?
Model answer
A named object has an additional object name information header before its object header; the object header itself does not contain a name field.
Explanation
When an object has a name, an object name information header is placed before the object header, although the object header itself has no name field.
- 100
What does
PspAllocateThreadcreate, and what is the TEB used for?Model answer
PspAllocateThreadcreates the ETHREAD object, sets up the user stack, and allocates a TEB. Each thread has its own TEB for information used by user-mode code.Explanation
PspAllocateThreadcreates ETHREAD and sets up the user stack and TEB; each thread has its own TEB for user-mode information. - 101
What does
KeInitThreadinitialize, and where is the thread context stored?Model answer
KeInitThreadsets up KTHREAD, creates the kernel stack, and initializes the thread context, which is stored on that stack.Explanation
KeInitThreadconfigures KTHREAD, creates a kernel stack, and initializes a thread context stored on that stack. - 102
What handle-creation and initialization work do
PspInsertProcessandPspInsertThreadperform?Model answer
PspInsertProcesscreates and returns a process handle.PspInsertThreadperforms scheduling setup, creates a thread handle, and callsKeStartThread.Explanation
PspInsertProcesscreates a process handle;PspInsertThreadperforms scheduling initialization, creates a thread handle, and callsKeStartThread. - 103
How does
KeStartThreadupdate the process to reflect its new thread?Model answer
KeStartThreadperforms scheduling initialization, increments the thread count in EPROCESS, and adds the thread to the process's thread list.Explanation
KeStartThreadincrements the process's thread count and inserts the new thread into the process's thread list. - 104
What does it mean for a newly created thread to be in the deferred ready state?
Model answer
KeReadyThreadplaces the thread in a deferred ready state: it is ready to run on a specific core but is not yet running.Explanation
KeReadyThreadputs the thread in a deferred ready state, meaning it is ready for a particular core but has not begun running. - 105
What information does
CreateProcessInternalWsend to CSRSS when registering a process?Model answer
CreateProcessInternalWcallsCsrClientCallServerto notify CSRSS, sending information such as the process and thread handles, PEB address, and section-object handle.Explanation
Before resuming the thread,
CreateProcessInternalWsends CSRSS a message containing process and thread handles, the PEB address, and the section handle. - 106
What is CSRSS responsible for in this process-creation sequence, and how is the message sent?
Model answer
CSRSS is a continuously running system process that tracks processes and threads in its session. The notification uses ALPC, an undocumented inter-process communication protocol.
Explanation
CSRSS tracks processes and threads within its session, and the notification uses ALPC, an undocumented inter-process communication protocol.
- 107
When does the initial thread begin running, and what kernel function starts it?
Model answer
The initial thread remains suspended until
CreateProcessInternalWresumes it; it then starts through the kernel functionKxStartUserThread.Explanation
The initial thread stays suspended until
CreateProcessInternalWresumes it, after whichKxStartUserThreadbegins its execution. - 108
Why does
KxStartUserThreadconstruct a trap frame manually, and what does the Kx prefix indicate?Model answer
Kx functions are architecture-specific. Since the new thread has not previously made a user-to-kernel transition,
KxStartUserThreadmanually builds a trap frame describing CPU state.Explanation
Kx-prefixed functions are processor-specific, and
KxStartUserThreadmanually builds a trap frame because the new thread has not previously transitioned from user to kernel mode. - 109
Where does the initial user-mode execution begin, and what is that routine's role?
Model answer
The trap frame is configured to start execution at NTDLL's
LdrInitializeThunk, the image loader.Explanation
The trap frame sets the initial execution point to
LdrInitializeThunkin NTDLL, which begins image-loader work. - 110
What is the loader database, and how does the PEB refer to it?
Model answer
The loader creates and initializes a database listing DLLs loaded in the process; the PEB's Ldr field points to it.
Explanation
The loader creates a database of DLLs in the process, and the PEB's Ldr field points to that database.
- 111
How does a loader locate the Import Directory Table in a PE image?
Model answer
The loader locates the Import Directory Table through the optional header's data directories and adds its stored offset to the image base.
Explanation
The loader reads the PE Import Directory Table from the optional header's data directories, then adds its offset to the image base to locate it.
- 112
Where can the Import Directory Table be found, what does it contain, and how is its descriptor count specified?
Model answer
The table may be in
idataor part ofrdataand containsIMAGE_IMPORT_DESCRIPTORentries; the data directories also store the descriptor count after the offset.Explanation
The table can be in an
idatasection or part of anrdatasection and contains a sequence of import descriptors; the descriptor count is stored after the offset in the data directories. - 113
What information do the
Name,OriginalFirstThunk, andFirstThunkfields provide?Model answer
In an import descriptor,
Nameidentifies the library,OriginalFirstThunkpoints to the Import Name Table, andFirstThunkpoints to the Import Address Table.Explanation
The descriptor's Name identifies the DLL, OriginalFirstThunk points to the INT, and FirstThunk points to the IAT.
- 114
What do the Import Name Table and Import Address Table contain?
Model answer
The INT and IAT are sequences of
IMAGE_THUNK_DATAstructures describing functions that the program imports from the library.Explanation
The INT and IAT contain sequences of thunk structures describing functions the program imports from a DLL.
- 115
How can an imported function be identified, and what does the loader place in the IAT?
Model answer
An imported function can be identified by a name or ordinal. The loader writes the function's resolved address into its IAT entry.
Explanation
The INT identifies functions by name or ordinal, while the IAT is updated with the addresses of the resolved functions.
- 116
Why can the IAT be used to look up names initially but not after imports have been resolved?
Model answer
Initially, the INT and IAT are the same, but resolving imports replaces IAT entries with function addresses; the INT retains the lookup information.
Explanation
Initially the INT and IAT are equal, but after resolution the IAT holds function addresses rather than the original lookup information.
- 117
How does the loader find the address of an imported function when it is identified by name?
Model answer
The loader finds a named import by searching the loaded library's export table for the corresponding function.
Explanation
To resolve a name, the loader searches the loaded DLL's export table; the content notes that the export lookup process is similar but does not detail it.
- 118
Why must import resolution also account for functions imported by the DLLs being loaded?
Model answer
The loader must also resolve the imports of loaded DLLs because those libraries may depend on other libraries.
Explanation
A loaded DLL may itself import functions, so the loader must resolve imports for dependent libraries as well.
- 119
Why should the example import-resolution code not be treated as an exact account of how the image loader works?
Model answer
The example's use of the image loader to load libraries bypasses many of the steps that the actual loader would perform, so the code is not an exact model of loader behavior.
Explanation
The example code's use of the image loader to load libraries bypasses many steps that the loader itself would otherwise perform.
- 120
Name three loader responsibilities beyond loading DLLs and resolving imports.
Model answer
The loader also initializes the heap, handles shims, and relocates images, among other tasks.
Explanation
Besides loading DLLs and resolving imports, the loader initializes the heap, handles shims, and relocates images.
- 121
What does the image loader do after completing its initialization work?
Model answer
The loader finishes by calling the application's entry point.
Explanation
After completing its work, the loader transfers execution to the application's entry point.

Ask anything
We've read this whole study set, so questions about it get the best answers.