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
90cc0942
Commit
90cc0942
authored
Apr 21, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedump: Print entry point names in code range lists.
parent
7e8ac46a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
22 deletions
+58
-22
pe.c
tools/winedump/pe.c
+58
-22
No files found.
tools/winedump/pe.c
View file @
90cc0942
...
...
@@ -647,6 +647,30 @@ static void dump_section_apiset(void)
}
}
static
const
char
*
find_export_from_rva
(
UINT
rva
)
{
UINT
i
,
*
func_names
;
const
UINT
*
funcs
;
const
UINT
*
names
;
const
WORD
*
ordinals
;
const
IMAGE_EXPORT_DIRECTORY
*
dir
;
const
char
*
ret
=
NULL
;
if
(
!
(
dir
=
get_dir
(
IMAGE_FILE_EXPORT_DIRECTORY
)))
return
NULL
;
if
(
!
(
funcs
=
RVA
(
dir
->
AddressOfFunctions
,
dir
->
NumberOfFunctions
*
sizeof
(
DWORD
)
)))
return
NULL
;
names
=
RVA
(
dir
->
AddressOfNames
,
dir
->
NumberOfNames
*
sizeof
(
DWORD
)
);
ordinals
=
RVA
(
dir
->
AddressOfNameOrdinals
,
dir
->
NumberOfNames
*
sizeof
(
WORD
)
);
func_names
=
calloc
(
dir
->
NumberOfFunctions
,
sizeof
(
*
func_names
)
);
for
(
i
=
0
;
i
<
dir
->
NumberOfNames
;
i
++
)
func_names
[
ordinals
[
i
]]
=
names
[
i
];
for
(
i
=
0
;
i
<
dir
->
NumberOfFunctions
&&
!
ret
;
i
++
)
if
(
funcs
[
i
]
==
rva
)
ret
=
get_symbol_str
(
RVA
(
func_names
[
i
],
sizeof
(
DWORD
)
));
free
(
func_names
);
if
(
!
ret
&&
rva
==
PE_nt_headers
->
OptionalHeader
.
AddressOfEntryPoint
)
return
"<EntryPoint>"
;
return
ret
;
}
static
void
dump_dir_exported_functions
(
void
)
{
unsigned
int
size
;
...
...
@@ -1833,26 +1857,26 @@ static void dump_hybrid_metadata(void)
{
const
IMAGE_ARM64EC_METADATA
*
data
=
metadata
;
printf
(
"Version %#x
\n
"
,
(
int
)
data
->
Version
);
printf
(
"CodeMap %#x
\n
"
,
(
int
)
data
->
CodeMap
);
printf
(
"CodeMapCount %#x
\n
"
,
(
int
)
data
->
CodeMapCount
);
printf
(
"CodeRangesToEntryPoints %#x
\n
"
,
(
int
)
data
->
CodeRangesToEntryPoints
);
printf
(
"RedirectionMetadata %#x
\n
"
,
(
int
)
data
->
RedirectionMetadata
);
printf
(
"__os_arm64x_dispatch_call_no_redirect %#x
\n
"
,
(
int
)
data
->
__os_arm64x_dispatch_call_no_redirect
);
printf
(
"__os_arm64x_dispatch_ret %#x
\n
"
,
(
int
)
data
->
__os_arm64x_dispatch_ret
);
printf
(
"__os_arm64x_dispatch_call %#x
\n
"
,
(
int
)
data
->
__os_arm64x_dispatch_call
);
printf
(
"__os_arm64x_dispatch_icall %#x
\n
"
,
(
int
)
data
->
__os_arm64x_dispatch_icall
);
printf
(
"__os_arm64x_dispatch_icall_cfg %#x
\n
"
,
(
int
)
data
->
__os_arm64x_dispatch_icall_cfg
);
printf
(
"AlternateEntryPoint %#x
\n
"
,
(
int
)
data
->
AlternateEntryPoint
);
printf
(
"AuxiliaryIAT %#x
\n
"
,
(
int
)
data
->
AuxiliaryIAT
);
printf
(
"CodeRangesToEntryPointsCount %#x
\n
"
,
(
int
)
data
->
CodeRangesToEntryPointsCount
);
printf
(
"RedirectionMetadataCount %#x
\n
"
,
(
int
)
data
->
RedirectionMetadataCount
);
printf
(
"GetX64InformationFunctionPointer %#x
\n
"
,
(
int
)
data
->
GetX64InformationFunctionPointer
);
printf
(
"SetX64InformationFunctionPointer %#x
\n
"
,
(
int
)
data
->
SetX64InformationFunctionPointer
);
printf
(
"ExtraRFETable %#x
\n
"
,
(
int
)
data
->
ExtraRFETable
);
printf
(
"ExtraRFETableSize %#x
\n
"
,
(
int
)
data
->
ExtraRFETableSize
);
printf
(
"__os_arm64x_dispatch_fptr %#x
\n
"
,
(
int
)
data
->
__os_arm64x_dispatch_fptr
);
printf
(
"AuxiliaryIATCopy %#x
\n
"
,
(
int
)
data
->
AuxiliaryIATCopy
);
printf
(
"
Version %#x
\n
"
,
(
int
)
data
->
Version
);
printf
(
"
CodeMap %#x
\n
"
,
(
int
)
data
->
CodeMap
);
printf
(
"
CodeMapCount %#x
\n
"
,
(
int
)
data
->
CodeMapCount
);
printf
(
"
CodeRangesToEntryPoints %#x
\n
"
,
(
int
)
data
->
CodeRangesToEntryPoints
);
printf
(
"
RedirectionMetadata %#x
\n
"
,
(
int
)
data
->
RedirectionMetadata
);
printf
(
"
__os_arm64x_dispatch_call_no_redirect %#x
\n
"
,
(
int
)
data
->
__os_arm64x_dispatch_call_no_redirect
);
printf
(
"
__os_arm64x_dispatch_ret %#x
\n
"
,
(
int
)
data
->
__os_arm64x_dispatch_ret
);
printf
(
"
__os_arm64x_dispatch_call %#x
\n
"
,
(
int
)
data
->
__os_arm64x_dispatch_call
);
printf
(
"
__os_arm64x_dispatch_icall %#x
\n
"
,
(
int
)
data
->
__os_arm64x_dispatch_icall
);
printf
(
"
__os_arm64x_dispatch_icall_cfg %#x
\n
"
,
(
int
)
data
->
__os_arm64x_dispatch_icall_cfg
);
printf
(
"
AlternateEntryPoint %#x
\n
"
,
(
int
)
data
->
AlternateEntryPoint
);
printf
(
"
AuxiliaryIAT %#x
\n
"
,
(
int
)
data
->
AuxiliaryIAT
);
printf
(
"
CodeRangesToEntryPointsCount %#x
\n
"
,
(
int
)
data
->
CodeRangesToEntryPointsCount
);
printf
(
"
RedirectionMetadataCount %#x
\n
"
,
(
int
)
data
->
RedirectionMetadataCount
);
printf
(
"
GetX64InformationFunctionPointer %#x
\n
"
,
(
int
)
data
->
GetX64InformationFunctionPointer
);
printf
(
"
SetX64InformationFunctionPointer %#x
\n
"
,
(
int
)
data
->
SetX64InformationFunctionPointer
);
printf
(
"
ExtraRFETable %#x
\n
"
,
(
int
)
data
->
ExtraRFETable
);
printf
(
"
ExtraRFETableSize %#x
\n
"
,
(
int
)
data
->
ExtraRFETableSize
);
printf
(
"
__os_arm64x_dispatch_fptr %#x
\n
"
,
(
int
)
data
->
__os_arm64x_dispatch_fptr
);
printf
(
"
AuxiliaryIATCopy %#x
\n
"
,
(
int
)
data
->
AuxiliaryIATCopy
);
if
(
data
->
CodeMap
)
{
...
...
@@ -1868,6 +1892,8 @@ static void dump_hybrid_metadata(void)
}
}
if
(
PE_nt_headers
->
FileHeader
.
Machine
==
IMAGE_FILE_MACHINE_ARM64
)
break
;
if
(
data
->
CodeRangesToEntryPoints
)
{
const
IMAGE_ARM64EC_CODE_RANGE_ENTRY_POINT
*
map
=
RVA
(
data
->
CodeRangesToEntryPoints
,
...
...
@@ -1876,8 +1902,13 @@ static void dump_hybrid_metadata(void)
printf
(
"
\n
Code ranges to entry points
\n
"
);
printf
(
" Start - End Entry point
\n
"
);
for
(
i
=
0
;
i
<
data
->
CodeRangesToEntryPointsCount
;
i
++
)
printf
(
" %08x - %08x %08x
\n
"
,
{
const
char
*
name
=
find_export_from_rva
(
map
[
i
].
EntryPoint
);
printf
(
" %08x - %08x %08x"
,
(
int
)
map
[
i
].
StartRva
,
(
int
)
map
[
i
].
EndRva
,
(
int
)
map
[
i
].
EntryPoint
);
if
(
name
)
printf
(
" %s"
,
name
);
printf
(
"
\n
"
);
}
}
if
(
data
->
RedirectionMetadata
)
...
...
@@ -1887,7 +1918,12 @@ static void dump_hybrid_metadata(void)
printf
(
"
\n
Entry point redirection
\n
"
);
for
(
i
=
0
;
i
<
data
->
RedirectionMetadataCount
;
i
++
)
printf
(
" %08x -> %08x
\n
"
,
(
int
)
map
[
i
].
Source
,
(
int
)
map
[
i
].
Destination
);
{
const
char
*
name
=
find_export_from_rva
(
map
[
i
].
Source
);
printf
(
" %08x -> %08x"
,
(
int
)
map
[
i
].
Source
,
(
int
)
map
[
i
].
Destination
);
if
(
name
)
printf
(
" (%s)"
,
name
);
printf
(
"
\n
"
);
}
}
break
;
}
...
...
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