Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
d75e0cd1
Commit
d75e0cd1
authored
Jan 05, 2007
by
Eric Pouech
Committed by
Alexandre Julliard
Jan 06, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedump: Print some basic info for pure DOS file (which fixes segfault while reading DOS files).
parent
b63098cf
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
1 deletion
+73
-1
Makefile.in
tools/winedump/Makefile.in
+1
-0
dos.c
tools/winedump/dos.c
+70
-0
dump.c
tools/winedump/dump.c
+1
-1
winedump.h
tools/winedump/winedump.h
+1
-0
No files found.
tools/winedump/Makefile.in
View file @
d75e0cd1
...
...
@@ -10,6 +10,7 @@ MODULE = none
C_SRCS
=
\
debug.c
\
dos.c
\
dump.c
\
emf.c
\
le.c
\
...
...
tools/winedump/dos.c
0 → 100644
View file @
d75e0cd1
/*
* DOS dumping utility
*
* Copyright 2006 Eric Pouech
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <time.h>
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
#include <fcntl.h>
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "windef.h"
#include "winbase.h"
#include "winedump.h"
void
dos_dump
(
void
)
{
const
IMAGE_DOS_HEADER
*
dh
;
if
((
dh
=
PRD
(
0
,
sizeof
(
IMAGE_DOS_HEADER
))))
{
printf
(
"DOS image:
\n
"
);
printf
(
" Signature: %.2s
\n
"
,
(
const
char
*
)
&
dh
->
e_magic
);
printf
(
" Bytes on last page: %u
\n
"
,
dh
->
e_cblp
);
printf
(
" Number of pages: %u
\n
"
,
dh
->
e_cp
);
printf
(
" Relocations: %u
\n
"
,
dh
->
e_crlc
);
printf
(
" Size of header: %u
\n
"
,
dh
->
e_cparhdr
);
printf
(
" Min extra paragraphs: %u
\n
"
,
dh
->
e_minalloc
);
printf
(
" Max extra paragraphs: %u
\n
"
,
dh
->
e_maxalloc
);
printf
(
" Initial stack: %x:%x
\n
"
,
dh
->
e_ss
,
dh
->
e_sp
);
printf
(
" Checksum: %x
\n
"
,
dh
->
e_csum
);
printf
(
" Initial address: %x:%x
\n
"
,
dh
->
e_cs
,
dh
->
e_ip
);
printf
(
" Relocation (file): %u
\n
"
,
dh
->
e_lfarlc
);
printf
(
" Overlay number: %u
\n
"
,
dh
->
e_ovno
);
printf
(
" OEM id(info): %x(%x)
\n
"
,
dh
->
e_oemid
,
dh
->
e_oeminfo
);
printf
(
" Offset to ext header: %x
\n
"
,
dh
->
e_lfanew
);
}
}
tools/winedump/dump.c
View file @
d75e0cd1
...
...
@@ -151,7 +151,7 @@ static const struct dumper
}
dumpers
[]
=
{
{
SIG_DOS
,
get_kind_exec
,
NULL
},
{
SIG_DOS
,
get_kind_exec
,
dos_dump
},
{
SIG_PE
,
get_kind_exec
,
pe_dump
},
{
SIG_DBG
,
get_kind_dbg
,
dbg_dump
},
{
SIG_PDB
,
get_kind_pdb
,
pdb_dump
},
...
...
tools/winedump/winedump.h
View file @
d75e0cd1
...
...
@@ -241,6 +241,7 @@ void dump_optional_header(const IMAGE_OPTIONAL_HEADER32 *, UINT);
void
dump_section
(
const
IMAGE_SECTION_HEADER
*
);
enum
FileSig
get_kind_exec
(
void
);
void
dos_dump
(
void
);
void
pe_dump
(
void
);
void
ne_dump
(
void
);
void
le_dump
(
void
);
...
...
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