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
fc51760f
Commit
fc51760f
authored
Jun 22, 2004
by
Filip Navara
Committed by
Alexandre Julliard
Jun 22, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unprotect Import Address Table while filling it.
parent
4e0b5829
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
loader.c
dlls/ntdll/loader.c
+16
-1
No files found.
dlls/ntdll/loader.c
View file @
fc51760f
...
...
@@ -373,6 +373,9 @@ static WINE_MODREF *import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *d
WCHAR
buffer
[
32
];
const
char
*
name
=
get_rva
(
module
,
descr
->
Name
);
DWORD
len
=
strlen
(
name
)
+
1
;
PVOID
protect_base
;
DWORD
protect_size
=
0
;
DWORD
protect_old
;
thunk_list
=
get_rva
(
module
,
(
DWORD
)
descr
->
FirstThunk
);
if
(
descr
->
u
.
OriginalFirstThunk
)
...
...
@@ -405,6 +408,14 @@ static WINE_MODREF *import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *d
return
NULL
;
}
/* unprotect the import address table since it can be located in
* readonly section */
while
(
import_list
[
protect_size
].
u1
.
Ordinal
)
protect_size
++
;
protect_base
=
thunk_list
;
protect_size
*=
sizeof
(
*
thunk_list
);
NtProtectVirtualMemory
(
GetCurrentProcess
(),
&
protect_base
,
&
protect_size
,
PAGE_WRITECOPY
,
&
protect_old
);
imp_mod
=
wmImp
->
ldr
.
BaseAddress
;
exports
=
RtlImageDirectoryEntryToData
(
imp_mod
,
TRUE
,
IMAGE_DIRECTORY_ENTRY_EXPORT
,
&
exp_size
);
...
...
@@ -429,7 +440,7 @@ static WINE_MODREF *import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *d
import_list
++
;
thunk_list
++
;
}
return
wmImp
;
goto
done
;
}
while
(
import_list
->
u1
.
Ordinal
)
...
...
@@ -465,6 +476,10 @@ static WINE_MODREF *import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *d
import_list
++
;
thunk_list
++
;
}
done:
/* restore old protection of the import address table */
NtProtectVirtualMemory
(
GetCurrentProcess
(),
&
protect_base
,
&
protect_size
,
protect_old
,
NULL
);
return
wmImp
;
}
...
...
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