bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PE header copyright issue


From: Joshua Hudson
Subject: Re: PE header copyright issue
Date: Sun, 17 Dec 2023 13:20:28 -0800

Hans-Peter Nilsson <hp@bitrange.com> wrote:
> Could you please add the assembly source too?
>
> Even if only as comments next to the corresponding byte-wise
> contents of default_dos_message[] would be nice.

Done.

I thought about it, and a block comment right next to the hex blob is
indeed the right way.
You're not setting up a build environment for it unless you want to
take additional build dependencies.

I'm going to be out for two weeks and not able to make any further code changes.

joshua@nova:/tmp$ gpg --clearsign --not-dash-escaped < binutilspe16.patch
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
NotDashEscaped: You need gpg to verify this message

diff --git a/bfd/peicode.h b/bfd/peicode.h
index e16bfc25437..3d253a45f4f 100644
--- a/bfd/peicode.h
+++ b/bfd/peicode.h
@@ -258,16 +258,19 @@ coff_swap_scnhdr_in (bfd * abfd, void * ext, void * in)
 static bool
 pe_mkobject (bfd * abfd)
 {
-  /* Some x86 code followed by an ascii string.  */
+  /* DOS error message emitter followed by message */
   static const char default_dos_message[64] = {
-    0x0e, 0x1f, 0xba, 0x0e, 0x00, 0xb4, 0x09, 0xcd,
-    0x21, 0xb8, 0x01, 0x4c, 0xcd, 0x21, 0x54, 0x68,
-    0x69, 0x73, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72,
-    0x61, 0x6d, 0x20, 0x63, 0x61, 0x6e, 0x6e, 0x6f,
-    0x74, 0x20, 0x62, 0x65, 0x20, 0x72, 0x75, 0x6e,
-    0x20, 0x69, 0x6e, 0x20, 0x44, 0x4f, 0x53, 0x20,
-    0x6d, 0x6f, 0x64, 0x65, 0x2e, 0x0d, 0x0d, 0x0a,
-    0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
     /* mov dx, message
        mov ah, 9 ; Out string
        int 21h
        mov ax, 4c01h ; exit process, code 1
        int 21h
message: */
+    0xba, 0x0c, 0x01, 0xb4, 0x09, 0xcd, 0x21, 0xb8,
+    0x01, 0x4c, 0xcd, 0x21, "This",
+    " program cannot ",
+    "be run in DOS mo",
+    "de.\x0d\x0a$" };

   pe_data_type *pe = bfd_zalloc (abfd, sizeof (*pe));
   abfd->tdata.pe_obj_data = pe;
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEzQMuEig2Xhk0+cu7b7uWgHSsbDwFAmV/Y/8ACgkQb7uWgHSs
bDyq/wf/UpGm5rEuLhiITeILpRigytZCHyYP5njqgB9Q9x9JTyFGOOOfYJFcVjEc
OKzGZjlvsxVyuzQO6+b14PtXvDfCofJFjUnVm6ucCH8mhVMTuyZttZ+fFRRTx3GS
9cRzX2LyZQU/c9RWDpc7Diy+MlQvGGLIC8DtV+oR/nCtaN3zvMptWalCXHipSfVG
J6QFURQ2uJ3MtbgrQZ2t41nKkoCH04GDd01vn725KYqKIMGoYr91fEdmrHNy/rpb
oo6dX7HqXTUr5/lowkuHHFnKJW0m8wjfdxYy5rQTebnG7gWU7OtCI/+bVEKwLa9F
VLyzCdoB0NDAZzHH+n5b0NqPwspyxA==
=AFq0
-----END PGP SIGNATURE-----



reply via email to

[Prev in Thread] Current Thread [Next in Thread]