-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d3edef6
commit 3ad092c
Showing
3 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
cmake_path(GET CMAKE_CURRENT_SOURCE_DIR FILENAME PROJECT_NAME) | ||
string(REPLACE " " "_" ProjectId ${PROJECT_NAME}) | ||
project(${PROJECT_NAME}) | ||
|
||
file(GLOB SOURCES "*.cpp" "*.h" "../Shared/*.cpp" "../../include/*.h" "../../include/*.hpp") | ||
add_library(${PROJECT_NAME} SHARED ${SOURCES}) | ||
|
||
set_target_properties( | ||
${PROJECT_NAME} | ||
PROPERTIES | ||
OUTPUT_NAME ${PROJECT_NAME} | ||
SUFFIX ".dll" | ||
) | ||
|
||
install( | ||
FILES $<TARGET_PDB_FILE:${PROJECT_NAME}> | ||
DESTINATION ${PROJECT_NAME} OPTIONAL | ||
) | ||
|
||
install( | ||
TARGETS ${PROJECT_NAME} | ||
DESTINATION ${PROJECT_NAME} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#include "stdafx.h" | ||
#include "helper.hpp" | ||
#include "memory.hpp" | ||
|
||
HMODULE baseModule{}; | ||
|
||
#define wstr(s) L#s | ||
#define wxstr(s) wstr(s) | ||
#define _PROJECT_NAME "DD2.Sharpness" | ||
#define _PROJECT_LOG_PATH _PROJECT_NAME L".log" | ||
|
||
const wchar_t* g_ProgramName = L"" _PROJECT_NAME; | ||
|
||
static void DisableSharpness() | ||
{ | ||
const unsigned char patch[] = { 0x0F, 0x57, 0xC0, 0x90, 0x90 }; | ||
WritePatchPattern(L"E8 ? ? ? ? 43 8D 04 12 0F 28 D0", patch, sizeof(patch), L"Disable Sharpness", 0); | ||
} | ||
|
||
static DWORD __stdcall Main(void*) | ||
{ | ||
baseModule = GetModuleHandle(L"DD2.exe"); | ||
if (baseModule) | ||
{ | ||
DisableSharpness(); | ||
} | ||
return false; | ||
} | ||
|
||
BOOL APIENTRY DllMain(HMODULE hModule, | ||
DWORD ul_reason_for_call, | ||
LPVOID lpReserved | ||
) | ||
{ | ||
switch (ul_reason_for_call) | ||
{ | ||
case DLL_PROCESS_ATTACH: | ||
{ | ||
return Main(0); | ||
} | ||
default: | ||
{ | ||
break; | ||
} | ||
} | ||
return TRUE; | ||
} |