forked from cleolibrary/CLEO4
-
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
Showing
29 changed files
with
1,762 additions
and
111 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
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
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,34 @@ | ||
#pragma once | ||
#include "CLEO.h" | ||
#include <string> | ||
|
||
namespace AntiHacks | ||
{ | ||
// checks if specific function call is allowed. Performs replacement action if needed | ||
static bool CheckCall(CLEO::CRunningScript* thread, void* function, void* object, CLEO::SCRIPT_VAR* args, size_t argCount, DWORD& result) | ||
{ | ||
switch ((size_t)function) | ||
{ | ||
case 0x005387D0: // CFileMgr::SetDir(const char* relPath) | ||
{ | ||
// some older mods used CFileMgr::SetDir directly instead of 0A99 opcode | ||
auto resolved = std::string(args[0].pcParam); | ||
resolved.resize(MAX_PATH); | ||
CLEO_ResolvePath(thread, resolved.data(), resolved.size()); | ||
|
||
CLEO::CLEO_SetScriptWorkDir(thread, resolved.c_str()); | ||
return false; | ||
} | ||
break; | ||
|
||
// TODO: ? | ||
// 0x00836F1E: int _chdir(LPCSTR lpPathName) | ||
// 0x0085824C: imp_SetCurrentDirectoryA | ||
|
||
default: | ||
break; | ||
} | ||
|
||
return true; // allow | ||
} | ||
}; |
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
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,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.4.33213.308 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CLEO_ModLoader_Plugin", "CLEO_ModLoader_Plugin.vcxproj", "{E04BB51D-A37D-491E-BAA0-D95D0D5C1563}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|x86 = Debug|x86 | ||
Release|x86 = Release|x86 | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{E04BB51D-A37D-491E-BAA0-D95D0D5C1563}.Debug|x86.ActiveCfg = Debug|Win32 | ||
{E04BB51D-A37D-491E-BAA0-D95D0D5C1563}.Debug|x86.Build.0 = Debug|Win32 | ||
{E04BB51D-A37D-491E-BAA0-D95D0D5C1563}.Release|x86.ActiveCfg = Release|Win32 | ||
{E04BB51D-A37D-491E-BAA0-D95D0D5C1563}.Release|x86.Build.0 = Release|Win32 | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {27E214E3-AE89-40E1-9B76-0C5C9DB3452C} | ||
EndGlobalSection | ||
EndGlobal |
Oops, something went wrong.