Sniffing for crashes (09 Jan 2008)

A few months ago, I blogged about crash reporting under Windows XP and Vista. The protocol between Windows and Microsoft's Watson servers is undocumented, but contains useful hints on how the mechanism works. Back then, I hinted that I had intercepted the crash reporting traffic to learn more about it, but I didn't fully describe how I did that.

If only I could remember, that is big grin

Well, I remember the basic approach, and I even took some notes back then which I will regurgitate here and now. However, don't expect step-by-step instructions.

My goal was to take control of the crash reporting process in my application. When an application crashes, Microsoft's official recommendation is that it should not try to catch the fatal exception, but instead simply bail out, let Windows perform its crash reporting rites, and then terminate. For various reasons, we needed more control over the process, and so I set out on a discovery tour through the Windows Error Reporting APIs which Microsoft introduced in Windows Vista. The details of this epic saga can be found at:

For a long time, I simply couldn't get crash reporting to work as I expected it to. I had pretty much exhausted most of the official documentation, so I needed to dig deeper.

When an application crashes and the user agrees to send the crash data to Microsoft, Windows contacts Microsoft's Watson servers. For some reason, my crash reports weren't accepted there, while the usual plain vanilla crashme.exe could successfully dump its debris to Microsoft's servers. Hence, the idea was to look at the network traffic and find the differences between my crash reports and those produced by the proverbial crashme.exe.

I could have run the usual network sniffing suspects to decode LAN traffic including all the email exchanged between my boss and his boss, of course. But there is an even easier and less controversial approach: For corporate environments, where admins often need more control over the crash reporting process, Microsoft introduced corporate error reporting (CER), where crashing systems can contact a local server rather than sending all those confidential access violations to Microsoft.

There are registry entries to set the server name and port for corporate error reporting:

  • HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Windows Error Reporting\CorporateWERServer: Name of the local crash reporting server
  • HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Windows Error Reporting\CorporateWERPortNumber: Port number to be used for communication

On my Vista system, I modified CorporateWERServer so that it referred to my laptop. I did not set the port number explicitly; using procmon, I found that the default port is 1273.

On my laptop, I installed netcat and had it listen to input from port 1273 (nc -l273 or something like that). Once the port was open, Vista started to send HTTP POST requests to it - so the CER server really is a specialized HTTP server listening to port 1273! Here's a typical request (slightly polished and anonymized) following a crash in a sample app I was writing back then:

POST /stage2.htm HTTP/1.1
User-Agent: MSDW
Host: mylaptop:1273
Content-Length: 1110
Connection: Keep-Alive

<?xml version="1.0" encoding="UTF-16"?>
<WERREPORT xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <MACHINEINFO machinename="myvistabox" os="6.0.6000.2.0.0.256.16" lcid="1033"/>
   <USERINFO username="myvistabox\clausb"/>
   <APPLICATIONINFO appname="werapitest.exe" apppath="C:\tmp\werapitest.exe"/>
   <EVENTINFO reporttype="1" eventtime="128267449141252896" eventtype="werapitest (eventType)" 
      friendlyeventname="werapitest (friendly event name)" eventdescription="Critical runtime problem"/>
   <SIGNATURE>
   </SIGNATURE>
</WERREPORT>

By comparing this kind of payload with the traffic generated by a plain vanilla crashme.exe program, I could experiment with the various WER APIs and settings until I had finally figured out how to use them. Without crash report sniffing, I'd probably still be experimenting...


Entendämmerung (02 Jan 2008)

Ich bin aufgewachsen mit den Werken von Carl Barks, und auch heute noch halte ich ihnen die Treue. Die Verehrung fuer Carl Barks war so gross, dass ich Mitglied der D.O.N.A.L.D. wurde. Die "Deutsche Organisation Nichtkommerzieller Anhänger des Lauteren Donaldismus" widmet sich der hinreissend zweckfreien Betrachtung der Barksschen Werke auf so amüsante Weise, dass es mir ganz und gar nichts ausmachte, dass meine Mitgliedsbeiträge bei sympathisch improvisiert wirkenden Maifeiern, Zwischenzeremonien und Kongressen verprasst wurden.

Man lernt in diesem Verein übrigens auch schnell, dass die Republik donaldistisch unterwandert ist: Die geistigen Kinder von Carl Barks und seiner kongenialen deutschen Übersetzerin Erika Fuchs sind längst den Watschelgang durch die Institutionen angetreten. Das Feuilleton der Frankfurter Allgemeine Zeitung beispielsweise ist vollständig in der Hand von Federviehfetischisten. Und auch die Stuttgarter Zeitung veröffentlicht in schöner Unregelmässigkeit Beiträge oder auch nur Bilder mit verdächtig anatidem Hintergrund.

Nicht nur, dass Barks meinen Geschmack für gut erzählte Geschichten geprägt hat, er hat auch meine Berufswahl entscheidend beeinflusst: Der Herr Ingeniör, dem nichts zu schwör war - das war der Held meiner Kindheit.

Und doch bin ich jetzt aus der D.O.N.A.L.D. ausgetreten und habe dazu auch noch mein Abo der Tollsten Geschichten von Donald Duck gekündigt. Ein wenig traurig ist das schon - aber es war denn doch unvermeidlich.

Zum einen habe ich "meinen Barks" inzwischen schon mehrfach beisammen, die Regale biegen sich. Zum anderen aber fiel mir vor einigen Jahren - auf der Suche nach amerikanischen Donald-Duck-Heften - in einen Comicladen in den USA ein Exemplar von "V for Vendetta" in die Hände, eine düstere, provokante, gewalttätige und verwirrende graphic novel von Alan Moore und David Lloyd.

Barks ist seither die Lektüre für die hellen Stimmungen geworden - in den dunklen Zeiten aber versinke ich in den verblüffenden Hirngespinsten von Alan Moore. Oder in Serien wie "Y - The Last Man", in der Brian K. Vaughan seine Hauptfigur in eine Welt setzt, in der er das letzte männliche Wesen ist. Oder DMZ, in dem Manhattan zwischen die Fronten eines Bürgerkriegs gerät. Oder ich grüble über Sin City, in dem Frank Miller so heftig Gewaltphantasien frönt, dass ich immer noch nicht so richtig weiss, ob ich das für gefährlich oder für erstaunlich halten soll...

Alle diese tollen Geschichten sind also hiermit wärmstens empfohlen - aber zumindest im Falle von DMZ und Sin City nur für Leser mit guten Nerven. Und für alle anderen gibt es immer noch die geliebten Vierfingler und Schnabelträger aus Duckburg.


Previous month: Click here.


to top


You are here: Blog > DefinePrivatePublic200801

r1.2 - 09 Jan 2008 - 20:57 - ClausBrod to top

Blog
This site
RSS

  2017: 12 - 11 - 10
  2016: 10 - 7 - 3
  2015: 11 - 10 - 9 - 4 - 1
  2014: 5
  2013: 9 - 8 - 7 - 6 - 5
  2012: 2 - 10
  2011: 1 - 8 - 9 - 10 - 12
  2010: 11 - 10 - 9 - 4
  2009: 11 - 9 - 8 - 7 -
     6 - 5 - 4 - 3
  2008: 5 - 4 - 3 - 1
  2007: 12 - 8 - 7 - 6 -
     5 - 4 - 3 - 1
  2006: 4 - 3 - 2 - 1
  2005: 12 - 6 - 5 - 4
  2004: 12 - 11 - 10
  C++
  CoCreate Modeling
  COM & .NET
  Java
  Mac
  Lisp
  OpenSource
  Scripting
  Windows
  Stuff
Changes
Index
Search
Maintenance
Impressum
Datenschutzerklärung
Home



Jump:

Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback