Notepad.exe Location Windows 11

0 views
Skip to first unread message

Kanisha Marchant

unread,
Aug 5, 2024, 3:25:30 AM8/5/24
to conscrochdeland
Byperforming a search I found that notepad.exe in c:\windows, c:\windows\system and c:\windows\system32, and in all three locations I have tried to replace it with the file taken from another Windows 7 PC but I get the same error.

Notepad is perhaps the most commonly hardcoded program in Windows. many Setup programs use it to view the Readme file, and you can use your imagination to come up with other places where a program or batch file or printed instructions will hard-code the path to Notepad.


I have had this problem since upgrading from Textpad 5 to Textpad 6, which has an option to 'Replace Notepad'. I could not run notepad by double-clicking, or launching from a command prompt from any of its many locations.


had a "Debugger" reg_sz value which pointed to the non-existent Textpad 5. So the debugger value overrides the requested image file with an alternate image file of your choice. Nice, if a little dangerous because any Windows image file can be silently overridden.


I have encountered a similar issues if my %PATH% environment variable is too long. Check your environment variables and see if there are any old uninstalled programs still sitting in your PATH variable and remove them.


So I was looking around in my windows folder and I noticed a strange notepad.exe with no image. It works as notepad properly but I would like to know if this is some sort of piece of malware that is being hidden.

I also put it in virus total and saw some other people were reporting problems with it. Someone who is more experienced with this stuff please get back to me.



Virus total link:


attempting to copy program file notepad.exe from the \windows to the \tools directory using command prompt. Trying to complete simple tasks using command prompt, but still unable to grasp. have not found a set of instructions that clicks for me, very new to "computing"


Is there any known legitimate reason that notepad.exe would make network connections to a domain controller? I observed this behavior. The first connection was to port 135 and the second was to one of the Microsoft RPC dynamic ports. In addition I also observed an SNMP request (port 161 udp) to some random device where sysmon reported the source process as C:\windows\system32\notepad.exe


When a shell dialog (file open/save, print, etc.) is opened, network traffic generated by accesses to SMB file shares or other network resources will be attributed to the process that is accessing those resources. That means both direct connections to the system that is hosting the resource, and connections to the domain if services need to be discovered, policies need to be looked up, or authentication tokens need to be requested. As such, seeing traffic to port 135 from Notepad in a domain is not that unusual. It'd be even more likely if you're replicating user profiles to a central location so that a user can roam to other workstations.


Seeing SNMP from that process is rather unusual. One explanation might be if a security or monitoring product you have installed sends back telemetry from modules that are injected into running processes. I know that SolarWinds uses SNMP for some of its telemetry collection, but I'm not sure on the exact implementation.


If you don't have more information to go on, such as packet captures of the traffic in question, I would recommend being cautious and following your incident response plan. At minimum I would get someone qualified to do some forensic capture and investigation of the affected host.


This post goes over the important commands in WinDBG through a step-by-step follow-along style walkthrough to help you get a jump start into using WinDBG and getting familiar with the commonly used commands.This is required pre-course reading for the Windows Security Developer Bootcamp.


We will use WinDBG Preview which can be downloaded from the Windows Store. The version that was used to write this post is WinDBG 1.0.2007.06001. All examples used in the post are from WinDBG running on Windows 10 Version 19042 64-bit version.


Prior to starting the debug session, we will set up the symbol path that we want WinDBG to use by running the following command in an administrative CMD.exe. If you have the variable _NT_SYMBOL_PATH already set up, you don't have to change it, and therefore running the following command would not be necessary.


We are ready to start the debugger.There are a few different ways to use WinDBG to debug a process, the most common ones are attaching to a running process and launching a process from WinDBG. For this walkthrough, we will be launching the native 64-bit executable from WinDBG.


When WinDBG launches an application, it stops at the initial breakpoint before the main entry point of the application is executed. When WinDBG launches notepad.exe the following lines will be displayed in WinDBG's command Window. This allows us to run some initial commands and set any desired breakpoints before the main entry point is called. More on this later.


Before we proceed any further let us quickly review the WinDBG Preview process architecture. WinDBG Preview is a UWP application that has very limited access to the system, certainly not enough to debug a process. Hence the WinDBG UI and the WinDBG debugger workhorse are in separate processes that communicate using the named pipe inter-process communication (IPC) mechanism.The WinDBG Preview UI process is DBG.X.Shell.exe which connects over a named pipe to EngHost.exe which is the process responsible for attaching or launching the process being debugged.


The following command displays the command-line options that were passed to the debugger process (EngHost.exe). The named pipe with the name DbgX_c07674536fa94c33bdf0af63c782f816 is used by DbgX.Shell.exe to communicate with EngHost.exe.


Let us obtain some basic information about the OS version and the process being debugged. The Show Target Computer Version (vertarget) command displays information about the Windows version and information debug session time.


Prior to starting WinDBG, we had set up the environment variable _NT_SYMBOL_PATH to the symbol path. WinDBG should have automatically used the symbol path set in this variable. Let us verify that using the Set Symbol Path (.sympath) command. Note that the (.) in front of the command denotes that this is a meta-command. Most such commands cause a change in the behavior of the debugger. In this specific case, the (.sympath) command could be used with the (+) option to append another path to the current symbol path.


To find the path to the symbol file (.PDB) that the debugger is using for notepad we can use the debugger extension command (!lmi). This command parses the PE headers and displays information retrieved from the PE file's Debug Directory.


In WinDBG, the name of any module is treated as an expression that evaluates to the start VA at which the module is loaded into memory. If we use the MASM expression evaluator operator (?) on the module "notepad", it displays the start VA of the module.


At this point, we have found a reasonable bit of information about the process being debugged. We will now set a breakpoint on the main entry point of the PE file of notepad.exe. To do so, we must find the symbol that represents the main entry point of notepad.exe. To obtain a list of all such symbols we use the Examine Symbol (x) command which accepts wildcards and therefore makes it quite convenient to obtain a list of functions that end with the word main. The parameter we are passing to the (x) command consists of - the name of the module (without the extension), the exclamation sign (!) as the separator followed by the name of the symbols (containing wildcards).


It is noteworthy that the bp command was able to resolve the symbol notepad!wWinMain to the appropriate address i.e. 00007ff6`f883b090 and was able to set an execution breakpoint and enable it as indicated by the (e) in the output above.


WinDBG has stopped the execution of notepad.exe at the first instruction of the function notepad!wWinMain.Let us ascertain that by retrieving the value of all the x64 CPU registers.The values in the registers would also assist us with retrieving the parameters that were passed to this function since on x64 the first 4 parameters are passed in CPU registers.To retrieve the CPU registers we use the Registers (r) command.


The above output confirms that the address in the instruction pointer (RIP) indeed points to the first instruction of the function notepad!wWinMain.The prototype of the function wWinMain is as shown below along with the CPU registers that contain the respective parameters.


The RSP register points to the top of the stack of the current thread. For a 64-bit process, each value stored on the stack is 64-bits in size i.e. a pointer-sized value.To display the contents of memory starting at the address in the RSP register we use the (dp) variant of the Display Memory command.


And last but not the least, if we would like WinDBG to automatically attempt to map each one of the displayed values to symbols the (dps) variant of the Display Referenced Memory command can be used which in case of the stack would display all the return addresses as the map to symbols representing addresses within the functions that have been pushed on the stack by call instructions.


Now that we have learned how to display the raw contents of the stack using the RSP register, let us view the stack the way it is meant to be displayed by the debuggers using the Display Stack Backtrace (k) command and its variants.


The information displayed is the call chain from the start of this thread's execution (ntdll!RtlUserThreadStart) all the way to the current function (notepad!wWinMain) on which we set our breakpoint. Let's dig a little deeper into the displayed call stack.


The values listed under Child-SP are the values of stack-pointer (RSP) register for the frame.This is the value of the RSP register right after the prolog of the function listed under the Call Site column has finished execution.This value in the RSP register remains static throughout the function body. Local variables and stack-based parameters to the function are accessed using this value in RSP.

3a8082e126
Reply all
Reply to author
Forward
0 new messages