Skip to content

Commit 562ea44

Browse files
committed
Better README and removed manual permissions section
1 parent 581ee5e commit 562ea44

File tree

1 file changed

+13
-21
lines changed

1 file changed

+13
-21
lines changed

README.md

+13-21
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Windows Photo Viewer Patcher
2-
32
## Patch "Out of memory" exception when opening images containing an unknown color profile
43

54
Tested on:
@@ -9,27 +8,22 @@ Windows 10 Pro Version 1903 Build 18362.356
98
Windows 10 Version 22H2 Build 19045.2486
109
Windows 11 Pro 10.0.22000 build 22000
1110
```
12-
# Why?
1311

14-
Why not?
15-
Windows Photo Viewer is EOL but i like it and a lot of people still use it. Besides, on like a fresh install of Windows 7 you have nothing else to open images (except Paint).
12+
### Why?
1613

17-
# Before you start
14+
Why not?
15+
Windows Photo Viewer is EOL but i like it and a lot of people still use it. Besides, on a fresh install of Windows 7 you have nothing else to open images (except Paint).
1816

19-
To patch the dll or replace it you'll have to give yourself full permissions to the file and folder.
17+
### Before you start
2018

21-
1) Take ownership of ImagingEngine.dll.
22-
2) Give your user "Complete access" permissions to ImagingEngine.dll.
23-
3) Copy ImagingEngine.dll to a folder you have full access to (Desktop for example).
24-
4) Patch the dll.
25-
5) Copy back the dll.
19+
The DLL we need to patch (ImagingEngine.dll) is usually located in ```"C:\Program Files\Windows Photo Viewer\"``` or ```"C:\Program Files (x86)\Windows Photo Viewer\"```.
20+
I suggest patching both the x86 and x64 dll, most of the times Windows uses the x86 one even if you are in a x64 environment
2621

27-
I suggest patching both the x86 and x64 dll, most of the times Windows uses the x86 one even if you are in a x64 environment.
28-
Sometimes the antivirus may flag the .exe but it's a false positive, please add it to the exclusions list.
22+
Note that sometimes the antivirus may flag the .exe but it's a false positive and you can safely add it to the exclusions list.
2923

30-
# How does it work?
24+
### How does it work?
3125

32-
When the image contains an unknown icc profile Windows Photo Viewer tries to perform color mapping by calling **CreateMultiProfileTransform** but fails. We can patch the check to ignore the invalid icc profile.
26+
When the image contains an unknown icc profile Windows Photo Viewer tries to perform color mapping by calling **CreateMultiProfileTransform** but fails, we can patch the check to ignore the invalid icc profile and move on.
3327
What happens if we ignore the invalid profile? Does it use the default one? I really don't know, I only know it starts working.
3428

3529
The function flow looks like this:
@@ -45,7 +39,7 @@ The function flow looks like this:
4539

4640
Changing the check from JNE to JMP opens the image correctly. Ignoring exceptions maybe but do we care? I think not.
4741

48-
# Wanna make your own patch?
42+
### Wanna make your own patch?
4943

5044
1) Open PhotoViewer. ```rundll32.exe [path to PhotoViewer.dll],ImageView_Fullscreen [path to image]```
5145

@@ -57,10 +51,8 @@ Changing the check from JNE to JMP opens the image correctly. Ignoring exception
5751
4) Search for an intermodular call to **CreateMultiProfileTransform**
5852
5) Change the **JNE** to **JMP**
5953

60-
# Alternative method (patch the single image instead of the software)
61-
62-
You can edit the image with an hex editor like HxD and "corrupt the profile indication".
54+
### Alternative method (patch the single image instead of the software)
6355

56+
You can edit the image with an hex editor like HxD and corrupt the color profile indication.
6457
Search for the string **ICC_PROFILE** and just change a random letter (for example make it ICC_aROFILE).
65-
66-
You can now normally open the image on every computer without needing the patch
58+
You can now normally open the image on every computer without needing the patch

0 commit comments

Comments
 (0)