Changeset 12766
- Timestamp:
- Sep 4, 2009, 4:09:49 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/source/lib/dumplisp.lisp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/lib/dumplisp.lisp
r12676 r12766 193 193 header-pos)))))))))) 194 194 195 195 ;;; Note that Windows executable files are in what they call "PE" 196 ;;; (= "Portable Executable") format, not to be confused with the "PEF" 197 ;;; (= "PowerPC Executable Format" or "Preferred Executable Format") 198 ;;; executable format that Apple used on Classic MacOS. 196 199 (defun %prepend-file (out-fd in-fd len #+windows-target application-type) 197 200 (declare (fixnum out-fd in-fd len)) … … 211 214 (:console #$IMAGE_SUBSYSTEM_WINDOWS_CUI) 212 215 (:gui #$IMAGE_SUBSYSTEM_WINDOWS_GUI))) 213 (offset (%get-long buf #x3c)))214 (assert (< offset bufsize) () "PE Fheader not within first ~D bytes" bufsize)216 (offset (%get-long buf (get-field-offset #>IMAGE_DOS_HEADER.lfanew)))) 217 (assert (< offset bufsize) () "PE header not within first ~D bytes" bufsize) 215 218 (assert (= (%get-byte buf (+ offset 0)) (char-code #\P)) () 216 "File does not appear to be a PE Ffile")219 "File does not appear to be a PE file") 217 220 (assert (= (%get-byte buf (+ offset 1)) (char-code #\E)) () 218 "File does not appear to be a PE Ffile")221 "File does not appear to be a PE file") 219 222 (assert (= (%get-byte buf (+ offset 2)) 0) () 220 "File does not appear to be a PE Ffile")223 "File does not appear to be a PE file") 221 224 (assert (= (%get-byte buf (+ offset 3)) 0) () 222 "File does not appear to be a PE Ffile")223 ;; File is a PE Ffile -- Windows subsystem byte goes at offset 68 in the225 "File does not appear to be a PE file") 226 ;; File is a PE file -- Windows subsystem byte goes at offset 68 in the 224 227 ;; "optional header" which appears right after the standard header (20 bytes) 225 ;; and the PE Fcookie (4 bytes)228 ;; and the PE cookie (4 bytes) 226 229 (setf (%get-byte buf (+ offset 4 20 68)) application-byte))) 227 230 (let* ((nwritten (fd-write out-fd buf nread)))
Note:
See TracChangeset
for help on using the changeset viewer.
