-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
跳过 d2hack.script 并配合 noCleanup,已经可以启动游戏。但是 battle.net 功能不可用,点击后会在检查版本…
…号之后报unhandled exception: ACCESS_VIOLATION(c00000005)。所以原版 d2loader.exe 应该是在 d2hack.script 加载阶段干了额外的事情。例如可能有一个内嵌于 d2loader.exe 的默认 d2hack.script,打了某些Patch。
- Loading branch information
Showing
3 changed files
with
61 additions
and
7 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
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 |
---|---|---|
@@ -1,8 +1,51 @@ | ||
#include "sub_407246.h" | ||
#include "../global-variables.h" | ||
#include "../constants.h" | ||
#include "sub_404ed0.h" | ||
|
||
DWORD sub_407246_D2DllEntry( | ||
DWORD oldGameState | ||
) | ||
{ | ||
return 0;//TODO | ||
if (oldGameState >= GAME_STATE_INVALID) | ||
{ | ||
sub_404ed0_LogFormat( | ||
LOG_TAG, | ||
"Got Bad Dll Entry %d", | ||
oldGameState | ||
); | ||
return GAME_STATE_NONE; | ||
} | ||
|
||
const char* fileName = global_dd_4011b0_gameStateDlls[oldGameState]; | ||
|
||
HMODULE hModule = LoadLibraryA( | ||
fileName | ||
); | ||
if (hModule == NULL) | ||
{ | ||
sub_404ed0_LogFormat( | ||
LOG_TAG, | ||
"Error Loading %s", | ||
fileName | ||
); | ||
return GAME_STATE_NONE; | ||
} | ||
|
||
fn_D2_QueryInterface query = (fn_D2_QueryInterface)GetProcAddress( | ||
hModule, | ||
"QueryInterface" | ||
); | ||
if (query == NULL) | ||
{ | ||
sub_404ed0_LogFormat( | ||
LOG_TAG, | ||
"Can not QueryInterface from %s", | ||
fileName | ||
); | ||
return GAME_STATE_NONE; | ||
} | ||
|
||
fn_D2_ComInt fn = *(fn_D2_ComInt*)query(); | ||
return (DWORD)fn(global_dd_408620_settings); | ||
} |