Index: /trunk/source/lib/dumplisp.lisp
===================================================================
--- /trunk/source/lib/dumplisp.lisp	(revision 12776)
+++ /trunk/source/lib/dumplisp.lisp	(revision 12777)
@@ -227,5 +227,5 @@
                 ;;  "optional header" which appears right after the standard header (20 bytes)
                 ;;  and the PE cookie (4 bytes)
-                (setf (%get-byte buf (+ offset 4 20 68)) application-byte)))
+                (setf (%get-byte buf (+ offset 4 (record-length #>IMAGE_FILE_HEADER) (get-field-offset #>IMAGE_OPTIONAL_HEADER.Subsystem) )) application-byte)))
             (let* ((nwritten (fd-write out-fd buf nread)))
 	      (declare (fixnum nwritten))
