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
d6617258
Commit
d6617258
authored
Jan 06, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedump: List exported functions sorted by ordinal.
parent
9a847b3a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
27 deletions
+17
-27
pe.c
tools/winedump/pe.c
+17
-27
No files found.
tools/winedump/pe.c
View file @
d6617258
...
...
@@ -469,7 +469,7 @@ static void dump_dir_exported_functions(void)
const
DWORD
*
pFunc
;
const
DWORD
*
pName
;
const
WORD
*
pOrdl
;
DWORD
*
map
;
DWORD
*
funcs
;
if
(
!
exportDir
)
return
;
...
...
@@ -496,37 +496,27 @@ static void dump_dir_exported_functions(void)
pOrdl
=
RVA
(
exportDir
->
AddressOfNameOrdinals
,
exportDir
->
NumberOfNames
*
sizeof
(
WORD
));
if
(
!
pOrdl
)
{
printf
(
"Can't grab functions' ordinal table
\n
"
);
return
;}
/* bit map of used funcs */
map
=
calloc
(((
exportDir
->
NumberOfFunctions
+
31
)
&
~
31
)
/
32
,
sizeof
(
DWORD
));
if
(
!
map
)
fatal
(
"no memory"
);
funcs
=
calloc
(
exportDir
->
NumberOfFunctions
,
sizeof
(
*
funcs
)
);
if
(
!
funcs
)
fatal
(
"no memory"
);
for
(
i
=
0
;
i
<
exportDir
->
NumberOfNames
;
i
++
,
pName
++
,
pOrdl
++
)
{
map
[
*
pOrdl
/
32
]
|=
1
<<
(
*
pOrdl
%
32
);
for
(
i
=
0
;
i
<
exportDir
->
NumberOfNames
;
i
++
)
funcs
[
pOrdl
[
i
]]
=
pName
[
i
];
printf
(
" %08X %4u %s"
,
pFunc
[
*
pOrdl
],
exportDir
->
Base
+
*
pOrdl
,
get_symbol_str
((
const
char
*
)
RVA
(
*
pName
,
sizeof
(
DWORD
))));
/* check for forwarded function */
if
((
const
char
*
)
RVA
(
pFunc
[
*
pOrdl
],
sizeof
(
void
*
))
>=
(
const
char
*
)
exportDir
&&
(
const
char
*
)
RVA
(
pFunc
[
*
pOrdl
],
sizeof
(
void
*
))
<
(
const
char
*
)
exportDir
+
size
)
printf
(
" (-> %s)"
,
(
const
char
*
)
RVA
(
pFunc
[
*
pOrdl
],
1
));
printf
(
"
\n
"
);
}
pFunc
=
RVA
(
exportDir
->
AddressOfFunctions
,
exportDir
->
NumberOfFunctions
*
sizeof
(
DWORD
));
if
(
!
pFunc
)
{
printf
(
"Can't grab functions' address table
\n
"
);
free
(
map
);
return
;
}
for
(
i
=
0
;
i
<
exportDir
->
NumberOfFunctions
;
i
++
)
{
if
(
pFunc
[
i
]
&&
!
(
map
[
i
/
32
]
&
(
1
<<
(
i
%
32
))))
{
printf
(
" %08X %4u <by ordinal>
\n
"
,
pFunc
[
i
],
exportDir
->
Base
+
i
);
}
if
(
!
pFunc
[
i
])
continue
;
printf
(
" %08X %5u "
,
pFunc
[
i
],
exportDir
->
Base
+
i
);
if
(
funcs
[
i
])
{
printf
(
"%s"
,
get_symbol_str
((
const
char
*
)
RVA
(
funcs
[
i
],
sizeof
(
DWORD
))));
/* check for forwarded function */
if
((
const
char
*
)
RVA
(
pFunc
[
i
],
1
)
>=
(
const
char
*
)
exportDir
&&
(
const
char
*
)
RVA
(
pFunc
[
i
],
1
)
<
(
const
char
*
)
exportDir
+
size
)
printf
(
" (-> %s)"
,
(
const
char
*
)
RVA
(
pFunc
[
i
],
1
));
printf
(
"
\n
"
);
}
else
printf
(
"<by ordinal>
\n
"
);
}
free
(
map
);
free
(
funcs
);
printf
(
"
\n
"
);
}
...
...
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