Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
30f981d9
Commit
30f981d9
authored
Apr 13, 2010
by
Evan Shaw
Committed by
Russ Cox
Apr 13, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
8l: add DOS stub to PE binaries
R=rsc CC=golang-dev
https://golang.org/cl/915041
parent
1b56947f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
2 deletions
+23
-2
pe.c
src/cmd/ld/pe.c
+23
-2
No files found.
src/cmd/ld/pe.c
View file @
30f981d9
...
...
@@ -11,6 +11,28 @@
#include "../ld/lib.h"
#include "../ld/pe.h"
// DOS stub that prints out
// "This program cannot be run in DOS mode."
static
char
dosstub
[]
=
{
0x4d
,
0x5a
,
0x90
,
0x00
,
0x03
,
0x00
,
0x04
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0xff
,
0xff
,
0x00
,
0x00
,
0x8b
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x40
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x80
,
0x00
,
0x00
,
0x00
,
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
};
static
int
pe64
;
static
int
nsect
;
static
int
sect_virt_begin
;
...
...
@@ -64,8 +86,7 @@ pewrite(void)
{
int
i
,
j
;
strnput
(
"MZ"
,
0x3c
);
LPUT
(
0x40
);
// file offset to PE header
write
(
cout
,
dosstub
,
sizeof
dosstub
);
strnput
(
"PE"
,
4
);
for
(
i
=
0
;
i
<
sizeof
(
fh
);
i
++
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment