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.
Introduced ModLoader plugin and support
- Loading branch information
Showing
33 changed files
with
1,607 additions
and
101 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
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,32 @@ | ||
#pragma once | ||
#include "CLEO.h" | ||
//#include "CFileMgr.h" | ||
#include <string> | ||
|
||
namespace AntiHacks | ||
{ | ||
// checks if specific function call should be 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) // TODO: get the address from Plugin SDK | ||
{ | ||
// some older mods use CFileMgr::SetDir directly instead of 0A99 opcode. In older CLEO versions 0A99 supported only few predefined locations | ||
auto resolved = std::string(args[0].pcParam); | ||
resolved.resize(511); | ||
CLEO_ResolvePath(thread, resolved.data(), resolved.size()); | ||
|
||
CLEO::CLEO_SetScriptWorkDir(thread, resolved.c_str()); | ||
return false; | ||
} | ||
break; | ||
|
||
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
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.