Is there a Windbg/NTSD command to tell me if a process I have attached to in a live debugging session is a 32-bit one or a 64-bit one?
Could you please tell me for both:
- An unmanaged process?
and
- A managed one?
For a managed one, I can find that out programmatically in C# but still I'd like to know if there's a Windbg command for this.
UPDATE
The target process I am debugging is Microsoft Word (winword.exe). The Office version is 2016 but I am not sure if it is a 32-bit or a 64-bit binary. Here are some observations:
The target location is C:\Program Files (x86)\Microsoft Office\root\Office16\WinWord.exe
The pipe (
|
) command tells me nothing more than PID, whether the process is attached to the debugger or not and the path from where the image is loaded (as noted in #1 above).I am debugging this on a 64-bit machine. So, r reveals 64-bit registers.
Upon attaching to a live, healthy process with no crashes (I just opened MS Word and said "Attach to Process"), the callstack for the current thread (
k
) readswow64cpu!CpupSyscallStub+0x9
for the top-most call. This, with #1 suggests that the process is a 32-bit process.
Commands already tried
- !peb (Process Environment Block): Tells us the PROCESSOR ARCHITECTURE, not the bitness of the process being debugged.
- |
- vertarget
- r (indicates register size for my processor and does not tell me about the process)
But I'm wondering if there's a way to find out.
k
can show you the method addresses, which indicate the pointer size and clearly the process bitness. – Lillivertarget
before posting this question. I could be wrong butvertarget
tells us everything else like environment variables, process and system uptime, commandline arguments and their values. It does not tell us the process architecture for the current process. I'd like to be corrected if I am wrong. – Gable