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
ba5a86e3
Commit
ba5a86e3
authored
Dec 04, 2009
by
Owen Rudge
Committed by
Alexandre Julliard
Dec 07, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imagehlp: Check for 64-bit PE files in CheckSumMappedFile.
parent
b2770127
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
6 deletions
+26
-6
modify.c
dlls/imagehlp/modify.c
+26
-6
No files found.
dlls/imagehlp/modify.c
View file @
ba5a86e3
...
...
@@ -89,11 +89,14 @@ PIMAGE_NT_HEADERS WINAPI CheckSumMappedFile(
LPVOID
BaseAddress
,
DWORD
FileLength
,
LPDWORD
HeaderSum
,
LPDWORD
CheckSum
)
{
PIMAGE_NT_HEADERS
Header
;
IMAGE_DOS_HEADER
*
dos
=
(
IMAGE_DOS_HEADER
*
)
BaseAddress
;
PIMAGE_NT_HEADERS32
Header32
;
PIMAGE_NT_HEADERS64
Header64
;
DWORD
*
ChecksumFile
;
DWORD
CalcSum
;
DWORD
HdrSum
;
FIXME
(
"(%p, %d, %p, %p): stub
\n
"
,
TRACE
(
"(%p, %d, %p, %p)
\n
"
,
BaseAddress
,
FileLength
,
HeaderSum
,
CheckSum
);
...
...
@@ -101,8 +104,25 @@ PIMAGE_NT_HEADERS WINAPI CheckSumMappedFile(
BaseAddress
,
(
FileLength
+
1
)
/
sizeof
(
WORD
));
Header
=
RtlImageNtHeader
(
BaseAddress
);
HdrSum
=
Header
->
OptionalHeader
.
CheckSum
;
if
(
dos
->
e_magic
!=
IMAGE_DOS_SIGNATURE
)
return
NULL
;
Header32
=
(
IMAGE_NT_HEADERS32
*
)((
char
*
)
dos
+
dos
->
e_lfanew
);
if
(
Header32
->
Signature
!=
IMAGE_NT_SIGNATURE
)
return
NULL
;
if
(
Header32
->
OptionalHeader
.
Magic
==
IMAGE_NT_OPTIONAL_HDR32_MAGIC
)
ChecksumFile
=
&
Header32
->
OptionalHeader
.
CheckSum
;
else
if
(
Header32
->
OptionalHeader
.
Magic
==
IMAGE_NT_OPTIONAL_HDR64_MAGIC
)
{
Header64
=
(
IMAGE_NT_HEADERS64
*
)
Header32
;
ChecksumFile
=
&
Header64
->
OptionalHeader
.
CheckSum
;
}
else
return
NULL
;
HdrSum
=
*
ChecksumFile
;
/* Subtract image checksum from calculated checksum. */
/* fix low word of checksum */
...
...
@@ -129,9 +149,9 @@ PIMAGE_NT_HEADERS WINAPI CheckSumMappedFile(
CalcSum
+=
FileLength
;
*
CheckSum
=
CalcSum
;
*
HeaderSum
=
Header
->
OptionalHeader
.
CheckSum
;
*
HeaderSum
=
*
ChecksumFile
;
return
Header
;
return
(
PIMAGE_NT_HEADERS
)
Header32
;
}
/***********************************************************************
...
...
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