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
ea1689e7
Commit
ea1689e7
authored
Aug 22, 2014
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Add detection of fake dlls when determining a binary type.
parent
cf4404cf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
4 deletions
+18
-4
kernel_private.h
dlls/kernel32/kernel_private.h
+3
-2
module.c
dlls/kernel32/module.c
+12
-0
process.c
dlls/kernel32/process.c
+3
-2
No files found.
dlls/kernel32/kernel_private.h
View file @
ea1689e7
...
...
@@ -75,8 +75,9 @@ enum binary_type
BINARY_UNIX_LIB
};
#define BINARY_FLAG_DLL 0x01
#define BINARY_FLAG_64BIT 0x02
#define BINARY_FLAG_DLL 0x01
#define BINARY_FLAG_64BIT 0x02
#define BINARY_FLAG_FAKEDLL 0x04
struct
binary_info
{
...
...
dlls/kernel32/module.c
View file @
ea1689e7
...
...
@@ -339,6 +339,9 @@ void MODULE_get_binary_info( HANDLE hfile, struct binary_info *info )
{
if
(
len
>=
sizeof
(
ext_header
.
nt
.
FileHeader
))
{
static
const
char
fakedll_signature
[]
=
"Wine placeholder DLL"
;
char
buffer
[
sizeof
(
fakedll_signature
)];
info
->
type
=
BINARY_PE
;
info
->
arch
=
ext_header
.
nt
.
FileHeader
.
Machine
;
if
(
ext_header
.
nt
.
FileHeader
.
Characteristics
&
IMAGE_FILE_DLL
)
...
...
@@ -356,6 +359,15 @@ void MODULE_get_binary_info( HANDLE hfile, struct binary_info *info )
info
->
flags
|=
BINARY_FLAG_64BIT
;
break
;
}
if
(
header
.
mz
.
e_lfanew
>=
sizeof
(
header
.
mz
)
+
sizeof
(
fakedll_signature
)
&&
SetFilePointer
(
hfile
,
sizeof
(
header
.
mz
),
NULL
,
SEEK_SET
)
==
sizeof
(
header
.
mz
)
&&
ReadFile
(
hfile
,
buffer
,
sizeof
(
fakedll_signature
),
&
len
,
NULL
)
&&
len
==
sizeof
(
fakedll_signature
)
&&
!
memcmp
(
buffer
,
fakedll_signature
,
sizeof
(
fakedll_signature
)
))
{
info
->
flags
|=
BINARY_FLAG_FAKEDLL
;
}
}
}
else
if
(
!
memcmp
(
&
ext_header
.
os2
.
ne_magic
,
"NE"
,
2
))
...
...
dlls/kernel32/process.c
View file @
ea1689e7
...
...
@@ -2342,9 +2342,10 @@ static BOOL create_process_impl( LPCWSTR app_name, LPWSTR cmd_line, LPSECURITY_A
else
switch
(
binary_info
.
type
)
{
case
BINARY_PE
:
TRACE
(
"starting %s as Win%d binary (%p-%p, arch %04x)
\n
"
,
TRACE
(
"starting %s as Win%d binary (%p-%p, arch %04x
%s
)
\n
"
,
debugstr_w
(
name
),
(
binary_info
.
flags
&
BINARY_FLAG_64BIT
)
?
64
:
32
,
binary_info
.
res_start
,
binary_info
.
res_end
,
binary_info
.
arch
);
binary_info
.
res_start
,
binary_info
.
res_end
,
binary_info
.
arch
,
(
binary_info
.
flags
&
BINARY_FLAG_FAKEDLL
)
?
", fakedll"
:
""
);
retv
=
create_process
(
hFile
,
name
,
tidy_cmdline
,
envW
,
cur_dir
,
process_attr
,
thread_attr
,
inherit
,
flags
,
startup_info
,
info
,
unixdir
,
&
binary_info
,
FALSE
);
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