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
15427221
Commit
15427221
authored
Dec 07, 2006
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Dec 07, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedump: Export dump_section() for use outside of pe.c.
parent
7928f546
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
12 deletions
+17
-12
pe.c
tools/winedump/pe.c
+16
-12
winedump.h
tools/winedump/winedump.h
+1
-0
No files found.
tools/winedump/pe.c
View file @
15427221
...
@@ -370,16 +370,10 @@ static void dump_pe_header(void)
...
@@ -370,16 +370,10 @@ static void dump_pe_header(void)
dump_optional_header
((
const
IMAGE_OPTIONAL_HEADER32
*
)
&
PE_nt_headers
->
OptionalHeader
,
PE_nt_headers
->
FileHeader
.
SizeOfOptionalHeader
);
dump_optional_header
((
const
IMAGE_OPTIONAL_HEADER32
*
)
&
PE_nt_headers
->
OptionalHeader
,
PE_nt_headers
->
FileHeader
.
SizeOfOptionalHeader
);
}
}
static
void
dump_sections
(
const
void
*
addr
,
unsigned
num_sect
)
void
dump_section
(
const
IMAGE_SECTION_HEADER
*
sectHead
)
{
{
const
IMAGE_SECTION_HEADER
*
sectHead
=
addr
;
printf
(
" %-8.8s VirtSize: %-8u VirtAddr: %-8u 0x%08x
\n
"
,
unsigned
i
;
sectHead
->
Name
,
sectHead
->
Misc
.
VirtualSize
,
sectHead
->
VirtualAddress
,
printf
(
"Section Table
\n
"
);
for
(
i
=
0
;
i
<
num_sect
;
i
++
,
sectHead
++
)
{
printf
(
" %02d %-8.8s VirtSize: %-8u VirtAddr: %-8u 0x%08x
\n
"
,
i
+
1
,
sectHead
->
Name
,
sectHead
->
Misc
.
VirtualSize
,
sectHead
->
VirtualAddress
,
sectHead
->
VirtualAddress
);
sectHead
->
VirtualAddress
);
printf
(
" raw data offs: %-8u raw data size: %-8u
\n
"
,
printf
(
" raw data offs: %-8u raw data size: %-8u
\n
"
,
sectHead
->
PointerToRawData
,
sectHead
->
SizeOfRawData
);
sectHead
->
PointerToRawData
,
sectHead
->
SizeOfRawData
);
...
@@ -448,8 +442,18 @@ static void dump_sections(const void* addr, unsigned num_sect)
...
@@ -448,8 +442,18 @@ static void dump_sections(const void* addr, unsigned num_sect)
X
(
IMAGE_SCN_MEM_WRITE
,
"MEM_WRITE"
);
X
(
IMAGE_SCN_MEM_WRITE
,
"MEM_WRITE"
);
#undef X
#undef X
printf
(
"
\n\n
"
);
printf
(
"
\n\n
"
);
}
static
void
dump_sections
(
const
void
*
base
,
const
void
*
addr
,
unsigned
num_sect
)
{
const
IMAGE_SECTION_HEADER
*
sectHead
=
addr
;
unsigned
i
;
printf
(
"Section Table
\n
"
);
for
(
i
=
0
;
i
<
num_sect
;
i
++
,
sectHead
++
)
{
dump_section
(
sectHead
);
}
}
printf
(
"
\n
"
);
}
}
static
void
dump_dir_exported_functions
(
void
)
static
void
dump_dir_exported_functions
(
void
)
...
@@ -858,7 +862,7 @@ void dbg_dump(void)
...
@@ -858,7 +862,7 @@ void dbg_dump(void)
separateDebugHead
->
NumberOfSections
*
sizeof
(
IMAGE_SECTION_HEADER
)))
separateDebugHead
->
NumberOfSections
*
sizeof
(
IMAGE_SECTION_HEADER
)))
{
printf
(
"Can't get the sections, aborting
\n
"
);
return
;}
{
printf
(
"Can't get the sections, aborting
\n
"
);
return
;}
dump_sections
(
separateDebugHead
+
1
,
separateDebugHead
->
NumberOfSections
);
dump_sections
(
separateDebugHead
,
separateDebugHead
+
1
,
separateDebugHead
->
NumberOfSections
);
nb_dbg
=
separateDebugHead
->
DebugDirectorySize
/
sizeof
(
IMAGE_DEBUG_DIRECTORY
);
nb_dbg
=
separateDebugHead
->
DebugDirectorySize
/
sizeof
(
IMAGE_DEBUG_DIRECTORY
);
debugDir
=
PRD
(
sizeof
(
IMAGE_SEPARATE_DEBUG_HEADER
)
+
debugDir
=
PRD
(
sizeof
(
IMAGE_SEPARATE_DEBUG_HEADER
)
+
...
@@ -1193,7 +1197,7 @@ void pe_dump(void)
...
@@ -1193,7 +1197,7 @@ void pe_dump(void)
{
{
dump_pe_header
();
dump_pe_header
();
/* FIXME: should check ptr */
/* FIXME: should check ptr */
dump_sections
((
const
char
*
)
PE_nt_headers
+
sizeof
(
DWORD
)
+
dump_sections
(
PRD
(
0
,
1
),
(
const
char
*
)
PE_nt_headers
+
sizeof
(
DWORD
)
+
sizeof
(
IMAGE_FILE_HEADER
)
+
PE_nt_headers
->
FileHeader
.
SizeOfOptionalHeader
,
sizeof
(
IMAGE_FILE_HEADER
)
+
PE_nt_headers
->
FileHeader
.
SizeOfOptionalHeader
,
PE_nt_headers
->
FileHeader
.
NumberOfSections
);
PE_nt_headers
->
FileHeader
.
NumberOfSections
);
}
}
...
...
tools/winedump/winedump.h
View file @
15427221
...
@@ -237,6 +237,7 @@ unsigned int strlenW( const unsigned short *str );
...
@@ -237,6 +237,7 @@ unsigned int strlenW( const unsigned short *str );
void
dump_unicode_str
(
const
unsigned
short
*
str
,
int
len
);
void
dump_unicode_str
(
const
unsigned
short
*
str
,
int
len
);
void
dump_file_header
(
const
IMAGE_FILE_HEADER
*
);
void
dump_file_header
(
const
IMAGE_FILE_HEADER
*
);
void
dump_optional_header
(
const
IMAGE_OPTIONAL_HEADER32
*
,
UINT
);
void
dump_optional_header
(
const
IMAGE_OPTIONAL_HEADER32
*
,
UINT
);
void
dump_section
(
const
IMAGE_SECTION_HEADER
*
);
enum
FileSig
get_kind_exec
(
void
);
enum
FileSig
get_kind_exec
(
void
);
void
pe_dump
(
void
);
void
pe_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