========================================================================================================= DEBUGGER (CDB/WINDBG) ========================================================================================================= * Kommentar .printf "", Text ausgeben, mit z.B. %i dann einfügen (ala C/C++) .logopen logfile erzeugen/öffnen .logclose logfile schließen .cmdtree cmdtree laden (befehle im GUI als baum einblenden) .sympath aktuellen sympath anzeigen .sympath symbolconfig (srv*c:\symbols*http://msdl.microsoft.com/download/symbols) .sympath+ symbolconfig hinzufügen (srv*c:\symbols*https://nuget.smbsrc.net - für Nuget) .srcpath sourcepfad anzeigen .srcpath+ sourcepfad hinzufügen .open -a source zu funktion/typ (aus x oder dt) öffnen wenn möglich (s. srcpath) .time timestamp information zum dump .cordll -ve -u -l .NET debug support laden (oder .load C:\WINDOWS\Microsoft.NET\Framework*\v4.0.30319\SOS.DLL) .NET 5/6: dotnet tool install --global dotnet-sos / dotnet-sos install / .load \sos.dll .cordll -vd .NET debug support beenden .open file im debugger öffnen .dump /ma aktuelles target dumpen .shell shell kommando ausführen .shell_quit shell kommando stoppen falls es noch läuft .frame frame im call stack auswählen .server tcp:port= server auf port erzeugen (alternativ auch mit DBGSRV.EXE) clientaufruf: windbg -remote tcp:Port=,Server= ========================================================================================================= EXTENSIONS ========================================================================================================= .chain geladene extensions anzeigen .load laden .unload entladen .extpath aktuellen extension path anzeigen .extpath extension path setzen .extpath+ zum extension path hinzufügen SosEx.dll http://www.stevestechspot.com/downloads/sosex_32.zip http://www.stevestechspot.com/downloads/sosex_64.zip NetExt.dll https://github.com/rodneyviana/netext Mex.dll https://www.microsoft.com/en-us/download/details.aspx?id=53304 iisinfo.dll Teil von DebugDiag ========================================================================================================= PROZESS/DUMP ========================================================================================================= | information zum aktuellen prozess || position vom dump k call stack k of frames from call stack lm alle geladenen module anzeigen lm vm info zu modul (v=verbose -> versionen, resource table etc.) ln list nearest smybol x ! eXamine funktionen/types aus dem modul, func mit * als wildcard möglich dd,dc,db,da,du,dq,dp display memory als doublewords,ASCII bytes,bytes,unicode,quadwords,pointers ed,eb,ea,eu edit memory auf mit wert (doubleword,byte,ASCII string,unicode string) dt ! -v DumpTypes aus dem modul, type mit * als wildcard möglich (-v auch wenn keine typinformation vorhanden ist) dt -r (Form: !, beispiel ntdll!_PEB) anzeigen (-r für rekursiv) dx debugger OM expression [https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/dx--display-visualizer-variables-] dps ab
32/64 bit (je nach target) potentielle symbole anzeigen (dds=32 bit,dqs=64 bit) dv lokale variablen anzeigen (private symbole vorausgesetzt) sx status exception handling anzeigen sxe,sxd,sxi,sxn,sxr

exception handling: enable, disable, ignore, notify, reset to defaults

gibt an wann: [https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/controlling-exceptions-and-events] !dh dump header !sos.help .NET extension hilfe !sos.pe .NET print exception !sos.AnalyzeOOM .NET out of memory analysis r cpu register uf ! /i unassemble function (/i mit zeilennummer wenn symbole vorhanden) uu

assembler ab
anzeigen (ub für zurück) wt -l -or trace laufen lassen ( level) und statistik/jeweils returncode anzeigen .exr -1 letzte exception anzeigen !gle letzten fehlercode vom aktuellen thread anzeigen !gflag gesetzte GFLAGS anzeigen !runaway 1+2+4 CPU time (User/Kernel/Elapsed) !cs -l critical sections (-l = lock status) !locks locks anzeigen (alternativ zu !cs -l) ========================================================================================================= KERNEL ========================================================================================================= !process aktiven prozess anzeigen !process 0 0 alle prozesse anzeigen !process
prozess auf (aus 0 0 liste) anzeigen .process
aktiven prozess setzen (aus 0 0 liste) !token
prozesstoken anzeigen !thread
thread auf anzeigen .thread
aktiven thread setzen !irp
IRP anzeigen !object windows objekte anzeigen (ala WinObj) ========================================================================================================= BREAKPOINTS ========================================================================================================= bp ! breakpoint adden, func ohne wildcard notwendig bm ! mehrere breakpoints adden, func mit wildcard * möglich bl breakpoints anzeigen bc breakpoint löschen, mehrere mit blanks trennen ========================================================================================================= .NET 5+ [dotnet-xxxx --help] ========================================================================================================= dotnet-symbol symbol download/handling (dotnet tool install -g dotnet-symbol) dotnet-dump dump erzeugen/analysieren (dotnet tool install -g dotnet-dump) dotnet-dump collect -p dotnet-dump analyze dotnet-counters .NET perf counter loggen (dotnet tool install -g dotnet-counters) dotnet-counters collect -pid dotnet-trace EventPipe based traces (dotnet tool install -g dotnet-trace) dotnet-trace collect -pid dotnet-trace report -topN ========================================================================================================= MEMORY ========================================================================================================= !vprot page protection anzeigen !address -summary nativen heap anzeigen !handle handles anzeigen !wow64exts.sw switch auf guest mode (WoW 64 > 32 bit) !peb Environment !heaps native heaps !dumpheap .NET heaps !eeheap .NET heaps (execution engine - GC u.ä.) !clrstack .NET call stack !dumpstack nativen stack dumpen, muss nicht alles stimmen weil teile nicht mehr aktiv sein müssen ========================================================================================================= THREADS ========================================================================================================= ~ threads anzeigen ~s auf thread setzen (debugger prompt hinterm : ist die thread id) ~k call stack von thread (*=alle)