What does 0n0
mean in windbg ? My windbg
is showing all local variables with 0n1500
etc..
It ('0n') is the number prefix used to indicate a decimal representation in windbg. It allows the non-prefixed to be used for hexadecimal, for instance.
Happy coding.
0n
represents the base 10, ie. the number being displayed after n is in decimal notation.
Possible values for this:
0n
- Decimal
0x
- Hexadecimal
0t
- Octal
0y
- Binary
You can change the default display base (radix) for numeric data display and entry using n
command.
n16
- Change base to Hexadecimal
n10
- Change base to Decimal
n8
- Change base to Octal
Note that n2
is not allowed.
The following is taken from WinDBG command window while debugging a program. I am trying to get OS build number from its PEB (Process environment block). I am using Win10 19044 build.
0:000> n 16
base is 16
0:000> ?? @$proc->OSBuildNumber
unsigned short 0x4a64
0:000> n 10
base is 10
0:000> ?? @$proc->OSBuildNumber
unsigned short 0n19044
0:000> n 8
base is 8
0:000> ?? @$proc->OSBuildNumber
unsigned short 0t45144
Note that this will work only for numeric data types, and other types, such as pointers will still display in Hex, no matter what argument you use with n
.
0:000> n 8
base is 8
0:000> ?? @$proc->ImageBaseAddress
void * 0x00007ff6`6dfa0000
0:000> n 10
base is 10
0:000> ?? @$proc->ImageBaseAddress
void * 0x00007ff6`6dfa0000
0:000> n 16
base is 16
0:000> ?? @$proc->ImageBaseAddress
void * 0x00007ff6`6dfa0000
ImageBaseAddress
is of type void * (pointer type), hence is unaffected by n
command.
We can obviously do an explicit type cast.
0:000> n 10
base is 10
0:000> ?? DWORD(@$proc->ImageBaseAddress)
DWORD 0n1845100544
0:000> n 16
base is 16
0:000> ?? DWORD(@$proc->ImageBaseAddress)
DWORD 0x6dfa0000
© 2022 - 2024 — McMap. All rights reserved.