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
b741cc0f
Commit
b741cc0f
authored
Apr 19, 2000
by
John R. Sheets
Committed by
Alexandre Julliard
Apr 19, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor cleanups, plus fixed a couple bugs in .DBG parsing code.
Added dump for MISC section.
parent
3676c176
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
22 deletions
+45
-22
cvcrunch.c
tools/cvdump/cvcrunch.c
+1
-1
cvdump.c
tools/cvdump/cvdump.c
+32
-19
cvinclude.h
tools/cvdump/cvinclude.h
+10
-0
cvload.c
tools/cvdump/cvload.c
+2
-2
No files found.
tools/cvdump/cvcrunch.c
View file @
b741cc0f
...
...
@@ -25,7 +25,7 @@
* other structs.
*
* The contents of this section look like this (the first two fields are
*
already extracted and passed in as parameters
):
*
extracted and passed back out
):
*
* unsigned short cFile
* unsigned short cSeg
...
...
tools/cvdump/cvdump.c
View file @
b741cc0f
...
...
@@ -49,7 +49,7 @@ DWORD GetOffsetFromRVA (DWORD rva)
/* Assumes all RVA's in the section headers are sorted in increasing
* order (which should be the case).
*/
for
(
i
=
g_
dbg_dircount
-
1
;
i
>=
0
;
i
--
)
for
(
i
=
g_
numsects
-
1
;
i
>=
0
;
i
--
)
{
sectbegin
=
g_secthdrs
[
i
].
VirtualAddress
;
#ifdef VERBOSE
...
...
@@ -330,8 +330,8 @@ int DumpDebugDir (FILE *debugfile)
PrintFilePos
(
debugfile
);
printf
(
"Found %d
CodeView subsection%c
...
\n
"
,
g_dbg_dircount
,
(
g_dbg_dircount
==
1
)
?
'.'
:
's'
);
printf
(
"Found %d
Debug director%s
...
\n
"
,
g_dbg_dircount
,
(
g_dbg_dircount
==
1
)
?
"y"
:
"ies"
);
if
(
g_dbg_dircount
==
0
)
return
FALSE
;
...
...
@@ -347,20 +347,11 @@ int DumpDebugDir (FILE *debugfile)
fseek
(
debugfile
,
filepos
,
SEEK_SET
);
PrintFilePos
(
debugfile
);
}
#if 0
else
{
int i;
/* Find the .rdata section.
*/
for (i = 0; i < g_numsects; i++)
if (strcmp (g_secthdrs[i].Name, ".rdata") == 0)
break;
filepos = g_secthdrs[i].PointerToRawData;
fseek
(
debugfile
,
g_dbghdr
.
ExportedNamesSize
,
SEEK_CUR
);
PrintFilePos
(
debugfile
);
}
#endif
if
(
!
ReadDebugDir
(
debugfile
,
g_dbg_dircount
,
&
g_debugdirs
))
return
FALSE
;
...
...
@@ -387,6 +378,22 @@ int DumpDebugDir (FILE *debugfile)
printf
(
" SizeOfData = [0x%8lx]
\n
"
,
g_debugdirs
[
i
].
SizeOfData
);
printf
(
" AddressOfRawData = [0x%8lx]
\n
"
,
g_debugdirs
[
i
].
AddressOfRawData
);
printf
(
" PointerToRawData = [0x%8lx]
\n
"
,
g_debugdirs
[
i
].
PointerToRawData
);
if
(
g_debugdirs
[
i
].
Type
==
IMAGE_DEBUG_TYPE_MISC
)
{
IMAGE_DEBUG_DIRECTORY_MISC
misc
;
int
lastpos
=
ftell
(
debugfile
);
size_t
bytes_read
;
/* FIXME: Not sure exactly what the contents are supposed to be. */
fseek
(
debugfile
,
g_debugdirs
[
i
].
PointerToRawData
,
SEEK_SET
);
bytes_read
=
fread
(
&
misc
,
1
,
sizeof
(
IMAGE_DEBUG_DIRECTORY_MISC
),
debugfile
);
printf
(
"
\n
[0x%8lx]
\n
[0x%8lx]
\n
[0x%4x]
\n
[0x%4x]
\n
'%s'
\n
"
,
misc
.
unknown1
,
misc
.
SizeOfData
,
misc
.
unknown2
,
misc
.
unknown3
,
misc
.
Name
);
fseek
(
debugfile
,
lastpos
,
SEEK_SET
);
}
}
free
(
g_debugdirs
);
...
...
@@ -782,8 +789,8 @@ int DumpSrcModuleInfo (int index, FILE *debugfile)
}
/* Read in the entire sstSrcModule from the .DBG file. We'll process it
* bit by bit, b
ut
passing memory pointers into the various functions in
* cv
print
.c.
* bit by bit, b
y
passing memory pointers into the various functions in
* cv
crunch
.c.
*/
if
(
!
ReadChunk
(
debugfile
,
(
void
*
)
rawdata
,
g_cvEntries
[
index
].
cb
,
fileoffset
))
return
FALSE
;
...
...
@@ -831,7 +838,7 @@ int DumpAlignSymInfo (int index, FILE *debugfile)
/*
* Print out the info of all related modules (e.g. sstAlignSym, sstSrcModule)
* for the
desired sub-section
(i.e. sstModule).
* for the
given sub-section index
(i.e. sstModule).
*/
int
DumpRelatedSections
(
int
index
,
FILE
*
debugfile
)
{
...
...
@@ -925,9 +932,15 @@ int DumpAllModules (FILE *debugfile)
{
int
i
;
if
(
g_cvHeader
.
cDir
==
0
||
g_cvEntries
==
NULL
)
if
(
g_cvHeader
.
cDir
==
0
)
{
printf
(
"
\n
Strange...found CodeView header, but no module entries
\n\n
"
);
return
TRUE
;
}
if
(
g_cvEntries
==
NULL
)
{
printf
(
"ERROR:
B
ailing out of Module Data Dump
\n
"
);
printf
(
"ERROR:
Invalid entry table, b
ailing out of Module Data Dump
\n
"
);
printf
(
"%ld %p
\n
"
,
g_cvHeader
.
cDir
,
g_cvEntries
);
return
FALSE
;
}
...
...
tools/cvdump/cvinclude.h
View file @
b741cc0f
...
...
@@ -24,6 +24,16 @@
#include "pshpack1.h"
/* FIXME: no idea if this is correct */
typedef
struct
{
DWORD
unknown1
;
DWORD
SizeOfData
;
WORD
unknown2
;
WORD
unknown3
;
char
Name
[
MAX_PATH
];
}
IMAGE_DEBUG_DIRECTORY_MISC
;
/*
* CodeView headers
*/
...
...
tools/cvdump/cvload.c
View file @
b741cc0f
...
...
@@ -318,7 +318,7 @@ int ReadCodeViewDirectory (FILE *debugfile, int entrynum, OMFDirEntry **entries)
/*
* Load in the data contents of all CodeView sstModule sub-sections in the file (likely a
* large array, as there is one sub-section for every module... > 100 modules is normal).
* large array, as there is one sub-section for every
code
module... > 100 modules is normal).
* 'entrynum' should hold the total number of CV sub-sections, not the number of sstModule
* subsections. The function will ignore anything that isn't a sstModule.
*
...
...
@@ -408,7 +408,7 @@ int ReadModuleData (FILE *debugfile, int entrynum, OMFDirEntry *entries,
if
(
pad
)
namelen
+=
(
4
-
pad
);
module
->
Name
=
calloc
(
namelen
,
sizeof
(
char
)
+
1
);
module
->
Name
=
calloc
(
namelen
+
1
,
sizeof
(
char
)
);
bytes_read
=
fread
(
module
->
Name
,
sizeof
(
char
),
namelen
,
debugfile
);
if
(
bytes_read
<
namelen
)
{
...
...
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