Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
e27c7e06
Commit
e27c7e06
authored
Feb 18, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedump: Print the "prefer native" Wine flag.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
37600028
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
29 deletions
+20
-29
output.c
tools/winedump/output.c
+10
-26
pe.c
tools/winedump/pe.c
+10
-3
No files found.
tools/winedump/output.c
View file @
e27c7e06
...
...
@@ -234,41 +234,25 @@ void output_c_preamble (void)
puts
(
"Creating a forwarding DLL"
);
fputs
(
"
\n
HMODULE hDLL=0; /* DLL to call */
\n\n
"
,
cfile
);
}
fprintf
(
cfile
,
"BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void "
"*reserved)
\n
{
\n
"
fprintf
(
cfile
,
"BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved)
\n
{
\n
"
" TRACE(
\"
(%%p, %%u, %%p)
\\
n
\"
, instance, reason, reserved);
\n\n
"
" switch (reason)
\n
"
" {
\n
"
" case DLL_WINE_PREATTACH:
\n
"
" return FALSE; /* prefer native version */
\n
"
" case DLL_PROCESS_ATTACH:
\n
"
);
if
(
globals
.
forward_dll
)
fprintf
(
cfile
,
" case DLL_PROCESS_ATTACH:
\n
"
" hDLL = LoadLibraryA(
\"
%s
\"
);
\n
"
" TRACE(
\"
Forwarding DLL (%s) loaded (%%p)
\\
n
\"
, hDLL);
\n
"
,
globals
.
forward_dll
,
globals
.
forward_dll
);
else
fprintf
(
cfile
,
" DisableThreadLibraryCalls(instance);
\n
"
);
fprintf
(
cfile
,
" break;
\n
"
);
if
(
globals
.
forward_dll
)
fprintf
(
cfile
,
" TRACE(
\"
Forwarding DLL (%s) loaded (%%p)
\\
n
\"
, hDLL);
\n
"
" DisableThreadLibraryCalls(instance);
\n
"
" break;
\n
"
" case DLL_PROCESS_DETACH:
\n
"
" FreeLibrary(hDLL);
\n
"
" TRACE(
\"
Forwarding DLL (%s) freed
\\
n
\"
);
\n
"
" break;
\n
"
,
globals
.
forward_dll
);
fprintf
(
cfile
,
" break;
\n
"
" }
\n\n
"
" return TRUE;
\n
}
\n
"
);
" return TRUE;
\n
}
\n
"
,
globals
.
forward_dll
,
globals
.
forward_dll
,
globals
.
forward_dll
);
}
}
...
...
tools/winedump/pe.c
View file @
e27c7e06
...
...
@@ -45,8 +45,14 @@
#include "winbase.h"
#include "winedump.h"
#define IMAGE_DLLCHARACTERISTICS_PREFER_NATIVE 0x0010
/* Wine extension */
static
const
IMAGE_NT_HEADERS32
*
PE_nt_headers
;
static
const
char
builtin_signature
[]
=
"Wine builtin DLL"
;
static
const
char
fakedll_signature
[]
=
"Wine placeholder DLL"
;
static
int
is_builtin
;
const
char
*
get_machine_str
(
int
mach
)
{
switch
(
mach
)
...
...
@@ -95,13 +101,13 @@ static const IMAGE_NT_HEADERS32 *get_nt_header( void )
const
IMAGE_DOS_HEADER
*
dos
;
dos
=
PRD
(
0
,
sizeof
(
*
dos
));
if
(
!
dos
)
return
NULL
;
is_builtin
=
(
dos
->
e_lfanew
>=
sizeof
(
*
dos
)
+
32
&&
!
memcmp
(
dos
+
1
,
builtin_signature
,
sizeof
(
builtin_signature
)
));
return
PRD
(
dos
->
e_lfanew
,
sizeof
(
DWORD
)
+
sizeof
(
IMAGE_FILE_HEADER
));
}
void
print_fake_dll
(
void
)
{
static
const
char
builtin_signature
[]
=
"Wine builtin DLL"
;
static
const
char
fakedll_signature
[]
=
"Wine placeholder DLL"
;
const
IMAGE_DOS_HEADER
*
dos
;
dos
=
PRD
(
0
,
sizeof
(
*
dos
)
+
32
);
...
...
@@ -214,7 +220,8 @@ static inline void print_subsys(const char *title, WORD value)
static
inline
void
print_dllflags
(
const
char
*
title
,
WORD
value
)
{
printf
(
" %-34s 0x%04X
\n
"
,
title
,
value
);
#define X(f,s) if (value & f) printf(" %s\n", s)
#define X(f,s) do { if (value & f) printf(" %s\n", s); } while(0)
if
(
is_builtin
)
X
(
IMAGE_DLLCHARACTERISTICS_PREFER_NATIVE
,
"PREFER_NATIVE (Wine extension)"
);
X
(
IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA
,
"HIGH_ENTROPY_VA"
);
X
(
IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE
,
"DYNAMIC_BASE"
);
X
(
IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY
,
"FORCE_INTEGRITY"
);
...
...
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