Skip to content

Commit

Permalink
Added in some security
Browse files Browse the repository at this point in the history
  • Loading branch information
maximegmd committed Dec 20, 2020
1 parent b9170dd commit b07c274
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/reverse/RTTI.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ struct CRTTIBaseType
};

struct CClassFunction;
struct CBaseFunction;
struct CBaseFunction
{
uint8_t pad0[0x78];
int32_t flags;
};

struct CClass : CRTTIBaseType
{
Expand Down
5 changes: 5 additions & 0 deletions src/reverse/Scripting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ bool Scripting::Execute(const std::string& aCommand, std::string& aReturnMessage
auto* unk10 = engine->framework->unk10;

auto func = CRTTISystem::Get()->GetGlobalFunction(REDString::Hash(funcName.c_str()));
if (!func || func->flags & 1)
{
aReturnMessage = "Function : " + funcName + " not found or is not a global.";

This comment has been minimized.

Copy link
@Saibamen

Saibamen Dec 20, 2020

Contributor

Function:

return false;
}

const auto scriptable = unk10->GetTypeInstance(type);

Expand Down

0 comments on commit b07c274

Please sign in to comment.