Skip to content

Commit

Permalink
[O] Version bump from 1.2.5 to 1.2.9
Browse files Browse the repository at this point in the history
-bumped version
-hidden subprocess windows for external actions
-fixed injection code escape
-fixed 32-bit version layout
-updated pipelines version
-updated addon copyright year
-updated gui screenshots
-updated readme
  • Loading branch information
dwojtasik committed Jan 8, 2023
1 parent 4904312 commit 0cd5825
Show file tree
Hide file tree
Showing 23 changed files with 57 additions and 44 deletions.
4 changes: 2 additions & 2 deletions Addon/PyHookAddon.rc
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "Dominik Wojtasik"
VALUE "FileDescription", "Python hook for ReShade processing"
VALUE "FileVersion", "1.2.5"
VALUE "FileVersion", "1.2.9"
VALUE "InternalName", "PyHook.dll"
VALUE "LegalCopyright", "Copyright (C) 2023 Dominik Wojtasik"
VALUE "OriginalFilename", "PyHook.dll"
VALUE "ProductName", "PyHook Addon for ReShade"
VALUE "ProductVersion", "1.2.5"
VALUE "ProductVersion", "1.2.9"
END
END
BLOCK "VarFileInfo"
Expand Down
2 changes: 1 addition & 1 deletion Addon/data_types.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Dominik Wojtasik
* Copyright (C) 2023 Dominik Wojtasik
* SPDX-License-Identifier: MIT
*
* Data types for PyHook addon
Expand Down
2 changes: 1 addition & 1 deletion Addon/imgui_overlay.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Dominik Wojtasik
* Copyright (C) 2023 Dominik Wojtasik
* SPDX-License-Identifier: MIT
*
* ImGui overlay for PyHook addon
Expand Down
2 changes: 1 addition & 1 deletion Addon/imgui_overlay.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Dominik Wojtasik
* Copyright (C) 2023 Dominik Wojtasik
* SPDX-License-Identifier: MIT
*
* ImGui overlay for PyHook addon
Expand Down
4 changes: 2 additions & 2 deletions Addon/pyhook_main.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Dominik Wojtasik
* Copyright (C) 2023 Dominik Wojtasik
* SPDX-License-Identifier: MIT
*
* PyHook addon
Expand All @@ -13,7 +13,7 @@
#include <sstream>

// Export special variables for ReShade addon.
extern "C" __declspec(dllexport) const char* NAME = "PyHook"; //v1.2.5
extern "C" __declspec(dllexport) const char* NAME = "PyHook"; //v1.2.9
extern "C" __declspec(dllexport) const char* DESCRIPTION = "Passes processed back buffer to Python pipeline.";

// ReShade version
Expand Down
2 changes: 1 addition & 1 deletion PyHook/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
"""

# PyHook version.
__version__ = "1.2.5"
__version__ = "1.2.9"
24 changes: 12 additions & 12 deletions PyHook/gui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,18 +383,7 @@ def _on_key_release(event) -> None:
size=(4, 1),
tooltip="Try to automatically find process with ReShade and PyHook loaded",
),
]
+ [
sg.Checkbox(
"Show 32-bit apps",
default=False,
tooltip="Show 32-bit applications in process list but disables automatic injection.",
enable_events=True,
key=SGKeys.INJECT_ALLOW_32_BIT_CHECKBOX,
)
]
if _IS_64_BIT
else [],
],
[
sg.Frame(
"Sessions",
Expand Down Expand Up @@ -595,6 +584,17 @@ def _on_key_release(event) -> None:
],
]

if _IS_64_BIT:
_APP_LAYOUT[1].append(
sg.Checkbox(
"Show 32-bit apps",
default=False,
tooltip="Show 32-bit applications in process list but disables automatic injection.",
enable_events=True,
key=SGKeys.INJECT_ALLOW_32_BIT_CHECKBOX,
)
)


def open_github() -> None:
"""Opens PyHook GitHub page in default OS web browser."""
Expand Down
2 changes: 1 addition & 1 deletion PyHook/pipelines/ai_cartoon_gan.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from torchvision import transforms

name = "[AI] Cartoon-GAN"
version = "1.1.2"
version = "1.2.9"
desc = """Torch pipeline for AI cartoon stylization.
Based on "Cartoon-GAN" from:
https://github.com/FilipAndersson245/cartoon-gan"""
Expand Down
2 changes: 1 addition & 1 deletion PyHook/pipelines/ai_colorization.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import torch.nn.functional as F

name = "[AI] Colorization"
version = "1.1.2"
version = "1.2.9"
desc = """Torch pipeline for grayscale colorization.
Color image is converted to grayscale and colorization is applied.
Based on "Colorful Image Colorization" from:
Expand Down
2 changes: 1 addition & 1 deletion PyHook/pipelines/ai_depth_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
torch.backends.cudnn.enabled = True

name = "[AI] Depth Estimation"
version = "1.1.2"
version = "1.2.9"
desc = """Torch pipeline for depth estimation.
Based on "Towards Robust Monocular Depth Estimation: Mixing Datasets for Zero-shot Cross-dataset Transfer" from:
https://github.com/isl-org/MiDaS"""
Expand Down
2 changes: 1 addition & 1 deletion PyHook/pipelines/ai_dnn_super_resolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import cv2

name = "[AI] DNN Super Resolution"
version = "1.1.2"
version = "1.2.9"
desc = """OpenCV pipeline for DNN super resolution.
On first stage frame resolution is shorten by given multiplier.
On second stage selected super resolution is applied."""
Expand Down
2 changes: 1 addition & 1 deletion PyHook/pipelines/ai_multi_style_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from torch.autograd import Variable

name = "[AI] Multi Style Transfer"
version = "1.1.2"
version = "1.2.9"
desc = """Torch pipeline for fast multi style transfer.
Based on "PyTorch-Style-Transfer" from:
https://github.com/zhanghang1989/PyTorch-Multi-Style-Transfer"""
Expand Down
2 changes: 1 addition & 1 deletion PyHook/pipelines/ai_object_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import torchvision

name = "[AI] Object Detection (YOLOv5)"
version = "1.1.2"
version = "1.2.9"
desc = """Torch pipeline for object detection.
Based on "YOLOv5" from:
https://github.com/ultralytics/yolov5"""
Expand Down
2 changes: 1 addition & 1 deletion PyHook/pipelines/ai_semantic_segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import torch.nn.functional as F

name = "[AI] Semantic Segmentation"
version = "1.1.2"
version = "1.2.9"
desc = """Torch pipeline for semantic segmentation.
Based on "PIDNet: A Real-time Semantic Segmentation Network Inspired from PID Controller" from:
https://github.com/XuJiacong/PIDNet"""
Expand Down
2 changes: 1 addition & 1 deletion PyHook/pipelines/ai_style_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from torchvision import transforms

name = "[AI] Style Transfer"
version = "1.1.2"
version = "1.2.9"
desc = """Torch pipeline for fast style transfer.
Based on "Fast neural style with MobileNetV2 bottleneck blocks" from:
https://github.com/mmalotin/pytorch-fast-neural-style-mobilenetV2"""
Expand Down
2 changes: 1 addition & 1 deletion PyHook/pipelines/cv2_sharpen.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import cv2

name = "[CV2] Sharpen"
version = "1.1.2"
version = "1.2.9"
desc = "OpenCV sharpen filter"
supports = [64]

Expand Down
2 changes: 1 addition & 1 deletion PyHook/pipelines/test_rgb.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import numpy as np

name = "[Test] RGB"
version = "1.1.2"
version = "1.2.9"
desc = "Dummy pipeline for testing. Tests RGB manipulation and multiple UI settings."
supports = [32, 64]

Expand Down
2 changes: 1 addition & 1 deletion PyHook/pipelines/test_static_img.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import cv2

name = "[Test] Static Image"
version = "1.1.2"
version = "1.2.9"
desc = "Dummy pipeline for testing. Displays static image."
supports = [32, 64]

Expand Down
21 changes: 16 additions & 5 deletions PyHook/utils/external.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
from subprocess import check_call
from zipfile import ZipFile

from utils.common import get_frozen_path, is_frozen_bundle
from win.api import CREATE_NO_WINDOW

# Directory for 32-bit data.
_LIB32_DIRECTORY = "lib32"
# Version of pyinjector module.
Expand Down Expand Up @@ -40,7 +43,9 @@ def unpack_32bit_injector() -> None:
"--platform win32 "
"--python-version 3.10 "
f"pyinjector=={_PYINJECTOR_VERSION}"
)
),
shell=False,
creationflags=CREATE_NO_WINDOW,
)
whl_path = f"pyinjector-{_PYINJECTOR_VERSION}-cp310-cp310-win32.whl"
with ZipFile(whl_path, "r") as whl_archive:
Expand All @@ -61,18 +66,24 @@ def inject_external(exe_path: str, pid: int, dll_path: str) -> None:
pid (int): Process ID.
dll_path (str): DLL path.
"""
lib_init = abspath(f"{_LIB32_DIRECTORY}\\pyinjector\\__init__.py")
lib_init = f"{_LIB32_DIRECTORY}\\pyinjector\\__init__.py"
if is_frozen_bundle():
lib_init = get_frozen_path(lib_init)
else:
lib_init = abspath(lib_init)
check_call(
[
exe_path,
"-c",
(
"""import importlib, sys;"""
"""import importlib.util, sys;"""
f"""spec = importlib.util.spec_from_file_location("pyinjector_ext", "{lib_init}");"""
"""module = importlib.util.module_from_spec(spec);"""
"""sys.modules["pyinjector_ext"] = module;"""
"""spec.loader.exec_module(module);"""
f"""module.inject({pid}, "{dll_path}")"""
),
]
).replace("\\", "\\\\"),
],
shell=False,
creationflags=CREATE_NO_WINDOW,
)
14 changes: 8 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ PyHook
GUI consists of few elements:

- Menu bar, where user can change app settings, verify pipelines files, install pipelines requirements, update app and show information about it.
- In 64-bit version of PyHook there is also checkbox that allows to select 32-bit processes.
- Injection bar, where user can find given process automatically or by search bar using process name or id.
- Session list, where user can see all active/dead sessions. Each session have icon (if possible to get from .exe file by Windows API), executable name and process id. Active sessions have green border, dead are using red color.
- Session overview, where user can see live logs and timings (on screenshot below) from given session, kill it or restart (if it was stopped by any reason).
Expand Down Expand Up @@ -412,13 +413,14 @@ Requirements
Runtime
-------
- `ReShade <https://reshade.me/>`_ >= 5.0.0
- `Python <https://www.python.org/>`_ == ``3.10.6 for 64-bit`` | ``3.10.4 for 32-bit`` (for pipelines only)
- `CUDA <https://developer.nvidia.com/cuda-zone>`_ == 11.3\* (optional for AI pipelines only)
- `cuDNN <https://developer.nvidia.com/cudnn>`_ == 8.4.1\* (optional for AI pipelines only)
- `Python <https://www.python.org/>`_ == ``3.10.6 for 64-bit``\* | ``3.10.4 for 32-bit`` (for pipelines only)
- `CUDA <https://developer.nvidia.com/cuda-zone>`_ == 11.3\*\* (optional for AI pipelines only)
- `cuDNN <https://developer.nvidia.com/cudnn>`_ == 8.4.1\*\* (optional for AI pipelines only)
- | Only for specific pipelines: Any libraries that are required by pipeline code.
| Do note that AI pipelines that requires PyTorch or TensorFlow will not work on 32-bit system because libraries does not support it.
\* CUDA and cuDNN version should be last supported by your GPU and pipeline modules.
| \* 64-bit version of PyHook also uses 32-bit Python executable for injecting addon DLL into 32-bit processes.
| \*\* CUDA and cuDNN version should be last supported by your GPU and pipeline modules.
Build
-----
Expand Down Expand Up @@ -625,8 +627,8 @@ Breaking changes
History
=======

NEXT / DEV
----------
1.2.9 (2023-01-08)
------------------
- Now 64-bit PyHook supports AI pipelines for 32-bit applications.
- Added information about supported platform (either 32-bit, 64-bit or both) to pipelines.
- Added possibility to inject into 32-bit application in 64-bit PyHook.
Expand Down
4 changes: 2 additions & 2 deletions VERSION.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ VSVersionInfo(
u'040904B0',
[StringStruct(u'CompanyName', u'Dominik Wojtasik'),
StringStruct(u'FileDescription', u'PyHook'),
StringStruct(u'FileVersion', u'1.2.5'),
StringStruct(u'FileVersion', u'1.2.9'),
StringStruct(u'InternalName', u'PyHook.exe'),
StringStruct(u'LegalCopyright', u'Copyright (C) 2023 Dominik Wojtasik'),
StringStruct(u'OriginalFilename', u'PyHook.exe'),
StringStruct(u'ProductName', u'PyHook'),
StringStruct(u'ProductVersion', u'1.2.5')])
StringStruct(u'ProductVersion', u'1.2.9')])
]
),
VarFileInfo([VarStruct(u'Translation', [1033, 1200])])
Expand Down
Binary file modified docs/images/gui.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/timings.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0cd5825

Please sign in to comment.